|
Post by mms on Aug 1, 2019 11:48:34 GMT
Hello,
I'm trying to understand the the last two bytes of this message.
If I want to send a 3/8 time signature message, (5th byte is 3, 6th byte is 3) what should I send for the last two bytes?
|
|
|
Post by JohnG on Aug 3, 2019 9:06:59 GMT
Hello, I'm trying to understand the the last two bytes of this message. If I want to send a 3/8 time signature message, (5th byte is 3, 6th byte is 3) what should I send for the last two bytes? Hi MMS, Welcome aboard. A good question. I assume that you've downloaded and read the complete MIDI specification from the MMA. Obtainable here: www.midi.org/specifications/item/the-midi-1-0-specification. After the General MIDI spec. there is a section on Standard MIDI files. Page 10 of that spec. gives the format for the Time Signature meta data. But you've probably read that already (?) and you're wondering what to put in the last two bytes. The answer is, unless you want to specify some unusual settings for a MIDI quarter note (as given in the example above), you set the last two bytes to zero. So the 3, 3 go in bytes four and five (not 5 and 6) and bytes six and seven are zero. FFH 58H 04H 03H 03H 00H 00H Here it is, in Hex, embedded in a MIDI file called TimeSig.mid: Hope that helps? JohnG.
|
|
|
Post by mms on Aug 4, 2019 3:46:28 GMT
Thanks for the answer John.
Yes I had read that, and that is where the confusion begins. I don't know if it is me, or that is a very confusing description in the MIDI spec. ...It's probably me
For now, (from your answer) I now know I can safely wright zeros to those last two bytes, and all will be good.
As I've been fooling with this event, I should back up, and try to fully understand what the MIDI player actually does with this event (even the time signature bytes).
I send the tempo message, and thought I had to also send the time signature message for everything to play properly.
To test, I notated the first few bars of Fur Elise (3/8 Time) and sent the Tempo msg with 64 bpm, and sent the Time Signature msg with 3/8 time (and sent garbage numbers for the last 2 bytes) and listened to file. Everything sounded proper. I then sent the Time Signature msg with 4/4 time, and the MIDI file played exactly the same. Even when not sending the time signature msg, the file still sounds fine.
I guess the Time Signature setting, plays no part in the actual playback of the file, and its only purpose is to hold this information, in case some apps might choose to report it somehow.
Am I correct with this assumption?
Also regarding the metronome click... I hear nothing. Is it up to individual MIDI apps to implement these? I just use Windows Media Player.
|
|
|
Post by JohnG on Aug 4, 2019 10:20:24 GMT
You're most welcome, so glad that at least some of it made sense.
The only thing, as you've found out by experimentation, that's essential in the meta data, is the tempo marking, and even with that the MIDI specification says if it's not present then assume 120bpm as default. Most DAWs I've worked with insert this value anyway and one has to alter it when necessary. These events are not transmitted from the player to the sound card, sound module or whatever, they're used to make sure the timing of the transmitted note ons and offs and other controllers, such as pitch bend messages, etc., occur correctly.
The other assumptions, which affect display not playback, are time and key signature. Defaults are 4/4 and C major.
A MIDI player just needs to send notes of the correct length (note on and note off) at the correct time, and as far as the MIDI player is concerned there are no sharps or flats, just note numbers.
What the other meta data, like key signature and time signature, does is to make the music look correct to the human eye when working in piano roll and/or notation view.
However, the time signature if not 4/4 (default) is important (along with the tempo) for the sequencing software as it has to calculate delta times on the fly as the notes are sequenced. Delta times For instance, Bach's opening chorus from BWV39 (Brich dem Hungrigen dein Brot) starts in 3/4, changes to 4/4 at measure 94 and then again to 3/8 at measure 106. But accelerando and ritardando will affect this.
Metronome sounds will depend upon whether the player is set up to support these and what sounds are defined for the tick and the ping.
|
|
|
Post by JohnG on Aug 4, 2019 12:42:23 GMT
I don't know if you've tried the free MIDI sequencer called Sekaiju?
It's currently at version 5.7. It's quite a nice little program and, when switched into List View displays a very good breakdown of the MIDI data stored, including meta events.
It comes as a zip file and is written by a Japanese programmer. The only little tweak that is required, after unzipping, is to open the file "Sekaiju.ini" in Notepad and change (or add) right at the end of the file "UserInterface=English".
|
|
|
Post by mms on Aug 5, 2019 6:41:07 GMT
Thanks John
Does it make any changes to registry that you know of, change file associations, or anything like that?
I've read some people have problems with MIDI on Windows 10, (especially with MIDI Mapper), and everything on my system works perfect.
I'm sure you would not suggest something that might cause problems, but I just wanted to ask just the same.
Thanks again!!
|
|
|
Post by JohnG on Aug 5, 2019 8:45:50 GMT
My pleasure. As far as Sekaiju is concerned, I don't believe it changes anything Windows related, at least as far as Win7(x64) is concerned. The file can be unzipped anywhere and the program (Sekaiju.exe) can be run directly from the folder created, providing one has admin permissions. I've checked my windows registery and within \HKEY_CURRENT_USER\SOFTWARE\ there are no entries for the program at all, that I can see. I unzip it onto a conventional HDD (E:\Downloads\) and then drag and drop the whole directory into C:\Program Files(x86)\ which is on an SSD. Then I create a shortcut. Additionally, I've been doing a bit more research into how various programs set up time signature. It would appear that most set the last two bytes to 18H 08H, i.e. 24 clocks per quarter note and 8 32nd notes per tick, respectively. In other words a standard clock. I suspect that setting "cc bb" either to 00H 00H or to 18H 08H results in exactly the same thing. Here's a Sekaiju view of a file set up to display just MIDI time signatures and tempi. The ppqn is set to 480 in this file.
The first measure is set to 1/4, the second measure forward to 3/4, then 4/4, then 3/8. It's a huge amount more detail than one gets in all the other sequencer software I've used. Whether it meets your needs as a sequencer, of course, only you can tell. This is what it looks like in Hex
JohnG.
|
|