-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 tried this, it seems to sound like what i was thinking of, yay. On 8/23/2011 6:27 PM, David Elkin-Ginnetti wrote:
How about defining the threshold initially as a greater frequency and then only allowing it to deviate a specified number from the original frequency? That way it won't always increase as quickly. So, I'm thinking, in the beginning, instead of 0 => float threshold, replacing that with
200 => float threshold;
and then instead of both instances of Std.rand2f(1, 15000):
Std.rand2f( threshold-300, threshold+300 );
That way the frequency couldn't go up more than 300 hz (or some other number) at a time. Does that sound more like you were thinking? Warning: code also hasn't been tested.
peace, David Elkin-Ginnetti
On Aug 23, 2011, at 17:35, tempjayren@gmail.com wrote:
i've managed to snip that and run it inside chuck, yay, though each time it runs it sounds the same, so that's not good. and it doesn't sound like i was expecting either, so that's not good. what did i forget to define in my description? i'm trying to read the code, and the synthesizer is saying tabs and spaces all over the place, so that's not good. what did i manage to break this time?
is this what you are looking for ?
---
0 => float threshold; float f;
SinOsc o => dac;
while (true) {
while (threshold < 10000) { Std.rand2f(1,15000) => f; if (f
threshold) { f => threshold; } threshold => o.freq; 100::ms => now; }
while (threshold > 10) { Std.rand2f(1,15000) => f; if (f < threshold) { f => threshold; } threshold => o.freq; 100::ms => now; } }
---
you didn't define some stuff in your description so I had to improvise. This code has not been tested - I'm not responsible if it eats your children.
tom
Excerpts from tempjayren's message of mar. août 23 21:01:23 +0200 2011: I'M TRYING TO PICTURE THE CODE TO IMPLEMENT THIS, THOUGH MY BRAIN HURTS, SO I CAN'T. THIS IS SIMILAR TO THE TUTORIAL EXAMPLE THAT IS DESCRIBED AS SOUNDING LIKE OLD SCIFI COMPUTERS. WHERE WE USE A SINOSC AND PLAY WITH THE RANDOM AND THE FREQ. THIS WILL RUN FOREVER, ON FIRST RUN IT WILL GENERATE A NUMBER, SAY 200, IT WILL PLAY A SHORT 200 FREQ FOR SOME SHORT LENGTH, SAY 100MS. ON ITS SECOND RUN, SAY IT GENERATES SOME OTHER NUMBER LIKE 50, THIS IS A BAD NUMBER IN THIS CASE BECAUSE IT IS LOWER THAN 200. SO IT TOSSES OUT THE 50 AND PLAYS ANOTHER 200 FREEQ 100MS BURST ON THE SINOSC. THIRD RUN IT USES SAY 300, THIS IS OVER 200 AND NOT 200 ITSELF, SO IT USES THIS, PLAYS THE NEW TONE. 4TH RUN, 250, NOPE CAN'T USE THIS THE NUMBER HAS TO BE 300. 5TH RUN, REPEAT. --- SKIP AHEAD --- $TH RUN, 10000 PLAYS THE FREQ AT 100MS OF COURSE, THEN REVERSES THE PROCESS. #TH+1 RUN 9000 LESS THAN 10000 SO WE CAN USE THAT JUST FINE. #TH+2 RUN, 9050, OOPS, CAN'T USE THIS SO WE USE 9000. --- REPEAT UNTIL WE WGT TO 50 ON THE FREQ, WHERE THE WHOLE THING STARTS OVER AGAIN. -- TERRIBLY SORRY ABOUT THIS, I'VE JUST NOTICED MY CAPSLOCK IS DOING AN ODD THING IT SAYS IT IS OFF, THOUGH IT APPEARS TO BE ON, GROWL, NOT HAPPY plus, i don't feel like retyping all of this, so no i'm not shouting at anyone. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users _______________________________________________ chuck-users mailing
On 8/23/2011 4:53 PM, Tomtom wrote: list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOVD3DAAoJEIaKvi7tbzRH8UAH/0ZdMEsKPRM7ImRJ/FILSjGh q8YfdfgEF/XEYVwOYkjWTal1pPvQbu/8F+h6xYMPmfSSIQ6+CMI+TM7CGsFMzNq/ uS2u1VDLVAZjaMTWxlCHsGJWfpZPquss4pmhAFV5TcVtq+JvS1rl7/UgiHUOGWMw EtTzK8rDhPDP14VGW1T4LguRx3o26M0a43wkpXrJCFMuQcP3sCR15hVJSycxA6PE hPRlhwg6LO0AJqJhtBifY/NF8QL2akZ4CsAMIhYJfcnEEY3t/hOZVGMKJ8HYPYGf pVBf617FEC8ADHRLrgFMxyVTeT0t/fBQ+eNxD06zvG1CFv1cLyF42hzTR3XuNKM= =LTrb -----END PGP SIGNATURE-----