Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save abramhindle/5385994 to your computer and use it in GitHub Desktop.
Abusing a bus to get a scalar value.
~mkscalarfun = {
arg f={ 0 };
var last = 0.0;
var mbus = Bus.control(s, 1);
var pf = f.play(s,mbus);
var scalarf = {
mbus.get({|v| last = v;});
last;
};
scalarf;
};
~mousescalarf = ~mkscalarfun.({ var start=40, end=440, del=0; MouseX.kr(start, end, del); });
~mousescalarf.();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment