[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Determining note duration from midi input



I think you've done this already, but maybe ticks with buffersize does
something?

Save the Normal get_ticks() on keydown, and then on keyup, print
difference.  ( on phone so I don't know the exact sdl_getticks()
pygame function )

I found a few notes reading the docs:

Excerp from docs:
==========================
The buffer_size specifies the number of
output events to be buffered waiting for output. (In some cases -- see
below -- PortMidi does not buffer output at all and merely passes data
to a lower-level API, in which case buffersize is ignored.)
 latency is the delay in milliseconds
applied to timestamps to determine when the output should actually
occur. (If latency is < 0, 0 is assumed.) If latency is zero, timestamps are
ignored and all output is delivered immediately. If latency is greater
than zero, output is delayed until the message timestamp plus the
latency. (NOTE: time is measured relative to the time source
indicated by time_proc. Timestamps are absolute, not relative delays
or offsets.)
 In some cases, PortMidi can obtain better timing than your application
by passing timestamps along to the device driver or hardware. Latency
may also help you to synchronize midi data to audio data by matching
midi latency to the audio buffer latency.
===========================

-- 
Jake


-- 
Jake