Documentation ¶
Overview ¶
Code generated by go generate; DO NOT EDIT.
Index ¶
- Constants
- func ConstructPatterns(song *sointu.Song) ([][]byte, [][]byte, error)
- func Synth(patch sointu.Patch) (sointu.Synth, error)
- type AllFeatures
- func (_ AllFeatures) InputNumber(unitType string, paramName string) int
- func (_ AllFeatures) Instructions() []string
- func (_ AllFeatures) Opcode(unitType string) (int, bool)
- func (_ AllFeatures) SupportsGlobalSend() bool
- func (_ AllFeatures) SupportsModulation(unit string, port string) bool
- func (_ AllFeatures) SupportsParamValue(unit string, paramName string, value int) bool
- func (_ AllFeatures) SupportsParamValueOtherThan(unit string, paramName string, value int) bool
- func (_ AllFeatures) SupportsPolyphony() bool
- func (_ AllFeatures) TransformCount(unitType string) int
- type BytePatch
- type FeatureSet
- type Instruction
- type Interpreter
- type NecessaryFeatures
- func (n NecessaryFeatures) InputNumber(unitType string, paramName string) int
- func (n NecessaryFeatures) Instructions() []string
- func (n NecessaryFeatures) Opcode(unitType string) (int, bool)
- func (n NecessaryFeatures) SupportsGlobalSend() bool
- func (n NecessaryFeatures) SupportsModulation(unit string, param string) bool
- func (n NecessaryFeatures) SupportsParamValue(unit string, paramName string, value int) bool
- func (n NecessaryFeatures) SupportsParamValueOtherThan(unit string, paramName string, value int) bool
- func (n NecessaryFeatures) SupportsPolyphony() bool
- func (_ NecessaryFeatures) TransformCount(unitType string) int
- type SampleOffset
- type SynthService
Constants ¶
const MAX_UNITS = 63
const MAX_VOICES = 32
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AllFeatures ¶
type AllFeatures struct { }
AllFeatures is used by the library compilation / bridging to configure a virtual machine that supports every conceivable parameter, so it needs no members and just returns "true" to all queries about what it supports. Contrast this NecessaryFeatures that only returns true if the patch needs support for that feature
func (AllFeatures) InputNumber ¶
func (_ AllFeatures) InputNumber(unitType string, paramName string) int
func (AllFeatures) Instructions ¶
func (_ AllFeatures) Instructions() []string
func (AllFeatures) SupportsGlobalSend ¶
func (_ AllFeatures) SupportsGlobalSend() bool
func (AllFeatures) SupportsModulation ¶
func (_ AllFeatures) SupportsModulation(unit string, port string) bool
func (AllFeatures) SupportsParamValue ¶
func (_ AllFeatures) SupportsParamValue(unit string, paramName string, value int) bool
func (AllFeatures) SupportsParamValueOtherThan ¶
func (_ AllFeatures) SupportsParamValueOtherThan(unit string, paramName string, value int) bool
func (AllFeatures) SupportsPolyphony ¶
func (_ AllFeatures) SupportsPolyphony() bool
func (AllFeatures) TransformCount ¶
func (_ AllFeatures) TransformCount(unitType string) int
type BytePatch ¶
type BytePatch struct { Commands []byte Values []byte DelayTimes []uint16 SampleOffsets []SampleOffset PolyphonyBitmask uint32 NumVoices uint32 }
BytePatch is the compiler Sointu VM bytecode & data (delay times, sample offsets) ready to interpret or from which the ASM/WASM code can be generate.
PolyphonyBitmask is a rather peculiar bitmask used by Sointu VM to store the information about which voices use which instruments: bit MAXVOICES - n - 1 corresponds to voice n. If the bit 1, the next voice uses the same instrument. If the bit 0, the next voice uses different instrument. For example, if first instrument has 3 voices, second instrument has 2 voices, and third instrument four voices, the PolyphonyBitmask is:
(MSB) 110101110 (LSB)
type FeatureSet ¶
type FeatureSet interface { Opcode(unitType string) (int, bool) TransformCount(unitType string) int Instructions() []string InputNumber(unitType string, paramName string) int SupportsParamValue(unitType string, paramName string, value int) bool SupportsParamValueOtherThan(unitType string, paramName string, value int) bool SupportsModulation(unitType string, paramName string) bool SupportsPolyphony() bool SupportsGlobalSend() bool }
FeatureSet defines what opcodes / parameters are included in the compiled virtual machine It is used by the compiler to decide how to encode opcodes
type Instruction ¶
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
Interpreter is a pure-Go bytecode interpreter for the Sointu VM bytecode. It can only simulate bytecode compiled for AllFeatures, as the opcodes hard coded in it for speed. If you are interested exactly how opcodes / units work, studying Interpreter.Render is a good place to start.
Internally, it uses software stack with practically no limitations in the number of signals, so be warned that if you compose patches for it, they might not work with the x87 implementation, as it has only 8-level stack.
func (*Interpreter) Release ¶
func (s *Interpreter) Release(voiceIndex int)
func (*Interpreter) Trigger ¶
func (s *Interpreter) Trigger(voiceIndex int, note byte)
type NecessaryFeatures ¶
type NecessaryFeatures struct {
// contains filtered or unexported fields
}
NecessaryFeatures returns true only if the patch actually needs the support for the feature
func NecessaryFeaturesFor ¶
func NecessaryFeaturesFor(patch sointu.Patch) NecessaryFeatures
func (NecessaryFeatures) InputNumber ¶
func (n NecessaryFeatures) InputNumber(unitType string, paramName string) int
func (NecessaryFeatures) Instructions ¶
func (n NecessaryFeatures) Instructions() []string
func (NecessaryFeatures) SupportsGlobalSend ¶
func (n NecessaryFeatures) SupportsGlobalSend() bool
func (NecessaryFeatures) SupportsModulation ¶
func (n NecessaryFeatures) SupportsModulation(unit string, param string) bool
func (NecessaryFeatures) SupportsParamValue ¶
func (n NecessaryFeatures) SupportsParamValue(unit string, paramName string, value int) bool
func (NecessaryFeatures) SupportsParamValueOtherThan ¶
func (n NecessaryFeatures) SupportsParamValueOtherThan(unit string, paramName string, value int) bool
func (NecessaryFeatures) SupportsPolyphony ¶
func (n NecessaryFeatures) SupportsPolyphony() bool
func (NecessaryFeatures) TransformCount ¶
func (_ NecessaryFeatures) TransformCount(unitType string) int
type SampleOffset ¶
type SynthService ¶
type SynthService struct { }