First time here? Check out the FAQ!
x

What is the best way to make a harmonic fader?

0 votes
618 views

Often I seem to want a fader that will transpose a frequency up and down through the harmonic sequence. In other words a fader that would go through the something like the following values to use as the frequency multiplier:

... 1/4, 1/3, 1/2, 1, 2, 3, 4 ...
 

I've found one way to do this (put in the frequency parameter of a Sound):

| h_sign |

h_sign := ((!Harmonic ge: 0) * 2 - 1).
default hz * ((!Harmonic + h_sign) ** h_sign)

 

If my !Harmonic fader has a range from -3 to +3 then this code would give:

1/4, 1/3, 1/2, 1, 2, 3, 4

So this works but is there a better way to do this?

 

related to an answer for: Centre Detent control pattern
asked Nov 5, 2018 in Using Kyma by alan-jackson (Virtuoso) (15,840 points)
If you want exactly those values, could you use this?

(!Harmonic * 6) of: #({1/4} {1/3} {1/2} 1 2 3 4)

1 Answer

+1 vote
 
Best answer

For a simpler function, you could use:

default hz * ((!Harmonic true: (!Harmonic + 1) false: (!Harmonic - 1) inverse)

(This is only harmonic when the fader has an integer value though.)

answered Nov 5, 2018 by ssc (Savant) (128,200 points)
selected Nov 5, 2018 by alan-jackson
what software are you using to plot your equations, if you don't mind me asking, SSC? looks useful!
I just typed in 1/(1-x) in the Google search window :)
wow... the more i know, huh? I was hoping it was something simple and not matlab or something. Glad it isn't Kyma either because I'd spend the rest of my week trying to figure THAT one out!
That is such a great idea. Using kyma as a general purpose "analog modelling" computer. Matlab with sound. It would be such a fantastic educational platform. You can map terms of equations to hardware knobs and plot the output on screen trivially easy.  My dad has often told me that he didn't really get differential equations until he used an analog computer.
I know what you (and your dad) mean; sometimes I also like to select what's in a parameter field and use Ctrl+Shift+Y to visualize it with changing inputs and fader values while listening to the result at the same time. :)
...