I've just seen this amazing tutorial on Tables and Arrays.
But I was left with a doubt relative to tables / arrays.
In the example he sequences a small collection of notes, and mentions that logic could be used to build a sequencer in PD.
But in his example, he has an array with only one note at a time, as in a monophonic instrument.
What if one needs to build a sequencer for a polyphonic instrument? How to store two notes at a time, or chords ? How to have stored the velocity for each note?
Are there bi-dimensional arrays in PD... or multi-dimensional?
Or can we store objects, like instances of a Class, inside arrays? That way each object could be a "event" with multiple sub-events within, and the respective information for each.
Or are Lists used for this purpose ?
I am not very experienced in PD neither am I in Android development, I'm just a coder who's OK in the Java programming language. I intend to build an Android app using libpd for one of it's features - a screen with a piano-roll type of sequencer that plays the notes using a simple sine wave.
I don't come to ask for solutions but for some light ahead of my path - what kind of development roadmap do I have ahead? How should I implement my idea?
The idea is simple:
1 - a sequencer like in this picture: http://tangram.dnsalias.net/lmms/0.3.1/tutorial-1stsong/variation-2.png
2 - the sequencer plays a single Sine wave
3 - to have the ability to change the synth's ADSR parameters at any time
4 - if I click the piano keys on the left I hear the note's sound
5 - to be able to export the composition to MIDI
As you can see, the synth requirement is extremely basic. Creating a simple sine wave synth in PD with editable ADSR is something I already know how to do!
But to make it work with such sequencer, I have no idea. What will I need from PD and how should I integrate it with a UI ? Can the sequencer logic be made in PD?
create a pd patch that's a simple Sinusoid synth with adjustable ADSR parameters
create another PD patch that's a sequencer, that would work with the previous patch to emit sounds?
make a patch that's the combination of both above ?
should I use PD just for the sound synthesis and use just java code for the sequencing ? Would this be even reliable ?
does MIDI need to have any role in this? I only want to export MIDI files with the composition, nothing more.
Thanks for reading this far! Again, I'm just asking for advice on the kind of development roadmap I have ahead, so any tiny tip that guides me will be greatly appreciated!
ps: My apologies if I'm not posting this in the correct section, after reading the sections' Abouts I'm still unsure where to post this
yes the writeable number of notes will be 82 I think, like a piano. Then in the synth I will limit the polyphony to 16. But technically it must be possible to add 82 simultaneous notes to the sequencer visually, even though the polyphony will be limited in the end.
It may help to clarify that my intent is to build a sequencer, like a piano-roll. A simple piano roll! I wonder why there isn't one out there yet. Then I will have another app using the patch and representing visually whatever contents of the sequencer the patch has stored, or is running.
Therefore it is a must to be able to the edit any notes stored at any place in time and to add notes at any place in time! And it should allow infinite length for the composition, like in piano rolls such as the ones of Ableton Live's MIDI clips.
Martin Brinkmann said:
"tables might become huge for longer sequences and high time precision, so it might be a better idea to store this kind of sequences in lists or data structures, though you will not have random access to the individual notes with that."
That sounds like I'm screwed! Tables lose precision and lists and data structures don't provide me access to individual notes?
Does that mean it's impossible to store the contents of a piano roll sequencer in PD?..