Documentation ¶
Index ¶
- Constants
- Variables
- func CustomWave(rate int, samples []float32) (w *waveWidget)
- func Level(level float32, rate int) *levelWidget
- func Register(name string, kind widgetKind, argtype map[string]abc.Socket, ...)
- func SinWave(freq float64, rate int) (w *waveWidget)
- func WriteWav(filename string, input Widget) os.Error
- type Buffer
- type ContiguousFloat32Buffer
- type ConverterWidget
- type DelayWidget
- type EnvelopeWidget
- type Float32Buf
- type Float32NBuf
- type Format
- func (f Format) AllocBuffer(n int) Buffer
- func (f0 Format) Combine(f1 Format) Format
- func (f0 Format) CombineBest(f1 Format) Format
- func (f0 Format) Eq(f1 Format) bool
- func (f Format) FullySpecified() bool
- func (f Format) GetFormat(_ string) Format
- func (f0 Format) Match(f1 Format) bool
- func (f Format) TimeToSamples(t Time) int64
- type FormatSetter
- type Formatted
- type GraphWidget
- type Int16Buf
- type LayoutConverterWidget
- type MixWidget
- type MultiplierWidget
- type NFloat32Buf
- func (b NFloat32Buf) AllocFromFloat32Buf(buf Float32Buf) ContiguousFloat32Buffer
- func (b NFloat32Buf) AsFloat32Buf() Float32Buf
- func (b0 NFloat32Buf) Copy(i0 int, b1 Buffer, j0, j1 int)
- func (b NFloat32Buf) GetFormat() Format
- func (b NFloat32Buf) Len() int
- func (b NFloat32Buf) Slice(i0, i1 int) Buffer
- func (b NFloat32Buf) Zero(i0, i1 int)
- type PermuteWidget
- type PhaserState
- type PhaserWidget
- type Rerror
- type RingBufReader
- type RingBufWidget
- func (b *RingBufWidget) Close()
- func (b *RingBufWidget) GetFormat(name string) Format
- func (b *RingBufWidget) Init(inputs map[string]Widget)
- func (b *RingBufWidget) ReadSamples(_ Buffer, _ int64) bool
- func (b *RingBufWidget) Reader(blocking bool, lag int) *RingBufReader
- func (b *RingBufWidget) SetFormat(fmt Format)
- func (b *RingBufWidget) SetMaxSize(bufsize int)
- func (b *RingBufWidget) SetSizes(size, maxsize, readBufSize int)
- type Time
- type WavReader
- type WavWriter
- type Widget
- type WritableRingBufWidget
Constants ¶
View Source
const ( Interleaved = iota + 1 NonInterleaved Mono )
layouts (earlier are considered better)
View Source
const ( Float32Type = iota + 1 Int16Type )
types (earlier are considered better)
View Source
const Unspecified = 0
Variables ¶
View Source
var Debug = false
Functions ¶
func CustomWave ¶
Types ¶
type ContiguousFloat32Buffer ¶
type ContiguousFloat32Buffer interface { Buffer AsFloat32Buf() Float32Buf AllocFromFloat32Buf(buf Float32Buf) ContiguousFloat32Buffer }
type ConverterWidget ¶
type ConverterWidget struct {
// contains filtered or unexported fields
}
func Converter ¶
func Converter(input Widget, f Format) (w *ConverterWidget)
func (*ConverterWidget) GetFormat ¶
func (w *ConverterWidget) GetFormat(name string) (f Format)
func (*ConverterWidget) Init ¶
func (w *ConverterWidget) Init(inputs map[string]Widget)
func (*ConverterWidget) ReadSamples ¶
func (w *ConverterWidget) ReadSamples(b Buffer, t int64) bool
type DelayWidget ¶
type DelayWidget struct { Format // contains filtered or unexported fields }
func (*DelayWidget) Init ¶
func (w *DelayWidget) Init(inputs map[string]Widget)
func (*DelayWidget) ReadSamples ¶
func (w *DelayWidget) ReadSamples(samples Buffer, p0 int64) bool
type EnvelopeWidget ¶
type EnvelopeWidget struct { Format // contains filtered or unexported fields }
func Envelope ¶
func Envelope(t0 int64, rate int, attack, decay, sustain, release int64, sustainlev float32) *EnvelopeWidget
func (*EnvelopeWidget) Init ¶
func (w *EnvelopeWidget) Init(_ map[string]Widget)
func (*EnvelopeWidget) ReadSamples ¶
func (w *EnvelopeWidget) ReadSamples(b Buffer, t int64) (r bool)
func (*EnvelopeWidget) SetFormat ¶
func (w *EnvelopeWidget) SetFormat(f Format)
type Float32Buf ¶
type Float32Buf []float32
func (Float32Buf) GetFormat ¶
func (b Float32Buf) GetFormat() Format
func (Float32Buf) Len ¶
func (b Float32Buf) Len() int
func (Float32Buf) Slice ¶
func (b Float32Buf) Slice(i0, i1 int) Buffer
func (Float32Buf) Zero ¶
func (b Float32Buf) Zero(i0, i1 int)
type Float32NBuf ¶
type Float32NBuf []Float32Buf
n separate channels
func AllocFloat32NBuf ¶
func AllocFloat32NBuf(nchans, n int) Float32NBuf
func (Float32NBuf) GetFormat ¶
func (b Float32NBuf) GetFormat() Format
func (Float32NBuf) Len ¶
func (b Float32NBuf) Len() int
func (Float32NBuf) Permute ¶
func (b0 Float32NBuf) Permute(p []int) Float32NBuf
each item in p represents a channel in the new buffer; its value is which channel it comes from. if it's -1, then we create a zero'd buffer
func (Float32NBuf) Slice ¶
func (b Float32NBuf) Slice(i0, i1 int) Buffer
func (Float32NBuf) Zero ¶
func (b Float32NBuf) Zero(i0, i1 int)
type Format ¶
type Format struct { NumChans int // number of channels (0 if unset) Rate int // samples per second (0 if unset) Layout int Type int }
func (Format) AllocBuffer ¶
func (Format) CombineBest ¶
func (Format) FullySpecified ¶
func (Format) TimeToSamples ¶
type FormatSetter ¶
type FormatSetter interface {
SetFormat(f Format)
}
type GraphWidget ¶
type GraphWidget struct { Format // contains filtered or unexported fields }
func (*GraphWidget) Init ¶
func (w *GraphWidget) Init(inputs map[string]Widget)
func (*GraphWidget) ReadSamples ¶
func (w *GraphWidget) ReadSamples(_ Buffer, _ int64) bool
type LayoutConverterWidget ¶
type LayoutConverterWidget struct { Format // contains filtered or unexported fields }
func (*LayoutConverterWidget) GetFormat ¶
func (w *LayoutConverterWidget) GetFormat(name string) Format
func (*LayoutConverterWidget) Init ¶
func (w *LayoutConverterWidget) Init(_ map[string]Widget)
func (*LayoutConverterWidget) ReadSamples ¶
func (w *LayoutConverterWidget) ReadSamples(b Buffer, t int64) bool
type MixWidget ¶
type MixWidget struct { Format // contains filtered or unexported fields }
func (*MixWidget) ReadSamples ¶
type MultiplierWidget ¶
type MultiplierWidget struct { Format // contains filtered or unexported fields }
func Multiplier ¶
func Multiplier(w0, w1 Widget) *MultiplierWidget
func (*MultiplierWidget) Init ¶
func (w *MultiplierWidget) Init(inputs map[string]Widget)
func (*MultiplierWidget) ReadSamples ¶
func (w *MultiplierWidget) ReadSamples(b Buffer, t int64) bool
type NFloat32Buf ¶
type NFloat32Buf struct { NumChans int Size int Buf Float32Buf }
n channels interleaved
func AllocNFloat32Buf ¶
func AllocNFloat32Buf(nchans, n int) NFloat32Buf
func (NFloat32Buf) AllocFromFloat32Buf ¶
func (b NFloat32Buf) AllocFromFloat32Buf(buf Float32Buf) ContiguousFloat32Buffer
func (NFloat32Buf) AsFloat32Buf ¶
func (b NFloat32Buf) AsFloat32Buf() Float32Buf
func (NFloat32Buf) GetFormat ¶
func (b NFloat32Buf) GetFormat() Format
func (NFloat32Buf) Len ¶
func (b NFloat32Buf) Len() int
func (NFloat32Buf) Slice ¶
func (b NFloat32Buf) Slice(i0, i1 int) Buffer
func (NFloat32Buf) Zero ¶
func (b NFloat32Buf) Zero(i0, i1 int)
type PermuteWidget ¶
type PermuteWidget struct { Format // contains filtered or unexported fields }
func Permute ¶
func Permute(input Widget, p []int) *PermuteWidget
func (*PermuteWidget) Init ¶
func (w *PermuteWidget) Init(inputs map[string]Widget)
func (*PermuteWidget) ReadSamples ¶
func (w *PermuteWidget) ReadSamples(b Buffer, t int64) bool
type PhaserState ¶
type PhaserState struct {
// contains filtered or unexported fields
}
type PhaserWidget ¶
type PhaserWidget struct { Format // contains filtered or unexported fields }
func (*PhaserWidget) Init ¶
func (w *PhaserWidget) Init(inputs map[string]Widget)
func (*PhaserWidget) ReadSamples ¶
func (w *PhaserWidget) ReadSamples(b Buffer, t int64) bool
type RingBufReader ¶
type RingBufReader struct { Lag int // time delta (i.e. latency); zero implies primary output Blocking bool // Read can block for this reader? // contains filtered or unexported fields }
func (*RingBufReader) Close ¶
func (r *RingBufReader) Close()
func (*RingBufReader) GetFormat ¶
func (r *RingBufReader) GetFormat(name string) Format
func (*RingBufReader) Init ¶
func (r *RingBufReader) Init(_ map[string]Widget)
func (*RingBufReader) ReadSamples ¶
func (r *RingBufReader) ReadSamples(samples Buffer, p0 int64) bool
func (*RingBufReader) SetFormat ¶
func (r *RingBufReader) SetFormat(f Format)
type RingBufWidget ¶
type RingBufWidget struct {
// contains filtered or unexported fields
}
func (*RingBufWidget) Close ¶
func (b *RingBufWidget) Close()
func (*RingBufWidget) GetFormat ¶
func (b *RingBufWidget) GetFormat(name string) Format
func (*RingBufWidget) Init ¶
func (b *RingBufWidget) Init(inputs map[string]Widget)
func (*RingBufWidget) ReadSamples ¶
func (b *RingBufWidget) ReadSamples(_ Buffer, _ int64) bool
func (*RingBufWidget) Reader ¶
func (b *RingBufWidget) Reader(blocking bool, lag int) *RingBufReader
func (*RingBufWidget) SetFormat ¶
func (b *RingBufWidget) SetFormat(fmt Format)
func (*RingBufWidget) SetMaxSize ¶
func (b *RingBufWidget) SetMaxSize(bufsize int)
func (*RingBufWidget) SetSizes ¶
func (b *RingBufWidget) SetSizes(size, maxsize, readBufSize int)
type WavReader ¶
type WavReader struct { Format // contains filtered or unexported fields }
func (*WavReader) ReadSamples ¶
type WavWriter ¶
type WavWriter struct { Format // contains filtered or unexported fields }
func (*WavWriter) ReadSamples ¶
type Widget ¶
type Widget interface { Formatted Init(inputs map[string]Widget) ReadSamples(buf Buffer, t int64) bool }
func LayoutConverter ¶
type WritableRingBufWidget ¶
type WritableRingBufWidget struct {
RingBufWidget
}
func WriteableRingBuf ¶
func WriteableRingBuf(size, maxsize int, wblocking bool, fmt Format) *WritableRingBufWidget
func (*WritableRingBufWidget) SampleWrite ¶
func (b *WritableRingBufWidget) SampleWrite(samples Buffer, p0 int64)
Click to show internal directories.
Click to hide internal directories.