bridge

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NativeSynth added in v0.3.0

type NativeSynth C.Synth

func Synth

func Synth(patch sointu.Patch, bpm int) (*NativeSynth, error)

func (*NativeSynth) Release added in v0.3.0

func (bridgesynth *NativeSynth) Release(voice int)

Release is part of C.Synths' implementation of sointu.Synth interface

func (*NativeSynth) Render added in v0.3.0

func (bridgesynth *NativeSynth) Render(buffer sointu.AudioBuffer, maxtime int) (int, int, error)

Render renders until the buffer is full or the modulated time is reached, whichever happens first. Parameters:

buffer     float32 slice to fill with rendered samples. Stereo signal, so
           should have even length.
maxtime    how long nominal time to render in samples. Speed unit might modulate time
           so the actual number of samples rendered depends on the modulation and if
           buffer is full before maxtime is reached.

Returns a tuple (int, int, error), consisting of:

samples    number of samples rendered in the buffer
time       how much the time advanced
error      potential error

In practice, if nsamples = len(buffer)/2, then time <= maxtime. If maxtime was reached first, then nsamples <= len(buffer)/2 and time >= maxtime. Note that it could happen that time > maxtime, as it is modulated and the time could advance by 2 or more, so the loop exit condition would fire when the time is already past maxtime. Under no conditions, nsamples >= len(buffer)/2 i.e. guaranteed to never overwrite the buffer.

func (*NativeSynth) Trigger added in v0.3.0

func (bridgesynth *NativeSynth) Trigger(voice int, note byte)

Trigger is part of C.Synths' implementation of sointu.Synth interface

func (*NativeSynth) Update added in v0.3.0

func (bridgesynth *NativeSynth) Update(patch sointu.Patch, bpm int) error

Update

type NativeSynther added in v0.3.0

type NativeSynther struct {
}

func (NativeSynther) Synth added in v0.3.0

func (s NativeSynther) Synth(patch sointu.Patch, bpm int) (sointu.Synth, error)

type RenderError

type RenderError struct {
	// contains filtered or unexported fields
}

Render error stores the exact errorcode, which is actually just the x87 FPU flags, with only the critical failure flags masked. Useful if you are interested exactly what went wrong with the patch.

func (*RenderError) Error

func (e *RenderError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL