I’m trying to build a delay that raises the frequency of each delayed line by a specific (chromatic) interval. In other words, if the initial note is C60 and the pitch raise is a whole step, then the first delay will play at D62, the next at E64, then F#66, G#68, etc. The below patch works so long as the initial note is C60, but if it is higher than that, the intervals sound stretched; below C60, the intervals sound compressed.
The [plugin~] to [plugout~] audio chain should be self-explanatory. The “delay” [live.dial] sets the delay time in ms and the “interval” [live.dial] sets the interval in half steps. The [r note1] object receives the MIDI note number from an external patch (this is a workaround so I don’t have to include a pitch recognition patch).
Calculating the interval frequency proceeds as follows using the above example: C60 comes in as a starting pitch and has “2” added to it (representing the whole step) to generate MIDI note D62. Both note numbers are converted to Hz and the difference is calculated. That number (32.039203 in this case) is sent to the appropriate [freqshift~] object in the delay chain. D62 then has the same operation performed on it, yielding the frequency difference between it and E64 (35.962789 Hz); E64 has the same operation performed on it, etc., through five total iterations.
As far as I’ve been able to check, the math on this is correct, e.g., the difference between D62 and E64 is in fact 35.962789 Hz and the difference between D86 and E88 really is 143.851156 Hz. However, when the patch is played with a starting note higher than C60 the perceived difference between, for example, D86 and E88 is not a whole step. Setting the “interval” [live.dial] for fifths (“7”), this is very clear, e.g., C60 to G67 is 130.369871 Hz and sounds like a perfect fifth, but in C84 to G91 -- a difference of 521.479482 Hz -- the G sounds very sharp.
I’m assuming there’s something I’m not accounting for, but I can’t figure what. Is raising a pitch by the frequency difference between it and the desired note not the right method for this? Is [freqshift~] not the right object (i.e., is it not made for what I want it to do)? I’d be grateful for any feedback.