Re: Blockly Music Game C4 is an octave lower than what’s written

159 views
Skip to first unread message
Message has been deleted

koz...@google.com

unread,
Feb 8, 2021, 3:16:05 PM2/8/21
to Blockly
I just checked and I agree. It looks like the name of the note is right, but the position on the staff is wrong (by an octave).
I'll file a bug on the Blockly Games repository.
~ Monica

On Monday, February 8, 2021 at 10:00:33 AM UTC-8 rutiabr...@gmail.com wrote:
Hi there, 

I noticed that the a Blockly music game mistakenly notes C4 as C5. (C4 is actually middle C and should be noted an octave lower). When the music is played back it does sound like C4 but it’s just written an octave too high in the game. 

Thanks,

Ruti 

koz...@google.com

unread,
Feb 8, 2021, 3:31:01 PM2/8/21
to Blockly
Thanks for pointing this out Ruti!

~ Monica

Message has been deleted

Coda Highland

unread,
Feb 8, 2021, 4:08:03 PM2/8/21
to blo...@googlegroups.com
This is not necessarily an error. There is more than one standard for pitch notation, and what is listed as C4 in concert pitch is listed as C5 in MIDI notation, because MIDI notation doesn't want to have a negative octave number -- the lowest pitch is A0, which is a concert A-1.

Conversely, some things refer to middle C as C3, such as GarageBand and some Yamaha synthesizers. 

So the real question is, should Blockly Music be consistent with concert pitch or should it be consistent with the audio software it's controlling? That's more of a philosophical question than a technical one.

/s/ Adam

On Mon, Feb 8, 2021, 2:34 PM Ruti Abramovitch <rutiabr...@gmail.com> wrote:
Awesome, glad it works out. 

Ruti


--
You received this message because you are subscribed to a topic in the Google Groups "Blockly" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blockly/br4oZAHHWww/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/c37b4933-6ef5-450a-9b38-c850ac4bb080n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CACggNx1vg9VZ%2Byky%2BtcLpP_LHVThkajTn3i_xdOHjVpCnJ33-g%40mail.gmail.com.

koz...@google.com

unread,
Feb 8, 2021, 5:35:16 PM2/8/21
to Blockly
That's a good point, to think about MIDI notation. I'd argue that typically you work with note numbers and instead use the note number (60 for middle C) when working with pitches, so I'd favor following the standard for concert pitch.

For clarity in discussion, the note played in Blockly games, labeled as C4 is ~262Hz and is the same frequency as C4 in classical piano and music theory.
MIDI standard does not specify a particular octave numbering, and different manufacturer may label C3, C4, or C5 as "middle C" (note 60). However, it is common in MIDI to use C3 as middle C in most music apps, such as in Apple's Garageband.

I think middle C is always ~262Hz and there is just an inconsistency between midi and music theory  on how to label the octave (3, 4, or 5).
If we were following the music theory standard, the Blockly field should display the note an octave down.
If we were following the typical MIDI definition, the Blockly field should play the note an octave up (as C4 currently plays "middle C" [~262Hz], but C3 should be playing that frequency).

~ Monica

Neil Fraser

unread,
Feb 8, 2021, 6:29:54 PM2/8/21
to blo...@googlegroups.com
A couple of observations.

Blockly Games does not use standard MIDI numbers (e.g. 60), but rather a custom set of integers where C4 is 7.  This unfortunate incompatibility is due to level 10 where notes can be generated with math blocks.  Since the loaded sound fonts don't provide sharps or flats, there would be gaps in the integer scale if MIDI were used.  Ultimately I decided that Blockly Games benefited more from the ability for students to play with math blocks than remain MIDI compatible.

As for the C3 vs C4 issue, it was merely a result of downloading soundfonts and using whatever they labeled their notes as:

So am I right in thinking that the soundfont files are just named incorrectly?

In terms of remedies:
* I'd rather not replace the soundfonts with files from an octave away since it would change the tone of every saved user tune.
* I'd rather not change CustomFields.FieldPitch.NOTES to be an octave away, since it would destroy the ability to load saved user tunes.
* In theory we could use 'C5' as the human-readable label and use 'C4' as the machine-readable field label so that it looks and sounds right, even though the XML is wrong.
* Or we could leave it.




--

koz...@google.com

unread,
Feb 8, 2021, 7:17:43 PM2/8/21
to Blockly
Note, this conclusion in contingent on my conclusion that middle C is always ~262Hz.
I wouldn't say that soundfont files are named incorrectly, but i would say that they are using the musical theory standard for labeling the notes, with C4 being middle C. That pitch, middle C, should always be displayed in the first ledger line below the treble staff.

The issue isn't that the label for the octave is wrong, because it can change depending on what standard you are using, but that where it shows up on the staff is incorrect.
Therefore, the range of pitches that this picker provides would need to be changed. However, as you've noted that would impact any saved user tune.

The only way I can imagine fixing it, without changing the octave at which previous users saved their tunes at would be:

Option A: Use the Alto (aka viola or C) cleft instead of treble clef
- Using this cleft, the position of all the notes currently would be correct because middle C is the middle line of the staff
- This is not a common clef, only used for certain instruments like viola and alto trombone
- note names would remain unchanged

Option B: Support an additional octave
- keep the note names the same, but add support for an additional octave higher
- would need to add mp3 files for the additional octave
- the display for the note picker and the game on the left would need to support displaying an octave below middle C, in order to display C3 correctly relative to the staff.

If we weren't concerned with loading saved user tunes, then I would say that the easiest solution would be to just play the notes an octave higher. We would need to rename the files downloaded from soundfonts and would also mean we were would not be using the musical theory standard of note naming (which doesn't mean its not correct, but means we would be following the same pattern as some other music apps).

We could opt to not fix it, but I'd consider it's behaviour to be incorrect. 

Neil Fraser

unread,
Feb 8, 2021, 10:14:44 PM2/8/21
to blo...@googlegroups.com
What about just placing an '8' above or below the clef?
clef8.png
That's what we do over at Glockenspiel to shift by two octaves:

koz...@google.com

unread,
Feb 9, 2021, 12:49:26 AM2/9/21
to Blockly
+1 It is an older convention, but I think it's a reasonable way to solve it.
Based on my reading, it sounds like there should be an 8 below the clef to indicate that the notes should be played an octave lower than is written, though you may want to double check.

Reply all
Reply to author
Forward
0 new messages