Skip to content
mohayonao edited this page Dec 7, 2013 · 1 revision

Class Methods

Buffer(source:[])

Create and return a Buffer and immediately allocate the required memory on the server.

b = Buffer([-1, -0.5, -0.25, -0, +0, +0.25, +0.5, +1])
( -> OscN.ar(b, 440) ).play()

Buffer(numFrames:0, numChannels:1)

Create and return a Buffer and immediately allocate the required memory on the server. The buffer's values will be initialised to 0.0.

Buffer.read(path:String, startFrame=0, numFrames=-1)

Allocate a buffer and immediately read a soundfile into it.

v = Buffer.read("/files/audio/amen.wav")
( -> PlayBuf.ar(1, b, loop:1) ).play()

--

Instance Methods

zero()

Sets all values in this buffer to 0.0.

setn(...)

Set the value in the buffer at index to be equal to float.

b = Buffer(8)
b.set(0, 0.25, 4, [0.5, 0.75]) # buffer=> [ 0.25, 0, 0, 0, 0,5, 0.75, 0, 0 ]

sine1(amps:[], normalize:true, asWavetable:true, clearFirst:true)

Fill this buffer with a series of sine wave harmonics using specified amplitudes.

b = Buffer(1024, 1).sine1(1 / [1, 2, 3, 4])
( -> Osc.ar(b, 440) ).play()

sine2(freqs:[], amps:[], normalize:true, asWavetable:true, clearFirst:true)

Fill this buffer with a series of sine wave partials using specified frequencies and amplitudes.

sine3(freqs:[], amps:[], phases:[], normalize:true, asWavetable:true, clearFirst:true)

Fill this buffer with a series of sine wave partials using specified frequencies, amplitudes, and initial phases.

cheby(amplitudes:[], normalize:true, asWavetable:true, clearFirst:true)

Clone this wiki locally