Documentation ¶
Overview ¶
Package mlsic provides compositional algorithms and abstractions for producing audio.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algo1 ¶
type Algo1 struct { // Model is used as Model.Dump() to retrieve to total of graphs Algo1 should process. Graphs Graph // Outputs holds output renders. Outputs []Renderer // Panning is used as Panning.Apply(sine, value) to pan the sine waves generated. Panning Pan // Format (audio.Format) holds number of channels and sample-rate in Hz. Format *audio.Format // Logging enables logging during Algo1.Run(). Logging bool // contains filtered or unexported fields }
Algo1 holds all necessary dependencies for the algorithm to run.
type Algo1Option ¶
type Algo1Option func(*Algo1)
Algo1Option if a custom type function that accepts *Algo1 and is used WithXXX options functions.
func Algo1WithAdditionalRenderer ¶
func Algo1WithAdditionalRenderer(r Renderer) Algo1Option
Algo1WithAdditionalRenderer can be used to have Algo1 render with more renderers than the one provided.
func Algo1WithAudioFormat ¶
func Algo1WithAudioFormat(format *audio.Format) Algo1Option
Algo1WithAudioFormat can set custom format for Algo1.
func Algo1WithLogging ¶
func Algo1WithLogging() Algo1Option
Algo1WithLogging enables logging for Algo1.
func Algo1WithPan ¶
func Algo1WithPan(pan Pan) Algo1Option
Algo1WithPan can set custom pan for Algo1.
type Graph ¶
type Graph interface { // Dump must return a slice of simple.WeightedUndirectedGraph. // The order of the graphs are sorted in the slice is the order // they will be executed by the compositional algo. Dump() ([]*simple.WeightedUndirectedGraph, error) }
Graph is intended as decoupling the graph generation implementation from the compositional algorithms.
type Pan ¶
type Pan interface { // Apply must accept the audio signal and the relevant position between total of channels Channels(). // Buffer must always be of MONO format (ie. audio.FormatMono96000 or audio.FormatMono44100). // Position must be always between 0.0 and 1.0. In the case of two channels values from 0. to 0.5 // will represent the left speaker and values from 0.5 to 1. the right one. // In the case of four speakers setup values from 0. to 0.25 will represent speakers no.1 etc.. Apply(signal audio.PCMBuffer, position float32) []*audio.PCMBuffer // Channels must return the total number of channels the Apply() method should use. Channels() int }
Pan declares a generic interface intended to be used for panning operations. Pan is not designed for equal power multi-speaker panning. It will always pan the signal from a single source point.
type Renderer ¶
type Renderer interface { // Render accepts a slice of audio.PCMBuffer that must always be of MONO format (ie. audio.FormatMono96000 or audio.FormatMono44100). // The number of buffers in the slice represent the numbers of audio channels the renderer must handle. Render(b []*audio.PCMBuffer) error }
Renderer Pan declares a generic interface intended to be used for sound rendering operations.
Directories ¶
Path | Synopsis |
---|---|
Package calculate provides convenient functions to help perform various repetitive calculations.
|
Package calculate provides convenient functions to help perform various repetitive calculations. |
example
|
|
hello
This is simple example demonstrating the use of mlsic packages with a CLI.
|
This is simple example demonstrating the use of mlsic packages with a CLI. |
Package generator implements mlsic.Graph but instead of using GNNs for graph generation, it uses deterministic algos.
|
Package generator implements mlsic.Graph but instead of using GNNs for graph generation, it uses deterministic algos. |
Package pan holds various mlsic.Pan implementations.
|
Package pan holds various mlsic.Pan implementations. |
Package render holds various mlsic.Renderer implementations.
|
Package render holds various mlsic.Renderer implementations. |