Re: midi- note on/off

From: Monica (leungmonica_at_yahoo.com)
Date: 09/28/04


Date: Tue, 28 Sep 2004 23:10:58 +0800


You've mentioned this...
> If you are playing midi, then various standards such as midi file
> format contain the length of each note, and software that can read and
> play from that format will do what ever they do to make it work.

I am actually writing a S/W, which read the midi binary file.. and then
convert it to my embedded system's codec format.
that's
  Playnote(frequency, amplitude, duration){}

That means I need the duration of each note specifically. Would you
please say specifically how I can calculate the duration?

Thank you!

-Monica

Malcolm Dew-Jones wrote:
> Monica (leungmonica@yahoo.com) wrote:
> : Do anyone know about the midi protocol?
>
> : I would like to know specifically how long each note is pressed?
>
> That is not part of the midi protocol. If recording, you must measure the
> time when you receive a note on event and the time when you receive a note
> off event, and compare the two times. How to do that depends on what
> platform you are using. You don't actually have to measure the timing of
> individual notes, if you simply record the time between events then you
> can play back the original stream of events with the correct time between
> the events and the length of each note will work automatically.
>
> If you are playing midi, then various standards such as midi file format
> contain the length of each note, and software that can read and play from
> that format will do what ever they do to make it work. In that case you
> must simply format a file correctly to get the output you want.
>
> If you are playing midi event for event in your own software then you must
> figure out a way to do this yourself, though it might be easy enough if
> you are using a set of library routines cause they will provide functions
> that takes care of those details.
>
>
> : say if i receive a note on message.... then a note-off message is
> : obtained.[then how long is the note pressed?]
> : how can I calculate it?
> : Thank you!



Relevant Pages

  • Re: midi- note on/off
    ... :> If you are playing midi, then various standards such as midi file ... :> play from that format will do what ever they do to make it work. ... you mean the standard midi file format, but there are others, depending on ... Each note on would be added to your data structure as it was found. ...
    (comp.programming)
  • Re: sent this to http://apple.com/feedback/ipod.html
    ... > I never said it was, or that I was looking for "MIDI" inside. ... significant amounts of RAM, USB controller, a computer level processor as ... > Stick the iPod on the mini's relevant components then. ... >> compatible format would have a lot to do with it. ...
    (comp.sys.mac.advocacy)
  • XMID maybe...
    ... displaying format... ... That's a creative idea about how to use MIDI, ... Windows Media Development Team ...
    (microsoft.public.windowsmedia.player)
  • Re: Making and installing your own ringtones - advice, please
    ... preferably by uploading to a website and then downloading ... That depends on the format you want. ... I get tunes in midi format from my computer, which I load onto the phone. ...
    (uk.telecom.mobile)
  • Questions about MIDI
    ... Does anyone here understand the MIDI format? ... MIDI files to text but am unsure how to extract the data I need. ... PLAY command or a text string that can be used to play the tune with ...
    (comp.sys.sinclair)