|
Post by mms on Mar 28, 2021 4:23:53 GMT
Hello,
I can set tempo at the beginning of my MIDI sequence, but how can l change tempo at a point say midway through a sequence?
|
|
|
Post by JohnG on Mar 28, 2021 11:42:14 GMT
Hi MMS, Here's a quick explanation using XGworks. Take a look at the included image as you read this. Open up any track in either Piano Roll View (PRV) or Staff View and either open an extra controller lane (outlined in red at top of image) at the foot of the window or change the Note On Velocity view to Tempo (see middle red box). Then, you can pick up the pencil tool shown at the foot of image and simply click where you want the tempo to change (see the the entered points in the tempo controller lane) or you can draw a shape by holding the mouse button pressed as you draw a line or a curve, having chosen the appropriate shape drawing tool from one of the bottom boxes. Note that you can set how far apart the changes are entered by setting a value in the interval box. The example is 20.
The result, in XGworks, will be inserted into the Master Track as the following picture shows. As far as I'm aware it's exactly the same format of meta data as the original tempo at the start but with the appropriate timing information before it at the insertion point. Any help? JohnG.
|
|
|
Post by mms on Mar 28, 2021 14:17:16 GMT
Thanks guys for your answers!
I do not use any sequencer, but rather write events directly from my computer program.
The MIDI spec states that the first track should contain a “Tempo map”, so I was expecting 2 tempo events; the first at delta time=0, and the 2nd at a delta time further along in the song.
Would it be possible to send me a simple MIDI file (16 notes - the scale C to C at 60 bmp, immediately followed by the same scale notes again at 120 bpm)
That way I could examine the hex file, and see exactly what event I should enter.
I had written a computer routine to parse a MIDI file and write it to a “readable” text file. (I hope I can find it somewhere)
|
|
|
Post by JohnG on Mar 28, 2021 18:22:05 GMT
Hi again, yes I can knock together a file as you want and email it to you. Is your current email address the one given in your profile at yahoo dot ca? I won't display it online.
If so I'll make one right away and send it.
JohnG.
File sent, let me know if you received it please.
Not sure if your interpretation of the SMF format in the file specification is correct. Here it is:
"In a MIDI system with a computer and a SMPTE synchronizer which uses Song Pointer and Timing Clock, tempo maps (which describe the tempo throughout the track, and may also include time signature information, so that the bar number may be derived) are generally created on the computer. To use them with the synchronizer, it is necessary to transfer them from the computer. To make it easy for the synchronizer to extract this data from a MIDI File, tempo information should always be stored in the first MTrk chunk. For a format 0 file, the tempo will be scattered through the track and the tempo map reader should ignore the intervening events; for a format 1 file, the tempo map must be stored as the first track. It is polite to a tempo map reader to offer your user the ability to make a format 0 file with just the tempo, unless you can use format 1."
What you see in my List View above is the master track with various bits of meta data and including the tempo map.
|
|
|
Post by mms on Mar 29, 2021 0:56:16 GMT
File received. Thank you!
I will see if I can see how and where the tempo change event is embedded in the file.
|
|
|
Post by JohnG on Mar 29, 2021 10:41:15 GMT
Hi again MMS, Glad you received the SMF okay. Thanks for confirming. A little more information for you. Here is the Staff View of the notes as I entered them. And here is the List view of the track after entry. Finally, here is the Master track with the tempo entries. Hope those will help. The program I use to work out hex values is called HxD and was a freebie as I recall. And I just thought I'd tag on an image in Hex for you from HxD. This is the type 1 SMF. The master track runs from 0E(h) to 30(h). And here is the type 0 hex. All the best working it out. JohnG
|
|
|
Post by mms on Mar 29, 2021 13:49:34 GMT
Thanks for the "hex view" of the original format 1 test file you sent me. I can use that to find where/how Tempo Change is handled if I don't find my MidiParser I'm at work now, and probably won't get back to this until the weekend. A quick look at your hex dump, I can see red 00 Delta time = 0 brown1 FF 51 03 Tempo brown2 0F 42 40 Tempo = 60 blue 8B 20 Delta time = 1440 green1 FF 51 03 Tempo green2 07 A1 20 Tempo = 120 So it looks like both Tempo settings are done consecutively in the Master Track. Edit: I don't know why my attached image is so small; it was a screen shot of yours with mark-ups (but clicking on it enlarges it)
|
|
|
Post by JohnG on Mar 29, 2021 14:53:47 GMT
In this particular example they are consecutive but if, for instance, I insert a key signature or time signature change in between the two tempos then they will be inserted consecutively as shown in the following example. Here's the notation view followed by the hex decode. You'll see how the key and time signatures are inserted, with their respective delta times, ahead of the second tempo change (which has been moved slightly to illustrate what happens). You'll notice that the first track is now longer and finishes at position 3F(h) now. Any help? JohnG.
|
|
|
Post by mms on Mar 29, 2021 16:19:15 GMT
The additional information will be very helpful, thank you.
A cursory look at the delta times of the Tempo events, and the subsequent note on/off events, don't seem intuitive to me. Perhaps as I wrap my head around this more, I might start to make some sense of it.
Thank you again for your help.
|
|
|
Post by JohnG on Mar 29, 2021 18:10:46 GMT
It's a good thing to get a good grip upon, especially if you're intending to sequence classical music files.
One piece I have starts in 3/4 time, then after 94 measures changes to common time, then about 12 measures later changes to 3/8 time. Meanwhile tempos are going up and down as the changes occur. I can send the file if you like?
JohnG.
|
|
|
Post by mms on Mar 29, 2021 18:47:12 GMT
Yes, please do. The more I can test with, the better. And since it is your file, I could ask specific questions, and you will be in a position to answer.
Also, if it is not too much to ask, could you please make 1 additional MIDI sequence for me, exactly as the first, but with 1 additional scale run with a Tempo setting of say 90 bpm.
The more I look at these delta times for Tempo, they make no sense to me in relation to the delta times of the scale notes. Perhaps with the additional Tempo marking, something might "click" for me.
|
|
|
Post by JohnG on Mar 30, 2021 8:59:20 GMT
Okay then, here's another with several key and time signature changes as well as a series of tempo changes. You should be able to get a broad outline of when they occur from the following image. I'll post the file in a moment. Here's the hex. I hope you have fun sorting them out.
JohnG.
|
|
|
Post by mms on Mar 30, 2021 13:17:34 GMT
OK thanks John.
This should give me enough now to keep me busy on the weekend.
|
|
|
Post by mms on Apr 2, 2021 4:28:10 GMT
Yay! Found my MidiParser program, and am now easily able to decode the last MIDI file you sent me. I can see exactly where (and how) to place the tempo change events. Looks kind of simple actually! Now to see if I can implement it! Thank you again for all your help!
|
|
|
Post by JohnG on Apr 2, 2021 9:42:57 GMT
That is good news. So pleased it's all out working now. It certainly is a lot more difficult to do if you're just trying to analyse the hexadecimal. Which MIDI parser do you use? JohnG. P.S. I don't know whether you've discovered the Sekaiju sequencing program? It's quite a useful little program, a long way from the features of many of the 'Big Boys' but very useful in its own way. For instance, here's the decode of the master track of the file I just sent you, with all the events 'opened out'. It can be found here: Sekaiju web site.Any help? I've just noticed Sekaiju isn't showing time signatures correctly. I'll write to the author right away. P.P.S. I've just discovered Sekaiju will export to a text file or a CSV file. Useful.
|
|