Well.. I'm using a thread to play the songs while showing the notes on a
virtual piano... The thread has units of a tick (a dictionary with the keys
as time in ticks), so I need to synchronize it with that... And right now
it's not about saving files, but loading them... So, I need to populate the
dictionary with the MIDI file. And the delta time has to be translated to
ticks. It does play all the tracks ATM, but it starts them all at the same
time, while that's not what it's supposed to do. And some of the instruments
are wrong, but that's for later concern... And I'm not sure about the tempo
either.

Thanks,
Maarten


On 10/08/06, stephane richard <[EMAIL PROTECTED]> wrote:

FIrst thing I need to know is do you need to synchronize anything that is
not MIDI with your midi file?

if not, you don't need these events.

Let me know...
----- Original Message -----
From: "Maarten de Vries" <[EMAIL PROTECTED]>
To: "REALbasic NUG" <[email protected]>
Sent: Thursday, August 10, 2006 1:35 PM
Subject: Re: MIDI type 1


>I think I made a mistake.. my script (which I used to search) didn't
search
> correctly. Whenever an undefined meta event was encountered, it was
> supposed
> to ignore everything until the end byte. But it was ignoring everything
> including the end byte. So, it started ignoring everything somewhere
> before
> the first &h9* command... But now I have a new questions :-(. This MIDI
> stuff is awfully complicated.
>
> I need help on using some meta events.. these to be exact:
>
> FF 51 03 tttttt* Set Tempo, in microseconds per MIDI quarter-note*
>> This event indicates a tempo change. Another way of putting
"microseconds
>> per quarter-note" is "24ths of a microsecond per MIDI clock".
>> Representing
>> tempos as time per beat instead of beat per time allows absolutely
exact
>> long-term synchronization with a time-based sync protocol such as SMPTE
>> time
>> code or MIDI time code. This amount of accuracy provided by this tempo
>> resolution allows a four-minute piece at 120 beats per minute to be
>> accurate
>> within 500 usec at the end of the piece. Ideally, these events should
>> only
>> occur where MIDI clocks would be located Q this convention is intended
to
>> guarantee, or at least increase the likelihood, of compatibility with
>> other
>> synchronization devices so that a time signature/tempo map stored in
this
>> format may easily be transferred to another device.
>>
>> FF 54 05 hr mn se fr ff* SMPTE Offset*
>> This event, if present, designates the SMPTE time at which the track
>> chunk
>> is supposed to start. It should be present at the beginning of the
track,
>> that is, before any nonzero delta-times, and before any transmittable
>> MIDI
>> events. The hour must be encoded with the SMPTE format, just as it is
in
>> MIDI Time Code. In a format 1 file, the SMPTE Offset must be stored
with
>> the
>> tempo map, and has no meaning in any of the other tracks. The ff field
>> contains fractional frames, in 100ths of a frame, even in SMPTE-based
>> tracks
>> which specify a different frame subdivision for delta-times.
>>
>> FF 58 04 nn dd cc bb* Time Signature*
>> The time signature is expressed as four numbers. nn and dd represent
the
>> numerator and denominator of the time signature as it would be notated.
>> The
>> denominator is a negative power of two: 2 represents a quarter-note, 3
>> represents an eighth-note, etc. The cc parameter expresses the number
of
>> MIDI clocks in a metronome click. The bb parameter expresses the number
>> of
>> notated 32nd-notes in a MIDI quarter- note (24 MIDI Clocks). This was
>> added
>> because there are already multiple programs which allow the user to
>> specify
>> that what MIDI thinks of as a quarter-note (24 clocks) is to be notated
>> as,
>> or related to in terms of, something else.
>>
>
> First off all, the tempo change. I use units of a tick. I'm not sure,
but
> a
> division of 30 seems to be that (I expected 60, but that was to fast).
> Anyway, how do I convert the delta time from the files to ticks? Of
> cource,
> I'll need the division in the header to...
>
> The SMPTE offset seems clear, except for the fr and ff. What do they
mean?
>
> And then time signature... Do I even need this? And if so, what
influence
> does it have?
>
> I'm sorry if this seems a bit stupid, but it's just to much dividing and
> stuff. I get it all mixed in my head...
>
> Thanks again,
> Maarten
>
> On 10/08/06, stephane richard <[EMAIL PROTECTED]> wrote:
>>
>> What does the file play in media player?
>>
>> You can have sysex messages stored in a midi file of course, but they
>> wouldn't play sounds per se (though some might play effects of some
>> sort)....
>>
>> So if the midi file without &H9* events plays a song, i'd like to see
>> it...
>>
>> I supposed you can play notes in Sysex only ultimately, but that's like
>> the
>> hard way to do things ;-). if it doesn't infringe any copyrights, I'd
>> like
>> to have that midi file so I can take it apart ;-).
>>
>> ..
>> ----- Original Message -----
>> From: "Maarten de Vries" <[EMAIL PROTECTED]>
>> To: "REALbasic NUG" <[email protected]>
>> Sent: Thursday, August 10, 2006 8:15 AM
>> Subject: Re: MIDI type 1
>>
>>
>> >I have another question. Or a problem actually. I'm trying to load a
>> >type
>> 1
>> > MIDI file, but nowhere in the entire file is a byte with &h9*. So,
>> > there
>> > isn't a single play note status byte in the entire file. If I open it
>> with
>> > media player it works fine though. There are a few FF bytes. They
seam
>> to
>> > mean "reset", but what can I do with that? I really don't understand
>> > how
>> > you
>> > can make a MIDI file withough any &h9* in it...
>> >
>> > Thanks,
>> > Maarten
>> >
>> >
>> > On 10/08/06, stephane richard <[EMAIL PROTECTED]> wrote:
>> >> >
>> >> > internally, on the sound card, it wouldn't make a difference...if
>> >> > you
>> >> > have 2
>> >> > midi instruments on these two channels, then you should play them
on
>> >> > the
>> >> >
>> >> > same channel (hence the same instrument).
>> >> >
>> >> >
>> >>
>> > _______________________________________________
>> > Unsubscribe or switch delivery mode:
>> > <http://www.realsoftware.com/support/listmanager/>
>> >
>> > Search the archives of this list here:
>> > <http://support.realsoftware.com/listarchives/lists.html>
>> >
>> >
>> > --
>> > No virus found in this incoming message.
>> > Checked by AVG Free Edition.
>> > Version: 7.1.405 / Virus Database: 268.10.8/414 - Release Date:
>> > 8/9/2006
>> >
>> >
>>
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>>
>> Search the archives of this list here:
>> <http://support.realsoftware.com/listarchives/lists.html>
>>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.10.8/415 - Release Date: 8/9/2006
>
>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to