You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to get down some notes I had on a possible midi controller API. I would love some feedback!
It would be cool to have a midi object, instantiated via var controller = new midi() (perhaps with some arguments to select the correct controller), and then use its functions the same way generators are used on tracks.
So that controller.keys has several methods that return events from the keys, such as:
notes(): returns MIDI note values
beat(): returns events that trigger notes
map(min, max): returns the key values (0-127) mapped to the min & max
And controller.cc(number) has methods that return events from CC controllers:
map(min, max): returns controller values (0-127) mapped to the min & max
?
Philosophy
My thought on this is that new CC and key values will only be read when a beat is triggered. This is consistent with how Lissajous currently interprets parameter sequences. There are two details of the implementation worth mentioning:
schedulers will need to accept event handlers so that controller.keys.beat() can trigger a note, which will be more complicated because they already accept callbacks. This means it might have to be an object that inherits a prototype for the purposes of type checking (if typeof === 'MidiEvent etc).
To avoid reading cc values from the midi controller (which would not be possible if you are mapping key values to a parameter) the last value for a given control will need to be cached. This should be really easy to create, simply saving anything that comes in and using that as the data source for the functions passed into parameters.
The text was updated successfully, but these errors were encountered:
I wanted to get down some notes I had on a possible midi controller API. I would love some feedback!
It would be cool to have a
midi
object, instantiated viavar controller = new midi()
(perhaps with some arguments to select the correct controller), and then use its functions the same way generators are used on tracks.So that
controller.keys
has several methods that return events from the keys, such as:notes()
: returns MIDI note valuesbeat()
: returns events that trigger notesmap(min, max)
: returns the key values (0-127) mapped to the min & maxAnd
controller.cc(number)
has methods that return events from CC controllers:map(min, max)
: returns controller values (0-127) mapped to the min & maxPhilosophy
My thought on this is that new CC and key values will only be read when a beat is triggered. This is consistent with how Lissajous currently interprets parameter sequences. There are two details of the implementation worth mentioning:
schedulers will need to accept event handlers so that
controller.keys.beat()
can trigger a note, which will be more complicated because they already accept callbacks. This means it might have to be an object that inherits a prototype for the purposes of type checking (if typeof === 'MidiEvent
etc).To avoid reading cc values from the midi controller (which would not be possible if you are mapping key values to a parameter) the last value for a given control will need to be cached. This should be really easy to create, simply saving anything that comes in and using that as the data source for the functions passed into parameters.
The text was updated successfully, but these errors were encountered: