Hi there!
I’m very new to supercollider and I hope somebody here can help me.
A few years back I wrote a script that worked very well. A few weeks ago I wanted to revisit the script but I couldn’t get it to work. I tried some things I googled but to no avail. In other words: I’m stuck.
This is the script:
s.boot;
MIDIClient.init;
MIDIIn.connect(0,4);
(
~noten = Array.newClear(128);
MIDIdef.noteOn("TestOn", { | vel, noteNum |
~noten[noteNum] = Synth.new("Stimme", ["midiNote", noteNum])
});
MIDIdef.noteOff("TestOff", { | vel, noteNum |
~noten[noteNum].release;
});
SynthDef.new("Stimme", { | midiNote |
var in, out, freq, env;
in = SoundIn.ar(0);
freq = Pitch.kr(in)[0];
env = EnvGate.new(0, nil, 0.1);
out = Mix.new(PitchShiftPA.ar(in, freq,(midiNote.midicps/freq), 1) * env );
Out.ar([0,1], out)
}).add;
)
It should pitch shift the incoming signal from the microphone to the midi notes I’m pressing on my keyboard which it used to do but it doesn’t do it anymore. Instead I’m hearing short notes that are not pitch shifted once I press a key. What am I doing wrong?
cheers, nils