Hi there,
I’ve got an old MIDI controller (a “Hercules DJ Console”) that I’d like to use with SC. Some of the controls send what I think are called ‘relative’ controls - a downward move sends a stream of CC values of ‘127’, while an upward move sends a stream of ‘1’ values. So it only sends values of 1 or 127. Obviously I can’t use a regular Spec to map those values.
I made a little test:
MIDIIn.connectAll;
m = MIDIIn.findPort("Hercules DJ Console", "Port 2");
f = 220; // freq
(
MIDIdef.cc(\midiCC,
{ |val, cc, chan, src|
if(cc == 46, {
if(val == 1, { f = f + 1 });
if(val == 127, { f = f - 1 });
x.set(\freq, f);
f.postln;
});
},
srcID: m.uid,
);
)
x = Synth(\default, [\freq, f]);
(
// when done
x.release;
MIDIdef.cc(\midiCC).free;
)
This is pretty bad for actual use.
I might be wrong, but I think that when using relative MIDI controls, you have to take the speed of change into account, so faster moves will make bigger changes. I’m not sure if that’s even correct, let alone how to implement it.
Also, I’ve got no idea how to map the incoming 1 or 127 value to an arbitrary range (like for example, the range in \freq.asSpec
).
Meanwhile, I’ve also started using MKtl for some projects, and hoped it might have something built in. Unfortunately, I can’t find anything in the docs. A solution using either MIDIdef, MKtl or both would be good.
Does anyone have any strategies for using a ‘relative’ MIDI controller with SC?
Thanks very much,
Jim