Class MidiController
Object
|
+--Controller
|
+--MidiController
- class
MidiController
- extends Controller
The Midi Controller holds callbacks to javascript on midi events.
Assign functions to the callback to handle events:
Example:
mc = new MidiController();
register_controller(mc);
mc.event_ctrl = function (ch, param, value) {
echo("midi event ctrl called: " + ch + ", " + param + ", " + value);
// do something
return true;
}
You want to use a tool like aconnect/aconnectgui to wire the midi devices.
You may return true or false in the event handlers to indicate further processing or not. However, this is not implemented properly, yet.
Author: Mr Goil
Defined in Controller.js
Constructor Summary |
MidiController()
The Midi Controller constructor creates a midi controller
|
Method Summary |
int
|
connect_from(<int> myport, <int> dest_client, <int> dest_port)
connect an midi output port with freej input.
|
bool
|
event_ctrl(<int> ch, <int> param, <int> value)
Callback on midi event_ctl.
|
bool
|
event_noteoff(<int> ch, <int> note, <int> vel)
Callback on midi event_noteoff
|
bool
|
event_noteon(<int> ch, <int> note, <int> vel)
Callback on midi event_noteon
|
bool
|
event_pgmchange(<int> ch, <int> param, <int> value)
Callback on midi event_pgmchange
|
bool
|
event_pitch(<int> ch, <int> param, <int> value)
Callback on midi event_pitch
|
MidiController
MidiController()
The Midi Controller constructor creates a midi controller
connect_from
int connect_from(<int> myport, <int> dest_client, <int> dest_port)
connect an midi output port with freej input.
connect_to() isn't implemented, yet ... ;)
Parameters:
myport
- freej port number, usually 0
dest_client
- lookup the input source with "aconnect -li"
dest_port
- port number of the input client
Returns:
status 0 on success, -16 Device or resource busy, -22 Invalid argument
event_ctrl
bool event_ctrl(<int> ch, <int> param, <int> value)
Callback on midi event_ctl.
Usually this is triggered when moving a sliders or button.
Returns:
true if event is handled otherwise false
event_noteoff
bool event_noteoff(<int> ch, <int> note, <int> vel)
Callback on midi event_noteoff
Returns:
true if event is handled otherwise false
event_noteon
bool event_noteon(<int> ch, <int> note, <int> vel)
Callback on midi event_noteon
Returns:
true if event is handled otherwise false
event_pgmchange
bool event_pgmchange(<int> ch, <int> param, <int> value)
Callback on midi event_pgmchange
Returns:
true if event is handled otherwise false
event_pitch
bool event_pitch(<int> ch, <int> param, <int> value)
Callback on midi event_pitch
A pitch slider is like event_ctl but they have '0' zero in the middle.
in the middle position.
Parameters:
value
- range -8192 to 8192, steps of 128
Returns:
true if event is handled otherwise false
FreeJ scripting documentation is Copyleft (C) 2000 - 2007 dyne.org foundation. Verbatim copying and distribution of this entire page is permitted in any medium, provided this notice is preserved.
Send inquiries & questions to dyne.org's hackers.
Documentation generated by
JSDoc on Thu May 29 20:56:52 2008