char*
unread,Jun 25, 2009, 10:46:23 PM6/25/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mingus
Hi all,
This release took a little bit longer than I promised, but here it is.
I haven't written any new tutorials yet, so I will just provide you
with some small code examples like the last time.
== midi/Sequencer.py ==
This is the new general purpose sequencer that can play the
mingus.containers. I doesn't make any sound, but instead makes some
event callbacks and notifies observers when something needs to be
played (observer pattern). For the most part it takes care of all the
icky timing algorithms, which nobody wants to reimplement everytime.
== midi/fluidsynth.py ==
This module now uses the new Sequencer class and has become a lot
simpler by doing so, because it now only needs to take care of
reacting to the events.
So what's the advantage of this new Sequencer?
1. The timing code is abstracted away, making it a lot easier to
support different back-ends (like portaudio, timidity, w/e) and MIDI
streaming for example.
2. You can now attach as many observers as you like. In previous
versions, when you called eg. fluidsynth.play_Bar , you couldn't know
when what note was being played and lost control for as long as the
Bar was playing. Now you can attach an observer and receive status
updates + parameters callbacks. I will add a basic SequencerObserver
class and a tutorial for this later; to make this as easy as possible.
== containers/NoteContainer.py ==
Added consonance and dissonance tests as methods. These functions test
each note against the other for consonance/dissonance.
>>> NoteContainer().from_chord("Am").is_consonant()
True
>>> NoteContainer().from_chord("Am").is_perfect_consonant()
False
>>> NoteContainer().from_chord("Am").is_imperfect_consonant()
False
>>> NoteContainer().from_chord("Am").is_dissonant()
False
== extra/fft.py ==
This is the new audio analysis module which can be used to find the
frequencies and Notes of raw audio data. I posted a rough version of
this before, but this one should be nicer, faster and better. In the
unit test folder you can find a pair of wav files to test with:
>>> import mingus.extra.fft as fft
>>> fft.find_melody("440_880_clean.wav")
[('A-4', 86), ('A-5', 86), ..]
find_melody is an experimental function, which is probably not that
useful 'in the wild'. It does great with these super clean sine waves,
but mostly fails when trying to decipher complex or noisy polyphonic
music. All the functions that give you fine grain control over the
frequencies and amplitudes and their analysis are there though so some
cool things should be possible. Check the source for more details.
That's it for now. I will try to update the wiki a bit in the
following couple of weeks, so hopefully the tutorials should also be
up soon.
Best regards,
Bart Spaans