Skip to content

Instantly share code, notes, and snippets.

@abramhindle
Created April 15, 2013 06:01
Show Gist options
  • Select an option

  • Save abramhindle/5385999 to your computer and use it in GitHub Desktop.

Select an option

Save abramhindle/5385999 to your computer and use it in GitHub Desktop.
MakeScalarKR snapshot a kr in supercollider
MakeScalarKR {
var last;
var mbus;
var pf;
var f;
*new { arg sbase,f;
^super.new.init(sbase,f)
}
init {
arg sbase,myf;
f = myf;
last = 0.0;
mbus = Bus.control(sbase, 1);
pf = f.play(sbase, mbus);
}
v {
mbus.get({|x| last=x;});
^last
}
free {
pf.free
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment