ExtensionWhen creating a new CVCenterKeyboard you may have noticed the argument addRecorder in CVCenterKeyboard: *new or CVCenterKeyboard: *newSynthDef which is by default set to true. I.e. if that argument is left unchanged a new CVCenterKeyboardRecorder instance, assigned to your CVCenterKeyboard instance will be created automatically. Now you should be able to record any sequence you play on your keyboard by executing the -record method once. Executing this method again will stop recording and the just recorded sequence should play instantly.
First code example:
Create a new CVCenterKeyboardRecorder instance. It is recommended not to use this method directly as you will not be able to use shortcuts assigned to the CVCenterKeyboard instance like CVCenterKeyboard: -record. Instead, if you have set the argument addRecorder in CVCenterKeyboard: *new or CVCenterKeyboard: *newSynthDef to false, use CVCenterKeyboard: -addRecorder.
| keyboard |
The CVCenterKeyboard instance to which this CVCenterKeyboardRecorder instance shall be assigned. |
An Event, holding all CVCenterKeyboardRecorder instances under the names of the parent CVCenterKeyboard instances.
Calling this method will start (or stop) recording strokes on the external MIDI keyboard into a Pattern sequencer. For each note on the external keyboard (0-127) a separate Pseq is created where noteOn and notOff will create a sequence of durations composed of numbers (as long as a note is held) and Rests. Current control values should also be respected. Each of the recorded notes and the Synth control's current values are put into a Pbind (128 separate Pbinds) and get wrapped into a Ppar which in turn gets wrapped in a Pdef instance which is then set as source of an Ndef instance. The generated sequence should start playing immediately after ending sampling by calling this method again. The resulting Pdefs can be queried with -pdef. You may record as many sequences as you like. Each of them will be stored in a Pdef under a key that is a combination of the SynthDef's name and a numerical counter (e.g. Pdef('multi-1')).
| onOff |
Optional - a Boolean, instructing the CVCenterKeyboardRecorder instance explicitly to start or stop recording. |
Clear recorded keyboard sequences, either all at once (if no keys are given) or only those denoted by the argument keys. Sequences are stored in a List that can be inspected by calling -pdef. However, as sequences are held in Pdefs as source of an Ndef they may also be addressed by the name/key of the regarding Ndef. If keys are given as Integers the method will internally query the correct Ndef at the given index. If the arument keys is omitted all sequences will be removed.
| ... keys |
Optional - one or more Strings, Symbols or Integers addressing the sequence(s) to be removed from the CVCenterKeyboardRecorder instance. |
A List, holding all currently recorded keyboard sequences.
The CVCenterKeyboard the CVCenterKeyboardRecorder instance has been assigned to.
If set to true the following will be posted:
As described in CVCenterKeyboard: *new and CVCenterKeyboard: *newSynthDef, respectively CVCenterKeyboard: -addTouchOSC you may add control through an external OSC device or application. The properties of this connection are held in an instance of CVCenterKeyboardTouchOSC. Though this class refers to the infamous TouchOSC application for Android and iOS it is not necessarily required to use TouchOSC. However, when you install CVCenterKeyboard (the library) it should also contain a TouchOSC layout that should work out of the box with CVCenterKeyboard. If you prefer a different application that uses other OSC commands you may configure CVCenterKeyboardTouchOSC or its instances to respond to and send suiting your application.
When working with an external OSC controller you will have to provide a NetAddr either when instanciating a new CVCenterKeyboard or add a CVCenterKeyboardTouchOSC instance using that specific NetAddr instance to your CVCenterKeyboard instance:
As soon as you have instanciated your keyboard a new tab labeled
player: <keyboard name>
will appear in the CVCenter gui, holding one widget (representing an instance of CVWidgetKnob), labeled like the following:
[<keyboard name>] remove all sequences
After having recorded a first sequence on your keyboard the tab in the CVCenter gui will hold three more widgts, labeled like the following:
[<keyboard name>] <SynthDef name>-<sequence number> amp[<keyboard name>] <SynthDef name>-<sequence number> pause[<keyboard name>] <SynthDef name>-<sequence number> removeWith each new sequence three more widgets of that kind will be added to the tab.
If a CVCenterKeyboardTouchOSC instance is present these widgets will automatically be connected to the TouchOSC layout included with the CVCenterKeyboard library (if you have installed TouchOSC and uploaded the layout to TouchOSC). The first widget will let you set the amplitude of the recorded sequence, the second will let you pause/resume the sequence and the third one will let you remove a recorded sequence.
The widget labeled [<keyboard name>] remove all sequences removes all recorded sequences at once, all their associated widgets and resets the CVCenterKeyboardRecorder instance. This widget will prevail even if you remove all sequences and their associated widget as it will also work with all future sequences.