[CM] (keynum :through) and (note :through) bug?

Rick Taube taube@uiuc.edu
Thu, 29 Mar 2007 09:07:03 -0500


yes you are correct as i look at the docs they imply the behavior you  
expected! so im not sure which is the bug: the doc or the code. arrgh!
On Mar 29, 2007, at 8:44 AM, Joshua Parmenter wrote:

> Hi Rick,
>
> Thanks for looking at it. :nearest would be nice, and as far as  
> equidistant decisions, I imagine a short warning in the doc would  
> be fine. I usually use the function with floats anyways, so I don't  
> imagine that happening very often. It would probably also be good  
> to change the docs on note and keynum, since 'closest' is used  
> quite a bit. This implied to me a round somewhere in the function  
> rather then floor...
>
> Thanks again for looking at it. And if you decide to add it to CVS,  
> please let me know.
>
> Best,
>
> Josh
>
> On Mar 29, 2007, at 6:37 AM, Rick Taube wrote:
>
>> joshua -- apologies for the delay in this reply but i havent had  
>> much time to stare at code lately. the behavior you encountered  
>> isnt a bug but it also isnt much of a feature, its due to a  
>> 'floor' like search of the mode's legal steps. i could change that  
>> behavior but that would break existing behavior.
>>
>> perhaps i could add a :nearest keyword that would look for the  
>> nearest (rather than the lower) step (?) so you would write:
>>
>> (note 67 :nearest mymod)
>>
>> of course if its equidistant to a step above AND below then it  
>> still might not return the one you want, so ill have to think  
>> about how best to do this.
>>
>> On Mar 23, 2007, at 5:29 PM, Joshua Parmenter wrote:
>>
>>> Hi all...
>>>
>>> This doesn't seem like the expected behavior. Is this right? And  
>>> if it is, does anyone know a way to get the values I'm expecting?
>>>
>>> (defvar mymode)
>>> (setq mymode (new mode :degrees '(c df ef f gs a b c)))
>>> (note 67 :through mymode); => F ??? shouldn't it be GS?
>>> (note 67.5 :through mymode) ;=> AF ???
>>> (keynum 67 :through mymode); => 65 ??? shouldn't it be 68?
>>> (keynum 67.4 :through mymode) ;=> 65 !!!
>>> (keynum 67.5 :through mymode) ;=> 68 !!!
>>>
>>> Thanks for any help.
>>>
>>> Josh
>>>
>>> ******************************************
>>> Joshua Parmenter
>>> University of Washington
>>> Center for Digital Arts and Experimental Media
>>> School of Music
>>> Seattle, Washington 98195
>>>
>>> http://www.realizedsound.net/josh/
>>> http://www.dxarts.washington.edu
>>>
>>>
>>>
>>
>
> ******************************************
> Joshua Parmenter
> University of Washington
> Center for Digital Arts and Experimental Media
> School of Music
> Seattle, Washington 98195
>
> http://www.realizedsound.net/josh/
> http://www.dxarts.washington.edu
>
>
>
> _______________________________________________
> Cmdist mailing list
> Cmdist@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist