> Hi
>
> I'm hacking together some Python code that runs some basic music
> analysis routines (like auto-labelling chords & suggesting keys &
> regions etc) on MIDI files.
> As i am working on Ubuntu, I downloaded Rosegarden just to examine
> some files & do a bit of housekeeping with it... thank you to all of
> you for what looks like a pretty cool Linux based sequencer.
>
> My question is concerning the algorithms for the "Notation Properties"
> for each of the note events...
There are 3 types of quantizer in Rosegarden. Notation is one, but it
only quantizes the notation - the way Rosegarden draws the notes. Matrix
quantizing resets the performance times - I should look at it again before
I type but I'm just trying to get the outlines of it out to you. The
third is legato quantizing but ISTM that would be of little help to you.
> Essentially, i want to implement a similar algorithm in my python
> script, to "square up" my start times & durations so that i can get a
> better result running MIDI files through my python scripts when they
> aren't "hard quantised".
So if I understand right, you have MIDI files from performance. So of
course the times are inexact, and you want to put them on exact bars and
beats.
Quantizing will help you up to a point, but soon the times will drift by
too much.
What could help you is something I added a few months back,
FitToBeatsCommand. Basically you copy a note on each beat to an empty
segment. Fill in any gaps in the beats. Then "Fit to beats" from the
main window. It will adjust both the Rosegarden timing and the tempo,
giving the same performance times but with Rosegarden beats exactly on the
beats. This affects all tracks and all segments.
You'll probably want to matrix quantize after that. Then export as MIDI.
I should point out that I never polished it because nobody seemed
interested, so you have to manually change segment start times to put the
first bar exactly on a bar, etc. Not hard to do but tricky at first.
>
> i.e. i think this is a lot more complex than it appears at face value,
> & I happened to stumble upon this property, & was hoping i might be
> able to be pointed to the algorithm (in pseudocode would be fine, i'm
> not really familiar much with C or C++ ) so i can write a script to
> perform a similar function?
The algorithm's in FitToBeatsCommand.cpp, if that's still what you want to
do.
Also you might be interested in Rosegarden's analysis code, mostly in
src/base/AnalysisTypes.cpp Any chance you'd look it over and contribute?
Tom Breton (Tehom)
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel