2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -0,0 +1,31 @@
(
a = TaskProxy { |envir|
envir.use {
~integral = 0;
~time = 0;
~prev = 0;
~running = true;
loop {
~val = ~input.(~time);
~integral = ~integral + (~val + ~prev * ~dt / 2);
~prev = ~val;
~time = ~time + ~dt;
~dt.wait;
}
}
};
)
// run the test
(
fork {
a.set(\dt, 0.0001);
a.set(\input, { |t| sin(2pi * 0.5 * t) });
a.play(quant: 0); // play immediately
2.wait;
a.set(\input, 0);
0.5.wait;
a.stop;
a.get(\integral).postln; // answers -7.0263424372343e-15
}
)