Python & Music: Performance question

achrist at easystreet.com achrist at easystreet.com
Mon Apr 7 14:30:49 EDT 2003


Is there anything in Python like the Midi support in the java
sdk?  (under MS Windows) It's pretty easy in java to send midi data 
straight from the program to the midi sequencer or synthesizer
(no need to write a file or deal with some external player).   
Anything like that for Python?

Al
     

David Asorey Álvarez wrote:
> 
> forodejazz at yahoo.es (David Asorey Álvarez) wrote in message news:
> <1759581e.0304060218.164d4cd4 at posting.google.com>...
> > Hello, group.
> >
> > I'm developing a small music program, and I have some doubts.
> >
> >  [...]
> 
>   Thanks to all.
>   I've tried some test with the first version and there is not any
> problem, even with thousands of notes:
> 
> class Note:
>    def __init__(self, pitch, duration):
>       self.pitch = pitch
>       self.duration = duration
>    def change_pitch(factor): pass
>    def change_duration(factor): pass
> 
> if __name__ ==  '__main__':
>     import time
>     notes = []
>     t1 = time.clock()
>     for x in range(10000):
>         notes.append(Note(x, x))
>     t2 = time.clock()
>     print t2 - t1
> 
> Pentium 800, 128 Ram, W2K: 0.16 s
> Pentium 133, 40 Ram, Linux (woody): 1.67 s
> 
> For my purposes, this are acceptable values.
> 
> Again, thanks for your advices.
> 
> David




More information about the Python-list mailing list