Re: [Pythonsound-devel] omde.score patch [was (no subject)]
Status: Beta
Brought to you by:
mupuxeddu
|
From: Maurizio U. P. <um...@ti...> - 2001-10-09 16:38:28
|
On Sat, 6 Oct 2001, Paul Winkler wrote: > I'm still exploring omde/score.py, which seems to be the area that > largely overlaps my pysco ideas. I thought as long as I'm trying > things out to see what they do, I might as well save my test cases and > add a doctest hook to the module. In the process, I found a few things > that I'm pretty sure are bugs and took the liberty of fixing them. Thank you very much: you do work that I planned to do plus things that I hadn't noticed. > The attached diff is against cvs of today, Oct 6, 19:50 UTC. > > Notes on changes: > > - General modifications: > * Added many tests to docstrings. > * Added _test() to run doctest on the docstrings. > > - Event: > CHANGED: Changed all spellings of "strech" to "stretch". > FIXED BUG: stretch_absolute_backward used 'alfa' should be 'time' > FIXED BUG: stretch_relative_backward used 'alfa', should be 'alpha' > FIXED INCONSISTENCY: stretch_relative_backward was always returning floats; > other methods return ints if given int arguments. Should be consistent. > > - F: > BUG FIXED: but maybe it was a feature.... but if F(number=None), > it's free to choose a number that was already specified by the user. > I changed it to keep track of all used numbers and choose the lowest > unused number. > > BUG FIXED: F.end() added, to always return F.onset instead of F.duration > (which is actually not duration but table length). > Using F and I polymorphically would not have worked. There was I reason for not to add the end() method... but I don't remember what... The problem of the "duration" of tables was known to me. This is the reason the attach() method and related code. But it's a temporary workaround. See below. > - Aggregate: > BUG FIXED: removed first definition of load() ... it was defined twice > and the first looked broken. > > ADDED: append() which adds one object to the list. > We have extend(), why not continue the list metaphor? > > BUG FIXED: extend() had the wrong order of arguments to isinstance() > > CHANGED: saveAs to raise a proper TypeError if wrong argument given > > CHANGED: deepcopy() wasn't returning anything. > > BUG FIXED: clone() was missing, though some other methods use it. > I assume it's the same as deepcopy. One name should be used throughout. > > SUGGESTION: a shorter name for calculate_onset_min_max, et al, > would be get_onset_min_max. calculate_ was there to remeber that it is not at accessor method but it has to do some work. Could we use calc_ as a compromise? > BUG FIXED: calculate_onset_min_max always returned None as minimum. > > BUG FIXED: calculate_begin_end always returned None as the start. Did you checked it? min(None, everything) is always everything. It's like None is infinite and this is the reason to use max2(). > BUG FIXED: calculate_onset_min_max, et al. will now work with > classes that derive from both Event and Aggregate. Ok. The only problems is that I made a lot of changes on that file too today and moved ScoreEvent, I, F etc in omde.csound. BTW, I find some problems putting *all* conversion to csound numeric score notation out of the omde.score module. Maurizio Umberto Puxeddu. |