On Tue, 12 Dec 2006, hard off wrote:
sorry, i have a few questions today, i know it's bad from to ask them all in one thread, but i don't want to start too many threads. question 1) how do you multiply a signal by a power of n ? can you do it with expr~?
you might mean "raise a signal to the nth power". the way you wrote it is somewhat confusing (but still guessable). [expr~ pow($v1,$f2)]
is there a list of the functions that i can use with expr~ (and expr) ? i have seen many of these functions in other peoples patches, but can't find them in pd's documentation.
[expr~] is considered an external, that is just bundled with pd. Beyond the help file, your best bet might be looking at vexp_fun.c. It might be C code, but at least you can find the names of all the allowed functions.
i want to insert a percentage of random noise into a signal. ie, for every oscillation of an [osc~] i want 25% of the samples to be converted into noise. the level and position of the noise should be random, but 25% of the samples in each oscillation must be be converted into noise. any idea how to do that?
25% of samples might sound a lot noisier than what you want. Perceptually you will not have something damaged by only 25% and you'll be lucky if you still hear something. It's not as if you replaced 25% of pixels by noise in an image.
If you still want to do it, you can do it like:
[inlet] [noise~] [noise~] | | | [expr~ if($v3<=-0.5,$v2,$v1)]
Where <= -0.5 selects the first quarter (25%) of the -1..+1 range used by [noise~]. If you remapped [noise~] to the 0..1 range, the threshold would become 0.25 = 25%.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada