Kara-Moon Forum
October 31, 2024, 11:48:49 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Wrong octave number?  (Read 12081 times)
alexis
Jr. Member
*
Posts: 62


« on: June 22, 2012, 04:46:18 PM »

Hello all,

Yes, Bob, I'm back!
Yet another question!  Wink

Please have a look to attached file.
This is a trivial MMA groove, with specified octaves.
Look at the bassline:
Code:
Begin Bass-SynthBass
Voice SynthBass1
Octave 2
End

The sequence uses first the tonic.
The chord progression starts with a C.
I should get first a C2, which corresponds to MIDI note 36.
Check MIDI note mapping here:
http://en.wikipedia.org/wiki/File:NoteNamesFrequenciesAndMidiNumbers.svg

But when I have a look to MMA-generated MIDI data, I see note value is 24 (i. e. C1).
And, more generally, all notes are one octave below the specified octave.

I have noticed that the french system is one octave lower than english one.
See : http://fr.wikipedia.org/wiki/Note_de_musique
and http://www.adamsatoms.com/notes/

From the links above, you may tell that (tell me if I'm wrong):
Do3 (french name AND octave) = C4 = 261.625565 Hz = 60 (MIDI note value)

Is this shift intentionnal? Is the canadian reference the same as french one?
Thanks.

Regards,

Alexis

* OctaveNumberIssue.mma (0.81 KB - downloaded 548 times.)
Logged
bvdp
Kara-Moon Master
****
Posts: 1449


WWW
« Reply #1 on: June 22, 2012, 05:25:28 PM »

MMA octave numbering is totally arbitrary and doesn't conform to any standard Smiley

When figuring out what pitch to use, MMA starts with a chord. These are stored with values in the range 0...12 (+). So, a C chord would be midi pitches 0, 4 and 7. These are then adjusted for the octave. If the octave is set to "4" it adds 4 x 12 to the values.

This permits the entire range of MIDI values using octave values 0 to 10.

Note that the lowest octave is 0.

BTW, the problem (I think) is a confusion between staff, piano and midi octave numbering. If we assume that C2 is not 36 (as your post and the link suggest), how would we specify MIDI value 0? C-1?

Clear as mud?
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1449


WWW
« Reply #2 on: June 22, 2012, 05:36:45 PM »

And to clear this up more (I hope) for the future, I have added the following to the Octave section of the very fine manual:


MMA 's octave numbering and schemes used to denote octaves on a piano keyboard or staff do not correspond. MMA is capable of generating a compete set of MIDI notes in the range 0 to 127--for this we need the first octave to be ``0''.
Logged

My online life: http://www.mellowood.ca
alexis
Jr. Member
*
Posts: 62


« Reply #3 on: June 24, 2012, 03:31:13 PM »

BTW, the problem (I think) is a confusion between staff, piano and midi octave numbering.
There is no confusion, because relationships between staff, piano-roll, MIDI value and frequencies are clearly standardized:
http://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/NoteNamesFrequenciesAndMidiNumbers.svg/1000px-NoteNamesFrequenciesAndMidiNumbers.svg.png

Quote
If we assume that C2 is not 36 (as your post and the link suggest), how would we specify MIDI value 0? C-1?
Yes, exactly. MIDI values lesser than 10 match a negative octave.
And corresponding frequencies are lesser than 15 Hz, i. e. not audible frequencies!
So what? Who cares?

What annoys me is that, when you specify octave 2 in MMA, you expect to see the notes filled in "octave 2" in your favorite MIDI editor/DAW's pianoroll (see attached picture), not "octave 1".
Every DAW conforms to MIDI standard, AFAIK.

What to do, then?
I'd like to ask you to raise every MIDI note by one octave.
But you'd reply that all existing .mma/.mid files would sound one octave higher, and that it'd require a huge work correcting them.
And that the issue is not that important, after all! Smiley

I'd suggest then to implement a command or directive, such as :
Code:
StandardOctaveNumbering On
I think it's quite easy to implement, since it requires only an addition.
Bob, would you consider this request?
Thanks a lot.

Alexis



* Capture.png (3.99 KB, 722x214 - viewed 1035 times.)
Logged
bvdp
Kara-Moon Master
****
Posts: 1449


WWW
« Reply #4 on: June 24, 2012, 04:45:21 PM »


I'd suggest then to implement a command or directive, such as :
Code:
StandardOctaveNumbering On
I think it's quite easy to implement, since it requires only an addition.
Bob, would you consider this request?


Oh, yes, it is simple to add this. Just a matter of reading the user's octave setting and incrementing it if the flag is set. And, of course, we'd need to re-jig the range from -1 to 9 when the flag is active. I'll add this to the TODO.

I'm thinking that instead of a bunch of random command settings like this, it might be nice to have wrapper which would permit tweaks. Something like:

       Tweaks   OctaveRange=xx .... don't know what else.

Keep the suggestions coming!
Logged

My online life: http://www.mellowood.ca
alexis
Jr. Member
*
Posts: 62


« Reply #5 on: June 24, 2012, 09:34:12 PM »

Quote
Oh, yes, it is simple to add this. Just a matter of reading the user's octave setting and incrementing it if the flag is set. And, of course, we'd need to re-jig the range from -1 to 9 when the flag is active. I'll add this to the TODO.
Cool!

Quote
I'm thinking that instead of a bunch of random command settings like this, it might be nice to have wrapper which would permit tweaks. Something like:
Tweaks   OctaveRange=xx .... don't know what else.
I like it. Clearer and more general than my suggestion.

Thanks Bob.

Alexis
Logged
bvdp
Kara-Moon Master
****
Posts: 1449


WWW
« Reply #6 on: June 25, 2012, 12:04:14 AM »

Now I have a question Smiley

If I do some kind of octave setting ... should the setting be saved in the groove information or should it just be a complete override?

Override is easiest. But, comes with its own problems. A few complications:

1. Assume the user sets octave=midistandard (or whatever it'll be called) in a mmarc file. He thinks he's being clever and really wants mma to work just like his DAW (guilty parties can ignore this comment). So, that's fine, but when he uses a standard lib file the octaves will be wrong. And, if he shares a lib file or song with this, the fellow he shares with will be confused as well.

2. So, we tell the user NOT to use this new command in a rc file, restrict usage to lib files (we can't enforce this since we don't know what kind of file is being processed at the time, etc). Now, the user starts his lib file with the new command and sets everything up. Now, I use the file for one of my songs and add a SOLO section. Opps, the octave is wrong .... I was expecting a MMA octave, not yours.

So, now we decide to make the octave setting part of the groove things. If you set it in a rc file 2 things happen:

  1. In your lib file (which is treated as a groove during processing) the new setting will NOT apply.
  2. In a song file it will apply ... even if a groove has been loaded.

Setting it in a lib file:

  1. Applies to your groove as expected.
  2. Doesn't apply to stuff in the song file.

So, probably best to have it this way.

But, I'd appreciate some discussion....
Logged

My online life: http://www.mellowood.ca
alexis
Jr. Member
*
Posts: 62


« Reply #7 on: June 25, 2012, 01:28:32 PM »

Setting it in a lib file:

  1. Applies to your groove as expected.
  2. Doesn't apply to stuff in the song file.

So, probably best to have it this way.

But, I'd appreciate some discussion....
I considered setting octave range in .mmarc file.
But I think now this is a bad idea, since it would change the sounding of existing files.
OctaveRange should be local to the file where it's invoked.
Something like this:

LIB FILE:

Code:
// MMA octave range - could be omitted
Tweaks OctaveRange=0,10

Begin Chord
Voice JazzGuitar
Octave 5 // C = 60 in MIDI file
Sequence mySequence
End

DefGroove myGroove

-------------

DATA FILE

Code:
Groove myGroove

C // 60,64,67 in MIDI file
G // 67,71,74 in MIDI file

// MIDI octave range
Tweaks OctaveRange=-1,9

// Nothing changes
C // 60,64,67 in MIDI file
G // 67,71,74 in MIDI file

// Applies new octave range
Chord Octave 5

C // 72,76,79 in MIDI file
G // 79,83,86 in MIDI file


Hope I'm clear enough.

Alexis
Logged
bvdp
Kara-Moon Master
****
Posts: 1449


WWW
« Reply #8 on: June 25, 2012, 04:12:21 PM »

Yes, I think this is getting though to my small brain Smiley

I'll have a look at some code later this week.
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1449


WWW
« Reply #9 on: June 28, 2012, 11:45:24 PM »

We've done some secret handshake stuff back and forth and think we have a winner Smiley

Instead of changing anything, it's easier to add a new command. So, OCTAVE continues its life as is. The new command MOCTAVE (sort for MIDI Octave) gives expected values from a MIDI implementation.

I have to fix up some docs, hopefully tomorrow, and will put a new test version up then.
Logged

My online life: http://www.mellowood.ca
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.041 seconds with 20 queries.