[PD] Sorting samples by value

Johannes M Zmoelnig zmoelnig at iem.kug.ac.at
Thu Oct 25 19:32:51 CEST 2001


hi !

On Wed, 24 Oct 2001, David McCallum wrote:
>          I'm trying to route the samples of an audio signal (adc~, no 
> table) according to their value. I tried using max~ and min~ to separate 
> them but I found that max~ and min~ clip all the audio coming in, but still 
> output their min or max value even when the incoming sample is out of 
> range. (ie. a sample value of 3 put through a [max~ 4] comes through as 4, 
> not nothing. (or even 0 would be nice))

to get "nothing" out of a signal-object is contradictory to the idea of
signals. digital streams have to be 44100 samples per second (or whatever
samplerate you use), or else, they would stop being streams.

still, there are various approaches for your problem:
1) use 0 instead of nothing (which "would be nice"):
1a) subtract a signal, that is clipped-by max~ (or min~) from the original
signal: you will get only those samples, that are higher (or less) then a
specifique value, the rest being zero
1b) you can compare signals with >~ and <~ (zexy) and multiply the output
with the original signal

but then, you could leave the stream-layer of pd and move over to the
message-layer (with pack~/unpack~). bit this is highly inefficient...

> 
>          This is for waveshaper algorithms where samples in certain ranges 
> get treated differently.
> 
waveshaping ? what about using tabread4~ (but i guess, itshould be more
sophiticated..)


>          Any suggestions? I think I'm probably overlooking something.
> 
see 1a)


mfg.casd.asdf
IOhannes

> David McCallum
> 
> 
> 




More information about the Pd-list mailing list