************* Not updated for new JITGuis yet! ****************
BCRKtl a class for handling mappings of the Behringer BCR2000
Inherits from: Object : MIDIController
The BCR2000 produces only MIDI controller events. Its controllers (knobs, knobs in push-mode and buttons) have different cc numbers. BCRKtl keeps a dictionary of actions for all mapped controllers.
A dictionary of names such as \knA1 to controller keys as used for the mapping lookup:
'knA1' is the 1st row knob1
'knD3' is the 4th row knob3
'tr8' is the top row knob8 in push mode
'btA1' is the 1st row (of buttons) button1
etc. See the source code for the full names:
Meta_BCRKtl.methods.last.openCodeFile
Don't forget to change the values of your MIDICC in the class,
in the dictionary of last method called "*makeDefaults", depending on your BCR2000 settings:
The keys are symbols like '0_42' meaning midichannel 0, ctl num 42.
See also: UsingMIDI, CCResponder, MIDIIn
Creation / Class Methods
*new (srcID, dict) create a BCRKtl object.
srcID - every MIDI port (e.g. from a USB plug) gets a unique ID.
This can be used to distinguish multiple controller which may have
overlapping MIDI channel/controller numbers.
dict - a dictionary of the actions that are mapped to controllers.
// simple example
g = BCRKtl.new; // listen to all midi in ports
// g = BCRKtl(1643926019); // only listen to left USB input on my laptop
g.ccDict; // a dict where the maps will live
g.ccresp; // a midi CCResponder listing to that MIDI port
// map top-left knob and bottom-right button to simple actions:
g.mapCC('knA1', { |ch, cc, val| " 'top-left knb': %.\n".postf([ch, cc, val]) });
g.mapCC('btB8', { |ch, cc, val| " 'bottom-right btn': %.\n".postf([ch, cc, val]) });
// the actions are now in the dict:
g.ccDict.postcs;
g.free;
Class Variables
verbose
can be set to true to post info for debugging.
BCRKtl.verbose = true;
BCRKtl.verbose = false;
Instance Methods
mapCC (editor, scene)
map one of the controls in a scene to a general function.
g = BCRKtl.new; // listen to all midi in ports
g.mapCC('knA1', { |ch, cc, val| " top row, knob1: %.\n".postf([ch, cc, val]) });
g.mapCC('tr2', { |ch, cc, val| " top row, knob2, push-mode: %.\n".postf([ch, cc, val]) });
g.mapCC('btA3', { |ch, cc, val| " 1st button row, button3: %.\n".postf([ch, cc, val]) });
g.mapCC('knD8', { |ch, cc, val| " bottom-row, knob8: %.\n".postf([ch, cc, val]) });
g.ccDict;
g.free;
mapToPxPars (proxy, pairs)
map some controllers to a NodeproxyEditor or Ndef.
(
p = ProxySpace.push;
~test = { |freq=250, intv=19, timescale=1, curve=0, loopnode=0, formfact=2, widfact=0.5, spread=1, amp=0.1|
var env = EnvGen.kr(
Env(
{ 1.0.rand2 }!11,
{1.0.rand}!10 * timescale,
curve,
releaseNode: 9,
loopNode: loopnode)
);
var pitch = (env * [1, 0.33, -1] * intv).midiratio * freq;
Formant.ar(pitch, pitch.scramble * formfact, pitch.scramble * widfact), spread) * amp;
};
// add specs for all the parameter ranges - required!
Spec.add(\intv, [0, 36, \lin]);
Spec.add(\timescale, [0.001, 10, \exp]);
Spec.add(\curve, [-10, 10]);
Spec.add(\loopnode, [0, 7, \lin, 1]);
Spec.add(\formfact, [0.1, 10, \exp]);
Spec.add(\widfact, [0.1, 10, \exp]);
Spec.add(\spread, \unipolar);
n = NodeProxyEditor(~test);
);
// make a new BCRKtl
g = BCRKtl.new;
// map top-left button to play/stop
g.mapCC(\btA1, { |ch, cc, val| if(val>0, {~test.play}, {~test.stop}) });
// and map parameters to some controllers
(
g.mapToPxPars(~test,
[\knB1, \freq],
[\knB2, \intv],
[\knB3, \timescale],
[\knB4, \curve],
[\knB5, \loopnode],
[\knB6, \formfact],
[\knB7, \widfact],
[\knB8, \spread]
);
);
// clean up
(
~test.clear;
g.free;
)