Well, according to one of my sequencers, what you're doing is correct. 1. Sekaiju just plays the one note. 2. Anvil Studio plays to the end of the measure. 3. XGworks plays four full measures. So ... I'm guessing, each program has code that defines how long it will go on playing after the last note.
Strictly speaking, in notation view, you should display the quarter note, then one quarter note rest, followed by one half note rest for that measure. See below.
Left to right, Staff view; PRV; List view; master track.
Any help? JohnG.
P.S. About the images, sorry, I'd temporarily turned attachments off because we have a limited amount of space to store them. All my imagess are hosted on a site called Postimages (postimg.cc).
It was the same file, created in XGworks and saved as a type 1 SMF. It just has tempo 60 bpm and time sig. 4/4. Then a single note on, middle C, velocity 72, length a quarter note. Then a note on, velocity zero, middle C.
The three programs played the same file differently which, to me, signals that it's a programming decision how long it plays after the last note. Not so?
But I guess to be sure, if say, 4 more measures were added to the file you created, each with a whole note rest, it would be interesting to see if:
- Sekaiju still plays one 1 second note (1 second midi length file) - Anvil Studio plays/creates 20 second file (sounding one 1 second note , followed by 19 seconds of silence) - XGworks still plays 4 full measures (16 second midi length file), or now 8 full measures (32 second midi length file)
I'm thinking ahead, and say I have a conductor's score with a large number of instruments and 50 measures, and one of those instruments plays notes in measure 1 only, and the remaining 49 measures are whole measure rests, if I muted all instruments, except the one having notes in the first measure only, I would still want the song to play the full 50 measures, and the playback indicator jumping to each of the 49 whole measure rests as time elapsed.
But rests have no MIDI value and therefore create no data within an SMF. They are merely indicators on a score that the stave, for that instrument is empty. Certainly, between notes, they have a value as a delta time, but not if there are no following notes.
Here is a completely empty file being created in Staff View. All the staves are empty and just show a full note rest, but there's no data in the file apart from the default bpm=120 and 4/4 time.
I'll try creating a score many measures long, I'm sure I have one, and insert just one note on an extra track, then mute the rest and see what happens.
Yes, I'll send you my file "OneNote.mid" expect delivery shortly.
As for Anvil, no, I don't think it "knows", the author has just decided in his coding that he will play any SMF to the end of the last measure containing 'events'. This could be the master track, e.g. lots of markers or tempo changes (or any other event) or any other track, e.g. one with just lyrics in it or, of course, one with notes. The decision, in my opinion, is down to the author of the code as to how far to continue playing. I.e. it's down to the design of the 'play engine'.
But it is only an opinion, I'm not an author of any sequencing code, although I spent many years programming mainframes in assembler and machine code from 1967 on, and worked on segments of a mainframe operating system way back in the past. (Distant memories!)
Thank you for the file. You are correct, there is absolutely nothing in the file other the Note On/Off for middle C
Maybe I am wrong in the way I view this, but if I open a file in "Score View" and see for example, four 60-bpm 4/4 measures all with whole rests, I would expect to hear a MIDI file of 16 second duration, albeit all silence.
I came up with two ways last night to achieve this (a kludge perhaps) but it works.
method 1 - Add a Note Off event (note 0, velocity 0) as very last event of music track @ delta time corresponding to end of sequence and method 2 - Add an arbitrary Tempo Change at very end of master track @ delta time corresponding to end of sequence
This morning I got to thinking about method 2, and remember reading somewhere that every SMF should end with a MIDI Reset command, so the sequencer is always left in a standard state (should also be done at beginning of file in case it was not left in standard state).
I could always add a Reset as last event in master track, never even having to "watch" for sequences that end with "rests". Do you have a comment on this? Is the Reset even valid with a SMF?
Yes I remember you telling me about your programming career. You were the one who explained the concept of "Two's Complement" to me a long time ago, when I needed it for this project (how to properly write out key signatures)
Yes, a GM reset at the start of a file is always a good idea, followed by GS or XG reset as required. At the end is debatable. I, for one, think it's a good idea, but unecessary if there's one at the start. I've heard others argue that, i.e. if you insert a series of RPNs changeing pitch bend range to an octave and want to keep that (useful for guitar slides) then the reset messes things up, and so on. My response is those kind of changes should be at the start of every SMF that needs them.
But ... in your case, I think I'd insert something that effectively does nothing, e.g. a marker or text event in the master track.
See here. File deleted.
I've added an empty 'text' meta event to the master track.
It looks like we found another area within XGworks v4 which doesn't work correctly. I've now tried opening the new file in Anvil and Sekaiju and like you find, neither of them like it. SO ... I've opened the original OneNote in Sekaiju, this time, and added a text line in the master track. This time both programs seem to like it so I've attached it here.
This one works perfect, and from that I was able to replicate in my program. Now when I play my 1 note + 3 rest sequence, the file plays the full measure (and playback indicator follows).
I tried taking the same approach with a GM Reset command, but it fails in my program, and Windows Media Player reports the file corrupt. In the master track, I added a delta time and the byte string F0 7E 7F 09 01 F7
Could I ask that you replace the text event in OneNotePlus with a GMReset so I can review that file? I apologize for asking for so much... you can always just say NO.
The byte string is F0 05 7E 7F 09 01 F7 05 being the number of bytes from 7E to F7 I presume.
Where is this stuff even documented?
I have the document Standard MIDI-File Format Spec. 1.1 (18 pages) and I can't even find the documentation for the string 7E 7F 09 01 F7
Now I'm not even sure where I found this in the first place?
Anyways, it works (one 1 second note followed by 15 seconds of silence) and now the same in my program.
I think I like this solution the best, as I don't have to do anything special (ie looking for tracks that end with "rests" and writing a marker event or anything special) Just always add a GM Reset event at end of sequence, as this seems to be good SMF practice.
If I had made some controller setting change during the sequence, the synth would be reset to a default state for the next user, especially if the next user's file doesn't have a reset event at the beginning of his/her SMF.