8000 Ideas for Midi controller input · Issue #17 · kylestetz/lissajous · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Ideas for Midi controller input #17
Open
@kylestetz

Description

@kylestetz

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.

controller = new midi()
t = new track()
t.notes( controller.keys.notes() )
t.beat( controller.keys.beat() )
t.vol( controller.cc(20).map(0,1) )

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:

  1. 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).

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0