Skip to content

mxm, IT's mad science

Sections
Personal tools
You are here: Home » Products » Open Source » Python Midi Package » time stamping time_signature events
Downloads
You can download mxm products here.

Due to it's technical and international nature, this section is in english.

Max M Has a blog too.

og er glad for mad

 

Comment

Above in this comment thread: Python Midi Package

time stamping time_signature events

Posted by Anonymous User at 2011-11-02 02:14 AM
Hi

I have managed to get my head around the class structure here (more or less) to create a MidiToTextFile.py based on MidiToText.py

However i have added the facility to report the time of time signature events in the stream, in addition to simply their appearance, as this will assist me in making the text based representation of the score i want to make, with bar markers inserted.

However the times that are being reported do not seem to correlate with their actual positions in the "score time"

For example, I have a time signature of 3/4 occurring after a bar of 2/4, & yet the time signature message reports as being at a point in time not corresponding to duration of the 2/4 bar length or division.

here is the message i create on report of a time signature event in my MidiToText.py

s = "time_signature %i %i %i %i time:%s" % (nn,dd,cc,bb,self.abs_time())


self.textoutfile.write(s + "\n")

assumedly the abs_time() is reporting either:

* a time from an event other than the time sig change, or

* the message itself is not time positioned in the file in a way that is meaningful as an actual reference to the "score" event itself (if that makes sense...)

can anyone help? It would be much appreciated

Tim - Adelaide, Australia

think i found the problem

Posted by Anonymous User at 2011-11-02 02:45 AM
Doh!

I think i found my problem

format: 1, nTracks: 3, division: 120
-------------------------------------

division being == ticks per quarter note?

i was assuming 96....

hopefully this solves it

THANK YOU SO MUCH FOR THIS WONDERFUL CODE!!!

: )

regards

Tim