I really appreciate those videos, they helped me a lot! I still have an issue with using my MIDI controller with supercollider: The latency is too big and I can't find any way to make it reasonable. Did anyone ever encounter this? (I'm using windows)
This question would probably be better answered by someone who’s actually had this problem and fixed it. My experience is mostly limited to macOS. I suspect this is a hardware/driver issue, unrelated to your controller or SC. I would guess using a dedicated audio/MIDI interface might be a solution. Some questions: If you simply print (postln) the incoming MIDI data in SC, is the latency still present? Or does the latency only happen when using MIDI to generate sound? Does this latency happen in other audio/MIDI software, like a DAW? Or only SC? Doing some investigating and answering questions like this can sometimes help isolate the source of the problem.
( MIDIdef.noteOn( ote, { arg val, num; [val, num].postln; ~notes.at(num) = Synth(\saw, [ freq:num.midicps, amp: val.linlin(0,127,-40,-6).dbamp ]); }); ) Running this piece of the code I get a Syntax Error saying that the '=' in line 4 is unexpected and that a '}' is expected. Anyone else face this issue?
Took me a few minutes to figure this out! I think the issue is that the 'at' method is only designed as a getter, but you're trying to use it as a setter, and I guess this just isn't allowed by design. But fortunately, the fix is easy. Instead of: ~notes.at(num) = Synth(...); you can do this: ~notes[num] = Synth(...); or this: ~notes.put(num, Synth(...)) Here's a simplified demonstration of the problem and solution: n = [4]; n.at(0) = 5; // fails n[0] = 6; // works n.put(0, 7); // also works
I really appreciate those videos, they helped me a lot!
I still have an issue with using my MIDI controller with supercollider: The latency is too big and I can't find any way to make it reasonable. Did anyone ever encounter this? (I'm using windows)
This question would probably be better answered by someone who’s actually had this problem and fixed it. My experience is mostly limited to macOS.
I suspect this is a hardware/driver issue, unrelated to your controller or SC. I would guess using a dedicated audio/MIDI interface might be a solution. Some questions:
If you simply print (postln) the incoming MIDI data in SC, is the latency still present? Or does the latency only happen when using MIDI to generate sound?
Does this latency happen in other audio/MIDI software, like a DAW? Or only SC?
Doing some investigating and answering questions like this can sometimes help isolate the source of the problem.
Fantastic tutorial!. I'm just wondering how I would go about mapping two control knobs to the X and Y slider in a Slider2D object?
Something like this?
MIDIIn.connectAll;
(
var ccx = 0, ccy = 1; // change these to desired MIDI controller numbers
~s2d = Slider2D.new().front;
MIDIdef.cc(\x, {|n| {~s2d.x_(n/127)}.defer }, ccx);
MIDIdef.cc(\y, {|n| {~s2d.y_(n/127)}.defer }, ccy);
)
(
MIDIdef.noteOn(
ote, {
arg val, num;
[val, num].postln;
~notes.at(num) = Synth(\saw, [
freq:num.midicps,
amp: val.linlin(0,127,-40,-6).dbamp
]);
});
)
Running this piece of the code I get a Syntax Error saying that the '=' in line 4 is unexpected and that a '}' is expected. Anyone else face this issue?
Took me a few minutes to figure this out! I think the issue is that the 'at' method is only designed as a getter, but you're trying to use it as a setter, and I guess this just isn't allowed by design. But fortunately, the fix is easy. Instead of:
~notes.at(num) = Synth(...);
you can do this:
~notes[num] = Synth(...);
or this:
~notes.put(num, Synth(...))
Here's a simplified demonstration of the problem and solution:
n = [4];
n.at(0) = 5; // fails
n[0] = 6; // works
n.put(0, 7); // also works