Kyma Forum
  Tips & Techniques
  wrap?

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   wrap?
cristian_vogel
Member
posted 14 November 2011 04:43         Edit/Delete Message   Reply w/Quote
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
posted 14 November 2011 09:45         Edit/Delete Message   Reply w/Quote
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
posted 14 November 2011 12:47         Edit/Delete Message   Reply w/Quote
Hi Cristian
If your using Capybara then Petes DSP has a flip module at sampler rate.
Pete

IP: Logged

cristian_vogel
Member
posted 25 February 2012 08:28         Edit/Delete Message   Reply w/Quote
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
posted 25 February 2012 09:35         Edit/Delete Message   Reply w/Quote
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
posted 25 February 2012 14:51         Edit/Delete Message   Reply w/Quote

ReflectiveWrappingSTG.kym

 
Here is a SoundToGlobalController with an expression in it that will wrap (with reflection) the input to fall between the minimum and maximum values.

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 := !In - !Min mod: 2 * range.

(wrap min: 2 * range - wrap) + !Min

IP: Logged

SSC
Administrator
posted 25 February 2012 14:54         Edit/Delete Message   Reply w/Quote
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
posted 29 February 2012 10:02         Edit/Delete Message   Reply w/Quote
thank you SSC !

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c