This is in merit of the great tutorial at http://ravelite.org/chuck-notes/tutorial.html there is a little typo here: Now use this function to simulate indexing into the scale. [0,2,3,1,4,2,6,3,4,4] @=> int mel[]; //sequence data [0,2,4,5,7,9,11,12] @=> int major[]; //major scale for (0=>int i; ; i++) { //infinite loop std.mtof( 48 + scale( mel[i%mel.cap()], major ) => inst.freq; //set the note inst.noteOn( 0.5 ); //play a note at half volume 300::ms => now; //compute audio for 0.3 sec } this string: std.mtof( 48 + scale( mel[i%mel.cap()], major ) => inst.freq; //set the note lacks an ) should be std.mtof( 48 + scale( mel[i%mel.cap()], major )) => inst.freq; //set the note seeya .mike
biotechisgodzilla.wifebeater wrote:
this string: std.mtof( 48 + scale( mel[i%mel.cap()], major ) => inst.freq; //set the note lacks an ) should be std.mtof( 48 + scale( mel[i%mel.cap()], major )) => inst.freq; //set the note
Thanks for posting this, I've just been struggling with this and failed to see the error. (And Graham + everyone, please ignore my post about this 5 mins ago...) -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
this string:
std.mtof( 48 + scale( mel[i%mel.cap()], major ) => inst.freq; //set the note
lacks an )
should be
std.mtof( 48 + scale( mel[i%mel.cap()], major )) => inst.freq; //set the note
Thanks for the feedback, fixed! Graham On Thu, 15 Jun 2006, biotechisgodzilla.wifebeater wrote:
This is in merit of the great tutorial at http://ravelite.org/chuck-notes/tutorial.html
there is a little typo here:
Now use this function to simulate indexing into the scale.
[0,2,3,1,4,2,6,3,4,4] @=> int mel[]; //sequence data [0,2,4,5,7,9,11,12] @=> int major[]; //major scale
for (0=>int i; ; i++) { //infinite loop std.mtof( 48 + scale( mel[i%mel.cap()], major ) => inst.freq; //set the note inst.noteOn( 0.5 ); //play a note at half volume 300::ms => now; //compute audio for 0.3 sec }
seeya .mike
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Graham Coleman wrote:
Thanks for the feedback, fixed!
The mistake is also in the next three examples (thanks to copy/paste I guess)... -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
Indeed, thanks! (fixed) On Thu, 15 Jun 2006, Atte André Jensen wrote:
Graham Coleman wrote:
Thanks for the feedback, fixed!
The mistake is also in the next three examples (thanks to copy/paste I guess)...
-- peace, love & harmony Atte
http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
the last example, when you include the (great!!!) scale class, it should be something like this: ------ StifKarp inst => dac; Scale sc; //include this at the top [0,2,3,1,4,2,6,3,4,4] @=> int mel[]; //sequence data for (0=>int i; ; i++) { //infinite loop std.mtof( 3*12 + 7 + sc.scale( mel[i%mel.cap()] +5, sc.gypsy )) => inst.freq; //set the inst.noteOn( 0.5 ); //play a note at half volume 300::ms => now; //compute audio for 0.3 sec } ------- seeya tnx for this tut!!! On Thu, 2006-06-15 at 17:30 -0400, Graham Coleman wrote:
Indeed, thanks! (fixed)
On Thu, 15 Jun 2006, Atte André Jensen wrote:
Graham Coleman wrote:
Thanks for the feedback, fixed!
The mistake is also in the next three examples (thanks to copy/paste I guess)...
-- peace, love & harmony Atte
http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions _______________________________________________ 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
Hello there, I have spent hours trying to figure out where a "bus error" came from. I remember I once had a similar problem (don't know if it gave the very same error message, but it was regarding the same issue ) and thought it was solved on new releases. Anyway an example will be more explanatory: class foo { gain g1, g2; fun void do_nothing(){} } foo f; // declaring is not a problem f.do_nothing(); // calling any member gives a bus error if you compile the example above it will give you a bus error. To solve it, one must declare the two gains in separate lines: class foo { gain g1; gain g2; fun void do_nothing(){} } foo f; f.do_nothing(); maybe everyone is aware of it, but just in case someone isn't, I think it will save him/her a lot of "debugging" time. Could this behaviour be changed? Eduard
participants (4)
-
Atte André Jensen
-
biotechisgodzilla.wifebeater
-
eduard aylon
-
Graham Coleman