Hi All,
Just wanted to give a heads up on status here. I'm happy to say that
MIDI input has hit it's first milestone, getting MIDI input to
generate Csound SCO notes to turn on/off instruments! I still have to
work out some of the mappings for key and amplitude (i.e. using scala
scales), but it's getting there. I have not yet figured out how I'm
going to work out recording of notes into SoundObjects, but I am
taking one step at a time.
A note about the design: currently, I am going with forcing this
format for note on:
i<instrId>.<midiNoteNum> 0 -1 <pitch> <vel>
where pitch and velocity go through mapping functions, and this format
for note offs:
i-<instrId>.<midiNoteNum> 0 0
>From my early test this works well, and if there are hung MIDI notes,
the all notes off button works fine. I had originally spent a lot of
time considering a generic format for notes, but I think really that
it would be better to force a 5 pfield format as that is what matches
MIDI's note-on convention. One can make instruments work for both
MIDI-initiated notes from blue and with your own custom format by
looking at pcount equal to 5 and doing realtime related code there,
and then doing whatever else you might like otherwise. I'll have
examples of this when 2.1 goes out the door. Otherwise, I am finding
that the "r" opcodes that add a release time to be great and will
probably migrate to using that for all ADSR-style envelopes in all of
my work, as it makes sense whether working from MIDI or SCO I believe.
One thing to note, I did see immediately that BSBDropdown is somewhat
lacking in that it is not automatable considering it replaces content
via string value. I think now what I will do is add an automatable
flag that if used, will ignore the value part of the key/value and
just use the index. This will help make things work for backwards
compatibility and not require a new object (and should help get code
migrated to make automatable easier). So, for example, if you have
these key values set for BSBDropdown:
sine/0
triangle/1
square/2
pulse/4
saw/8
if you set it automatable, instead of using the values on the right,
the values would be one of [0,1,2,3,4] depending on what is selected.
Does this sound like a good way to go? The reason for using index like
this is that for it to be a k-rate signal, it has to be a number,
which can't be guaranteed if using key/value.
Also to note, for 2.1, I am targeting only working with MIDI note
on/note offs. I will probably look at the audio track work for 2.2,
and return to MIDI in 2.3 to consider MIDI controllers. This will
give more time to consider the design for controllers and mapping.
Thanks!
steven
|