RedDPCMdecode differential pulse-code modulation



very simple ugen to decode dpcm encoded signals.  can also be (mis)used for other purposes.


see also: RedDPCMencode


*ar(in)

*kr(in)

in - input signal

dpcm(in)

language side



//--

s.boot

b= Buffer.read(s, "sounds/a11wlk01.wav")

a= {RedDPCMdecode.ar(PlayBuf.ar(1, b, loop:1)).dup}.play //loud!

a.free

a= {PlayBuf.ar(1, b, loop:1).dup}.play

a.free

b.free



//--

a= {RedDPCMdecode.ar(SoundIn.ar([0, 1]))}.play

a.free

a= {SoundIn.ar([0, 1])}.play

a.free



//--language side

(

a= RedDPCMdecode.new;

[0, 0, 1, 0.6, 0.49, 0, -1].do{|x| a.dpcm(x, 0).postln}; ""

)


(

a= RedDPCMdecode.new;

b= RedDPCMencode.new;

[0, 0, 1, 0.6, 0.49, 0, -1].do{|x| b.dpcm(a.dpcm(x), 0).postln}; ""

)