![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: wrap? | |
cristian_vogel Member |
![]() ![]() ![]() what would be a simple way to fold values to a range? Rather than clipTo01 , a way to make a value that goes past the toplimit, fold back down by the excess ammount, like aliasing does with nyquist. IP: Logged | |
GregoryCichoracki Member |
![]() ![]() ![]() Someone at SSC gave me this code which does just what you want at audio rate http://www.symbolicsound.com/cgi-bin/forumdisplay.cgi?action=displayprivate&number=7&topic=000419 IP: Logged | |
pete Member |
![]() ![]() ![]() Hi Cristian If your using Capybara then Petes DSP has a flip module at sampler rate. Pete IP: Logged | |
cristian_vogel Member |
![]() ![]() ![]() how about a wrap in capytalk? for processing pitches for example when the go off the top of the nn scale, that the appear at the bottom again IP: Logged | |
SSC Administrator |
![]() ![]() ![]() To wrap from the top of the MIDI pitch range, starting over at 0 again you could use: !KeyNumber mod: 128 To start inverting once you get above a certain pitch you could try something like: ((!KeyNumber gt: !MaxNumber) true: (2 * !MaxNumber - !KeyNumber) false: !KeyNumber) nn That way, when you got above !MaxNumber it would subtract the difference between the incoming pitch and !MaxNumber from the incoming pitch. IP: Logged | |
SSC Administrator |
![]() ![]() ![]()
This is a refinement of one of the ideas of the previous response that will continue to wrap, even if your input is more than twice the maximum. It replaces the comparison with mod: and min:. Here is the expression: | range wrap | range := !Max - !Min. (wrap min: 2 * range - wrap) + !Min IP: Logged | |
SSC Administrator |
![]() ![]() ![]() If you ever need to do this kind of 'fold-over' operation to the signal at the sampling rate, you can use the Prototype called: 'InputOutputCharacteristic Wave folding Waveshaper'. It's in the Distortion & Waveshaping category. IP: Logged | |
cristian_vogel Member |
![]() ![]() ![]() thank you SSC ! IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.