×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    6

    Question to MIDI experts

    This question is something only your musician can possibly answer, so if you could have your musician look at this, it would be great.

    In order to produce the smallest possible filesize of a MIDI to be used on the JavaME platform, the musician avoids using too many controllers and commands within the track, and try to only set a few parameters once in the beginning of the track, such as panning and volume.
    Then we try to stick with only NOTE_ON and NOTE_OFF events in the track itself.

    I began thinking, that some instruments, like e.g. drums, theoretically doesn't need a NOTE_OFF event, since they are very short sounds already. Same goes for a marimba and a pizza string. So I experimented by removing all NOTE_OFF events for drums and marimba in a 38kb file, resulting in a 25kb file with no hear-able difference. That's great! 13kb is a big deal on the JavaME platform, isn't it?

    BUT, now I'm thinking, if I'm violating the format by doing this "trick". Will it in reality eat up polyphony and possible crash on some devices? Or does a short instrument infact have a kind of auto-note_off according to the specification?
    Some phones have socalled Scalable Polyphony, meaning they auto-scale the MIDI if it has too much polyphony. But can we count on that technology to handle the increasing polyphony built-up?
    Somehow I just can't believe, that playing 500 bassdrums over 250 seconds without NOTE_OFF events, would result in a 500 polyphony MIDI. I mean, surely there has to be some kind of standard mechanism in a MIDI playback device that goes "Hey, this instrument is clearly done playing, so I'll kill it now."?

    So what do you think? Is it stupid to eliminate NOTE_OFF events for short instruments? Is the NOTE_OFF event actually required by the specification in order to end a note, and will 500 bassdrums without a NOTE_OFF event result in 500 polyphony?

    Thanks for any feedback.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Question to MIDI experts

    Hmmm... that 13k you're saving would be the uncompressed size of the .mid file, right? How much difference does it make to the compressed (jar) size?

    I'm not sure if MIDI actually defines what happens in this circumstance.

    No, I don't think you are steadily building up polyphony. However, you may be tying up one unit for longer than necessary by failing to terminate the note.

    I would say, if you get away with it, great. But test on as many devices as possible.

    Graham.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    6

    Re: Question to MIDI experts

    Quote Originally Posted by grahamhughes View Post
    Hmmm... that 13k you're saving would be the uncompressed size of the .mid file, right? How much difference does it make to the compressed (jar) size?
    Virtually none. MIDI gets compressed really well in a jar. You won't notice the difference in jar size. The difference is within the amount of memory needed to load the MIDI.

    It's 13k of data I just remove from the file, without it causing any hear-able difference. 13k of NOTE_OFF events. Not sure though how much memory NOTE_OFF events take, but I'm pretty sure loading a 38k MIDI takes more than 38kb memory. I remember having trouble with out first game, when trying to load a 12kb MIDI file on a Nokia 6060. Apparently it ran out of memory despite of very few graphics.

    Quote Originally Posted by grahamhughes View Post
    I would say, if you get away with it, great. But test on as many devices as possible.
    Yea, that seems to be my options.

Similar Threads

  1. Ringtone corrupts midi
    By skills_f4i in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-10-08, 14:06
  2. Replies: 0
    Last Post: 2004-08-23, 10:07
  3. Midi annoyances
    By lax@work in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-03-26, 17:51
  4. trouble playing MIDI and WAV concurrently
    By dkainer in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-12-10, 02:03
  5. My question about converting midi to rtttl format
    By yanbo in forum Smart Messaging
    Replies: 1
    Last Post: 2002-10-09, 03:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×