Discussion:
How to translate "DSP" code into SC code?
henrique matias
2014-09-09 01:08:58 UTC
Permalink
Sorry for my ignorance guys, but i would like to know how to translate some
"DSP" into SC code..

For instance on this tutorial for Max/MSP gen~ object


The guy grab some waveshaper code from music dsp
<http://www.musicdsp.org/showone.php?id=86>:

const double x = input * 0.686306;
const double a = 1 + exp (sqrt (fabs (x)) * -0.75);
output = (exp (x) - exp (-x * a)) / (exp (x) + exp (-x));


Then do a few tweaks and run it inside of his patch with gen~..

Any thought on how to implement this using SC ?



--
*time isn't passing, it's you passing.*

❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂
❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁
Nick Collins
2014-09-09 07:48:02 UTC
Permalink
(
{
var x = SoundIn.ar * 0.686306;
var a = 1 + exp (sqrt (abs (x)) * -0.75);
var output = (exp (x) - exp (-1 * x * a)) / (exp (x) + exp (-1 * x));
output
}.scope
)
Sorry for my ignorance guys, but i would like to know how to translate some "DSP" into SC code..
For instance on this tutorial for Max/MSP gen~ object http://youtu.be/OwHfkoAj2-U
const double x = input * 0.686306;
const double a = 1 + exp (sqrt (fabs (x)) * -0.75);
output = (exp (x) - exp (-x * a)) / (exp (x) + exp (-x));
Then do a few tweaks and run it inside of his patch with gen~..
Any thought on how to implement this using SC ?
--
time isn't passing, it's you passing.
❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂
❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁ ❂ ❁
tedthetrumpet
2014-09-09 09:21:07 UTC
Permalink
Cool. I'd love to see someone now rewrite it into a more typical, um, message
passing(?) style. Probably beyond me...



-----
--
J. Simon van der Walt
jsimonvanderwalt.com
twitter.com/tedthetrumpet
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/How-to-translate-DSP-code-into-SC-code-tp7613317p7613321.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
thor
2014-09-09 09:45:22 UTC
Permalink
Do you mean like:

SynthDef(\dsp, {arg amp=1, pan=0; // add your control parameters here
var x = SoundIn.ar * 0.686306;
var a = 1 + exp (sqrt (abs (x)) * -0.75);
var output = (exp (x) - exp (-1 * x * a)) / (exp (x) + exp (-1 * x));
Out.ar(Pan2.ar(output*amp, pan));
}).add;

a = Synth(\dsp);
a.set(\pan, -1);

(I didn't test this, but it should work)
Post by tedthetrumpet
Cool. I'd love to see someone now rewrite it into a more typical, um, message
passing(?) style. Probably beyond me...
-----
--
J. Simon van der Walt
jsimonvanderwalt.com
twitter.com/tedthetrumpet
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/How-to-translate-DSP-code-into-SC-code-tp7613317p7613321.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Loading...