Thanks- in ChucK this is actually ok, because int and float variables in ChucK are automatically initialized to 0. (Other types also have default initialization to sane zero-ish or empty values, if no other initialization is provided.)
So the main reason to make this change would be for style or clarity- functionally they are the same.
Hi there, this is a musical errata. In chapter 2, figure 2.1 of the ebook, there's a figure of a piano and an arrow pointing to the first few notes of Twinkle twinkle. The issue is that the note on 'little', the F, would have to be an F# if the song is to remain in a major mode as in the original.
in the "1.4.3. Variables of type time" section,
after the first one line of code, it goes:
"... tempo, often expressed in how many quarter-note duration happen per second, also
called BPM (beats per minute). ..."
imho, it should be "how many quarter-note duration happen per minute"
(like M.M. ?=75, etc.)
// My only paperback copy of the book currently lent to my editor/publisher
// so I am not sure about the page.
// I am a Japanese translator trying to persuade him/them
// to publish your ChucK book in Japanese!
On the same line as #8 comment, the Figure 3.2 (in section 3.4.1) music has no sharp (#) on F notes ("lit--tle") so the melody differs from the original song. Actually, you need three sharps on C, F and G to make it an A major song. Of course, it is rather weird and scary for non music-school students to see three sharps, but you have to be careful not to offend music-school students
In Listing 3.8, in the section //set melody and harmony, I believe the arrays harmNotes[i] should refer to t.freq and melNotes[i] should refer to s.freq.
278463 wrote:Hi there, this is a musical errata. In chapter 2, figure 2.1 of the ebook, there's a figure of a piano and an arrow pointing to the first few notes of Twinkle twinkle. The issue is that the note on 'little', the F, would have to be an F# if the song is to remain in a major mode as in the original.
Perry here: Right you are! How embarrassing, and thanks for finding this. We'll get it fixed on the errata page and also in subsequent printings of the book. I'm attaching a corrected version of that figure (if it works).
55080 wrote:in the "1.4.3. Variables of type time" section,
after the first one line of code, it goes:
"... tempo, often expressed in how many quarter-note duration happen per second, also
called BPM (beats per minute). ..."
imho, it should be "how many quarter-note duration happen per minute"
(like M.M. ?=75, etc.)
// My only paperback copy of the book currently lent to my editor/publisher
// so I am not sure about the page.
// I am a Japanese translator trying to persuade him/them
// to publish your ChucK book in Japanese!
cheers - Kunio Yoshikawa
Perry here: Yes you are totally correct in that it should say "happen per minute"
instead of "second." We'll get this corrected in the next printing. Thanx!!
55080 wrote:On the same line as #8 comment, the Figure 3.2 (in section 3.4.1) music has no sharp (#) on F notes ("lit--tle") so the melody differs from the original song. Actually, you need three sharps on C, F and G to make it an A major song. Of course, it is rather weird and scary for non music-school students to see three sharps, but you have to be careful not to offend music-school students
Perry here: Right you are! How embarrassing, and thanks for finding this. We'll get it fixed on the errata page and also in subsequent printings of the book. I'm attaching a corrected version of that figure (just with the single F# accidental, not with the whole scary three sharp key signature .
Mitch K wrote:In Listing 3.8, in the section //set melody and harmony, I believe the arrays harmNotes[i] should refer to t.freq and melNotes[i] should refer to s.freq.
Perry here: Yep, you're right. Those two lines should look like this:
// set melody and harmony from arrays
Std.mtof(melNotes[i]) => s.freq; // (10) Sets frequencies from
Std.mtof(harmNotes[i]) => t.freq; // array MIDI notes
It turns out it doesn't sound that different, but for consistency, it will
be updated in future printings. Thanx!!
In Listing 5.17 you call sonify(factorial(x)) which adds an additional sound pulse. If you just call factorial(x) it works fine, as factorial already calls sonify().
to be musically correct (Listing 9.4 is fine). I notice, however, that none of the other Chapter 9 listings ever use the value of the 'thirtysecondNote' variable, so one would only get odd behavior if they tried to use Listing 9.5 (and accessed the bad value) in their own projects.
This error is also repeated in the built-in examples in ChucK (i.e. miniAudicle) 1.3.5.2 in three places; examples/book/digital-artists/chapter9/Listing9.5.ck, examples/book/digital-artists/chapter9/BPM.ck, and examples/book/digital-artists/chapter9/DrumMachine/BPM.ck.