|
Post by mms on Oct 17, 2021 4:58:28 GMT
Hello,
Is the Key Signature event supposed to actually do something, or is it just supposed to be a marker of sorts, for the sequencing program to deal with?
In my MIDI files where I issue the event command nothing actually happens.
Could you please show me the hex values for this event (say G major / 1 sharp), and where they occur in the file (ie master track, or standard track).?
|
|
|
Post by JohnG on Oct 18, 2021 16:40:53 GMT
No, the key signature doesn't really do anything, unless, that is, your sequencer program displays a notation view. In which case it displays the appropriate number of sharps or flats at the correct place on the screen. Most MIDI files I've come across (and ones that I author myself) have the meta data within the master track. But the MIDI spec. makes no recommendation, that I can find, about its placement. I have come across more than a few files with the key signature inserted into every track. The slight difficulty arrises about what to do when the music is for a transposing instrument when a key signature should be displayed appropriate to the instrument's transposition. Here's the FourNotesKey file with a major and minor key sig, inserted. FourNotesKey.mid (1.1 KB) I'll knock up a file showing transposing instruments and attach it later. JohnG.
|
|
|
Post by JohnG on Oct 19, 2021 11:45:33 GMT
Here's a view of the same file with identical notes added to channels (tracks) two & three, but the instruments are oboe d'amore and cor anglais respectively. The oboe d'amore plays an A below middle C when the keys for C are played on the instrument. The cor Anglais plays a G when the C keys are held. So if a C is to be played the notes need to be transposed, on the score, up a minor third of major fifth respectively. This is the file. FourNotesTrans.mid (1.15 KB) Hope that helps. JohnG.
|
|
|
Post by mms on Oct 19, 2021 13:18:37 GMT
Thanks John for confirming that the Key Signature event does not actually do anything.
In my code I handle key signatures myself, and also handle transposing instruments.
The other day when cleaning up some of my MIDI code, I got to thinking that perhaps I was issuing the Key Signature event wrongly, and that this event was supposed to take care of all sharpening and flattening of notes automatically... Yoy have confirmd this is not the case.
I will study your two attached files, and compare how/where Key Signature events are handled, and compare to mine.
Thanks again!
|
|
|
Post by JohnG on Oct 20, 2021 9:01:54 GMT
Just to clarify: The key signature does not do anything to the notes themselves unless ... If someone is entering notes via a notation (staff) view and, let's say, the key is G major, then any F# entered would not show the accidental as it is implied in the key signature, but ... within the MIDI file the note entered would be an F#. So it may look like this for the three oboes: But the notes would be inserted as follows in the MIDI file. FourNotesAccidentals.mid (5.91 KB) JohnG.
|
|
|
Post by mms on Oct 20, 2021 12:05:45 GMT
hmm... now I'm confused again.
I'm at work now, so unable to test anything. I will get back to this on the weekend.
|
|
|
Post by mms on Oct 31, 2021 1:47:33 GMT
Thanks for the files John.
Windows Media Player (the only player I have) will not play any of those files. I will try to parse them and see if I can figure out why.
Do you have Windows Media Player?
|
|
|
Post by mms on Oct 31, 2021 2:51:10 GMT
Hi John,
I created 2 midi files to test the Key Signature event. Both files consist of 8 notes (the scale). KeySig_0sharp.mid KeySig_1sharp.mid
_0sharp I write the KeySig event with 0 sharps/flats _1sharp I write the KeySig event with 1 sharp
Both files sound identical (ie the F is not sharpened in the 2nd file)
One of your posts above you said
I sent you these files to look at if you could please. I also sent a parsed text file for each.
Do these files play correctly for you?
|
|