You script got scrubbed for some reason, but I suspect that you’re shadowing
the global somehow locally (if you use the same name as an argument or a
local within a function, it masks the global version).
Here’s a simple example of using a global:
1000 => float freqGlob; // global frequency variable
SinOsc s => dac; // note that this osc is treated globally as well
spork ~ sweep();
while (true) { // main loop randomly (re)sets freq
Std.rand2f(500.0,3000.0) => freqGlob => s.freq;
Std.rand2f(0.3,1.0)::second => now;
}
// this shred sweeps the frequency exponentially down
fun void sweep() {
while (true) {
(0.999*=> freqGlob) => s.freq;
ms => now;
}
}
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users