List of callbacks¶
GP Script provides the following callbacks:
Rackspace activation¶
-
On
Activate
()¶ Called whenever rackspace is activated
-
On
Deactivate
()¶ Called whenever we deactivate a rackspace
Variations¶
MIDI Events¶
Important
All these callbacks require a global GP Script variable associated with a MIDI In block.
For the examples in the reference, the name of the MIDI In block will be A800
.
-
On
NoteOnEvent
(m)From A800
¶ Called whenever a NoteOn message is received
- Parameters
m (NoteMessage) –
- Requirement
A global GP Script variable associated with a MIDI In block
-
On
NoteOffEvent
(m)From A800
¶ Called whenever a NoteOff message is received
- Parameters
m (NoteMessage) –
- Requirement
A global GP Script variable associated with a MIDI In block
-
On
NoteEvent
(m)From A800
¶ Called whenever a NoteOn or NoteOff message is received
- Parameters
m (NoteMessage) –
- Requirement
A global GP Script variable associated with a MIDI In block
Warning
This callback will not be invoked for NoteOn events or for NoteOff events if you have defined
NoteOnEvent
orNoteOffEvent
respectively callbacks.
-
On
ControlChangeEvent
(c)From A800
¶ - Parameters
c (ControlChangeMessage) –
- Requirement
A global GP Script variable associated with a MIDI In block
-
On
PitchBendEvent
(p)From A800
¶ - Parameters
p (PitchBendMessage) –
- Requirement
A global GP Script variable associated with a MIDI In block
-
On
AftertouchEvent
(a)From A800
¶ - Parameters
a (AfterTouchMessage) – Represents the current channel Aftertouch pressure
- Requirement
A global GP Script variable associated with a MIDI In block
Todo
How can the data in
a
be accessed?
-
On
PolytouchEvent
(p)From A800
¶ - Parameters
p (PolyTouchMessage) – Represents note-specific pressure
- Requirement
A global GP Script variable associated with a MIDI In block
-
On
ProgramChangeEvent
(p)From A800
¶ - Parameters
p (ProgramChangeMessage) –
- Requirement
A global GP Script variable associated with a MIDI In block
Constrained MIDI events¶
The Note events (NoteEvent
, NoteOnEvent
, NoteOffEvent
) and the ControlChangeEvent
callbacks can optionally include a constraint that specifies either a range or an explicit sequence of numbers for which the callback is triggered.
For example:
On NoteEvent (m : NoteMessage) Matching [C3..C4] From A800
// This event is only called if you play a note with
// a MIDI note number that is in the range 60 to 72
End
On ControlChangeEvent (c : ControlChangeMessage) Matching 1,7,14 From A800
// This event is only called for controller numbers
// 1, 7 or 14
End
When you used constrained events, you can have multiple events of the same kind as long as their ranges have no overlaps. The main purpose of this mechanism is to allow you to specify callbacks for specific purposes without having to handle all events in your script. For example, you might create a callback to handle key switches where the bottom octave of your keyboard is used for controlling some effects while notes in other octaves are handled normally. If you create a callback with no constraints, then any subsequent callbacks with constraints will cause a compilation error because your non-constrained callback is handling all possible values. On the other hand, if you create some callbacks with constraints and add a non-constrained callback afterwards, then that last callback will apply just to values that have not been specified in previously defined constrained callbacks.
Widget Events¶
Plugin Events¶
Generator events¶
-
On
TimePassing
(x, y)¶ - Parameters
- Requirement
A global variable associated with a generator
OSC messages¶
-
On
OSCMessageReceived
(message)Matching StringConstant
¶ StringConstant
will be an explicit OSC Address to which this callback will respond. Use the OSC functions in the system library to access the arguments of the received message.- Parameters
message (OSCMessage) –