-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOU/kCAAoJEIaKvi7tbzRH0aAH/jzSFyLg/XNvwE8ewjnlEs51 1InT5AmBAb/7XZTtp8xBVyfuBi5AQQxKomNkJm9ZqZj/yut7jAgh1oFRbLITcxeu B8UOjzQcjv03s6SMPoFQk1jsZgPm52IjJHraLMTZM/cYZcnsJGg/zpTlcFImGbbi yPd6z6jML1xzmE4J63Aw5nm9/9yD/x0/fugbEHKVmdu3VJRpJtn+kVzTosc5+eT4 kNNN8jXP3AK0oKRqd848EZ/T7bv9DQS+HaErzqkcFv0JVNdd8tzkAwJ74ANxhygS 5cojoDpGQgpl/+03veWICG2qd+DMxDvB9toVRryJn4Y/xHoRckoOain+UBy9mSM= =Jtkw -----END PGP SIGNATURE-----
tempjayren: I LIKE YOUR MESSAGE IN ALL CAPS. IT HAS A WARM, RETRO VIBE TO IT. - rob
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:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOU/kCAAoJEIaKvi7tbzRH0aAH/jzSFyLg/XNvwE8ewjnlEs51 1InT5AmBAb/7XZTtp8xBVyfuBi5AQQxKomNkJm9ZqZj/yut7jAgh1oFRbLITcxeu B8UOjzQcjv03s6SMPoFQk1jsZgPm52IjJHraLMTZM/cYZcnsJGg/zpTlcFImGbbi yPd6z6jML1xzmE4J63Aw5nm9/9yD/x0/fugbEHKVmdu3VJRpJtn+kVzTosc5+eT4 kNNN8jXP3AK0oKRqd848EZ/T7bv9DQS+HaErzqkcFv0JVNdd8tzkAwJ74ANxhygS 5cojoDpGQgpl/+03veWICG2qd+DMxDvB9toVRryJn4Y/xHoRckoOain+UBy9mSM= =Jtkw -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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? On 8/23/2011 4:53 PM, Tomtom wrote:
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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOVB0sAAoJEIaKvi7tbzRHB8UIAJCyWa2Qrt+Rl4PL0yTaBzpU IoZe/mIWYVx1xh6IIW4gFK4A4lH6OsNca1BAeYSiSSs74Buk7tHe15WDwZdsp3XA apYavet518Ck/KuKn3zBe0mPtSGvv/RVLlPZu9i1+BY2+E1y/pDBra9T8nLOliPV gLsJlBXIRHYHskFfF1IoQFqjXhOgqwtkBX7AIvLoaoDxbAJODepm5fkNf7imr+Lc CShhCilMAaykNM98S8RCLWAowuN23NNSjFkE3l4bIFZz+A2XA22fWZHuxwT1O8v2 WMDZxZ6oLcAMCRo7PQKy4X6IoETbAjCjXBkn7I7aYWbRfh/9jVDxy71pQbhyfr8= =yMsn -----END PGP SIGNATURE-----
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:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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?
On 8/23/2011 4:53 PM, Tomtom wrote:
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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOVB0sAAoJEIaKvi7tbzRHB8UIAJCyWa2Qrt+Rl4PL0yTaBzpU IoZe/mIWYVx1xh6IIW4gFK4A4lH6OsNca1BAeYSiSSs74Buk7tHe15WDwZdsp3XA apYavet518Ck/KuKn3zBe0mPtSGvv/RVLlPZu9i1+BY2+E1y/pDBra9T8nLOliPV gLsJlBXIRHYHskFfF1IoQFqjXhOgqwtkBX7AIvLoaoDxbAJODepm5fkNf7imr+Lc CShhCilMAaykNM98S8RCLWAowuN23NNSjFkE3l4bIFZz+A2XA22fWZHuxwT1O8v2 WMDZxZ6oLcAMCRo7PQKy4X6IoETbAjCjXBkn7I7aYWbRfh/9jVDxy71pQbhyfr8= =yMsn -----END PGP SIGNATURE----- _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-----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-----
By the way, I know random numbers have a long standing tradition for determining pitch in digital music (especially when trying to sound like old sci-fi sound tracks). But instead of rand2f to generate frequencies, you might consider summing three low(ish) frequency sine waves. If their frequencies are relatively prime, the results sound random, but since you control the amplitude and frequency of each one, you get good control over how 'frantic' the notes sound Make sense?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 <insert confused look here> On 8/23/2011 8:27 PM, Robert Poor wrote:
By the way, I know random numbers have a long standing tradition for determining pitch in digital music (especially when trying to sound like old sci-fi sound tracks).
But instead of rand2f to generate frequencies, you might consider summing three low(ish) frequency sine waves. If their frequencies are relatively prime, the results sound random, but since you control the amplitude and frequency of each one, you get good control over how 'frantic' the notes sound
Make sense? _______________________________________________ chuck-users mailing 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/
iQEcBAEBAgAGBQJOVP/oAAoJEIaKvi7tbzRHdTsH/12s0zYWrRt3d8yB0MM2PE9q vJ1EnconKNM4LuOu+aVvTzI2Ihl3qsoPVNpScesqCqHWpE0z9BA+EhFYUTsDRmUs gqVXA6bedibHGuw81fCsE+1wK6z93JJdn6aIz7b+0hrBD7EkQLd4IdQh3YCz4/v5 BjBidf9cA5clO4OcKue1s5uflVy7ZZ4rxfvxEjdovksbhqgzlUtM3BoVkrfhPk9U LWa5LnnpjjaV7hJ7y9mzy0wQ+oyGpQ8eBW/6Yfn37yWyhvniOAIsLe/7nAeiBo7j hbWc3vJ4PY+DVgF+fm1jin02JMJYe+PLbEyOTFU3jD7gLX3kw9uCaXm0KD5JR5U= =3TnD -----END PGP SIGNATURE-----
participants (4)
-
David Elkin-Ginnetti
-
Robert Poor
-
tempjayren@gmail.com
-
Tomtom