Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: pitch tracker utility
name
code content
SynthDef(\pitchTrack, { var soundin = SoundIn.ar(0); var zc = ZeroCrossing.ar(soundin); // var pt = Pitch.kr(soundin); // var tt = Tartini.kr(soundin); SendReply.kr(Impulse.kr(1), '/pitchTrackUtil', [zc, zc.cpsmidi]); }).add; ~pitchTrack = { if(~pitchTrackSynth.isNil or: { ~pitchTrackSynth.isRunning.not }, { ~pitchTrackSynth = Synth(\pitchTrack); ~pitchTrackNW = NodeWatcher.register(~pitchTrackSynth); }, { ~pitchTrackSynth.free; ~pitchTrackSynth = nil; "Pitch tracker stopped.".postln; }); }; ~pitchTrackOSCFunc = { OSCFunc({ | msg | ("Pitch:"+msg[3].round.asString.padLeft(5)+msg[4].round.asString.padLeft(3)).postln; }, '/pitchTrackUtil'); }; ~pitchTrackOSCFunc.(); CmdPeriod.add({~pitchTrackOSCFunc.();});
code description
This is a small utility i wrote to make it easy to detect the pitch of incoming audio (i.e. your voice into your mic). I recommend binding the execution of "~pitchTrack.();" to a keyboard shortcut in your editor/IDE. It's incredibly convenient to just input a hotkey and instantly see information about the current frequency and MIDI note number for the incoming audio. Because of how i've written ~pitchTrack, you can use the same hotkey to halt the pitch tracker synth as well. This utility makes it much easier to write melodies if you don't have perfect pitch.
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change