Audio Forums


Reply
Thread Tools Display Modes

Calculate MIDI polyphony

 
 
Michel
Guest
Posts: n/a

 
      07-10-2008, 09:59 PM
Hi all,

Well, I am looking for a way to calculate polyphony within MIDI
files. The aim would be to feed an indicator showing the current
number of notes which are played simutaneously, and to evaluate
the maximum polyphony reached within a MIDI file.

A basic method would be to add +1 at every new NoteOn
event, and to substract -1 when the same note is switched
off through a NoteOff event. This way, I always get the
(theoretical) number of notes being played simultaneously
at the current time.

But, doing so with some midi files, I will get a wrong indication
of what can be heard, as some MIDI instruments do stop
automatically after a while (case with notes played on piano,
drums, ...) even if no NoteOff event is sent (at least with
the default controls), while with other instruments, notes will
be played and heard forever if we don't stop them by sending
an explicit NoteOff.

Is there any practical way to know when (let's say the number
of milliseconds after NoteOn) a note really stops playing (if it
does), depending on the current instrument, controls, and
MIDI implementation ?

Any tips ?

Michel


 
Reply With Quote
 
 
 
 
Günter Nagler
Guest
Posts: n/a

 
      08-02-2008, 09:42 AM


Michel schrieb:
> Hi all,
>
> Well, I am looking for a way to calculate polyphony within MIDI
> files. The aim would be to feed an indicator showing the current
> number of notes which are played simutaneously, and to evaluate
> the maximum polyphony reached within a MIDI file.
>
> A basic method would be to add +1 at every new NoteOn
> event, and to substract -1 when the same note is switched
> off through a NoteOff event. This way, I always get the
> (theoretical) number of notes being played simultaneously
> at the current time.
>
> But, doing so with some midi files, I will get a wrong indication
> of what can be heard, as some MIDI instruments do stop
> automatically after a while (case with notes played on piano,
> drums, ...) even if no NoteOff event is sent (at least with
> the default controls), while with other instruments, notes will
> be played and heard forever if we don't stop them by sending
> an explicit NoteOff.
>
> Is there any practical way to know when (let's say the number
> of milliseconds after NoteOn) a note really stops playing (if it
> does), depending on the current instrument, controls, and
> MIDI implementation ?
>
> Any tips ?
>
> Michel


GNMIDI (demo at http://www.gnmidi.com) has a function for calculating
maximum note polyphony:
http://www.gnmidi.com/handbook/english/midipoly.htm

you need to consider piano pedal controllers and controllers like "all
notes off", they influence the polyphony too.

The real behavior is depending on the selected sound and device (so
could be less than calculated notes if sound turns off automatically
before note off).
The actual number of sound generators used are usually higher than note
polyphony (complex sounds use more generators than simple sounds).

Guenter

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Calculate Firewire Throughput? Mike Rivers Pro Audio 5 04-16-2009 06:44 AM
Polyphony Oz MIDI 2 12-27-2005 05:56 AM
Polyphony Limitations In SX2 Songsmith Cubase 7 11-26-2004 04:30 PM
Newbie qstn: how to use laptop to enhance Yamaha keyboard with limited polyphony? Tim Richardson MIDI 0 12-25-2003 08:09 PM


All times are GMT. The time now is 08:44 AM.