JSBKtl a MIDIKtl class for adc and haho's JoyStickBox -
a Doepfer PocketControl kit with 8 joysticks.
The layout is:
js1X/Y js2X/Y js3X/Y js4X/Y
snap
js5X/Y js6X/Y js7X/Y js8X/Y
NanoKtl, etc
first example
// make a new PFKtl
f = JSBKtl.new;
// map a single slider's action
f.mapCC(\js1X, { |ccval| "JSBKtl: js1X ccval %\n".postf(ccval) });
f.mapCC(\js1Y, { |ccval| "JSBKtl: js1Y ccval %\n".postf(ccval) });
Class Variables
*verbose // a flag whether the class posts extended info
PFKtl.verbose = true;
PFKtl.verbose = false;
Instance Variables
softWithin how close controllers should be for soft takeOver (default 0.05).
see also softSet.
ctlNames a dictionary of the controller element names and their midi info.
lastVals the last values that come from each controller element (used for softSet)
Methods
*new(uid) make a new PFKtl. uid is an optional ID for the MIDI port to listen to.
f = JSBKtl.new;
f.dump
mapCC(ctl, action)
// map a single slider's action
f.mapCC(\js8X, { |ccval| "JSBKtl test: js8X ccval %\n".postf(ccval) });
// all valid names are:
f.orderedCtlNames;
mapToEnvirGui(gui, indices) - map to an EnvirGui.
gui the gui
indices which sliders to map to. default is [1, 2 .. 8].
(
Spec.add(\harm, [1, 100]);
e = EnvirGui.new( (freq: 120, amp: 0.2, harm: 12, otto: 10), 4);
f.mapToEnvirGui(e);
)
mapToPdefGui(gui, indices) - map to a PdefGui.
mapToTdefGui(gui, indices) - map to a TdefGui.
gui the gui
indices which sliders to map to. default is [1, 2 .. 8].
(
Tdef(\a, { |e| 100.do { |i| i.postln; 0.5.wait } });
t = TdefGui(Tdef(\a), 4);
Tdef(\a).set(\freq, 200, \dur, 0.1, \otto, 12, \ann, 1234);
f.mapToPdefGui(t, (5..8));
)
mapToNdefGui(gui, indices, lastIsVol) - map to an NdefGui.
gui the gui
indices which sliders to map to. default is [1, 2 .. 8].
lastIsVol flag whether the last slider becomes a volume control for that editor.
( // make an Ndef and its editor first
Spec.add(\harm, [2, 200, \exp]);
Ndef(\a, { |freq = 20, harm = 20, pan, amp, rate, rq, detune| Blip.ar(freq, harm) });
g = NdefGui(Ndef(\a), 8);
f.mapToNdefGui(g, (9..16));
)
mapToMixer(mixer, numVols, lastEdIsVol, lastIsMaster) map to a proxymixer.
mixer is the mixer to map to.
the left hand sliders (sliders 1 to splitIndex) are mapped to volumes;
the right hand sliders map to the mixer.editGui parameters.
lastIsMaster: if true, the rightmost control maps to server volume.
lastEdIsVol: if true, the last free slider on the right side is used for
the edited proxy's volume.
(
Spec.add(\harm, [2, 200, \exp]);
Ndef(\a, { |freq = 20, harm = 20, pan, amp, rate, rq, detune| Blip.ar(freq, harm) });
10.do { |i|
Ndef(("test" ++ i).asSymbol, {
Pan2.ar(Ringz.ar(Impulse.ar(exprand(0.5, 4)), exprand(300, 3000), 0.02), 1.0.rand2, 0.2)
}).play(vol: 0.2)
;
};
m = NdefMixer(s, 7);
m.switchSize(2);
m.editGui.proxy_(Ndef(\a));
f.mapToMixer(m, 7);
)
// maybe add flags for mapping arScroller and paramGui.scroller as well?