Normalizing pitch to frequency parameters
madskjeldgaard opened this issue · 2 comments
Hi
First of all thanks for the great work here. These are awesome!
I have a small feature request: It would be really nice if the pitch arguments were expressed in hertz (as a frequency
parameter) instead of midi notes to conform with the standard of many other SC uGens to allow more flexibility. The midi note conversion can be done easily outside of the ugen but with the parameter as frequency the user has more of a choice.
Again thank you very much!
best
Hey, thanks.
I was thinking about that before, but don't feel convinced, yet.
Right now the UGens conform to how the original modules work. The pitch argument in Emilie's code is used/mangled in several ways, before it gets converted to frequency eventually.
The laziest approach to change the arg from pitch to frequency would be to reconvert to pitch immediately on entry and keep the rest of the code unchanged. This is pretty inefficient.
A better scenario would be to stick to the freq argument and avoid reconversion to pitch. But this would mean a lot of changes to the original code base and some very careful testing of the influences/side effects would be necessary. I'll keep playing with the idea, but right now I'm not up to this.
Hello
BTW, the pitch is a MIDI note but can be fractional, so you can convert from freq to pitch with
pitch = freq.cpsmidi
And it works fine !