Version: v0.1.0 Latest Latest

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 10 Imported by: 0



Code generated by go generate; DO NOT EDIT.



This section is empty.


View Source
var GmDlsEntries = []GmDlsEntry{}/* 495 elements not displayed */
View Source
var GmDlsEntryMap = make(map[vm.SampleOffset]int)
View Source
var UnitTypeNames []string


func NoteAsValue

func NoteAsValue(octave, note int) byte

func NoteStr

func NoteStr(val byte) string

func VuAnalyzer

func VuAnalyzer(tau float64, attack float64, release float64, minVolume float64, maxVolume float64, bc <-chan []float32, vc chan<- Volume, ec chan<- error)

VuAnalyzer receives stereo from the bc channel and converts these into peak & average volume measurements, and pushes Volume values into the vc channel. The pushes are nonblocking so if e.g. a GUI does not have enough time to process redraw the volume meter, the values is just skipped. Thus, the vc chan should have a capacity of at least 1 (!).

Internally, it first converts the signal to decibels (0 dB = +-1). Then, the average volume level is computed by smoothing the decibel values with a exponentially decaying average, with a time constant tau (in seconds). Typical value could be 0.3 (seconds).

Peak volume detection is similar exponential smoothing, but the time constants for attack and release are different. Generally attack << release. Typical values could be attack 1.5e-3 and release 1.5 (seconds)

minVolume is just a hard limit for the vuanalyzer volumes, in decibels, just to prevent negative infinities for volumes


type EditMode

type EditMode int
const (
	EditPatterns EditMode = iota

type GmDlsEntry

type GmDlsEntry struct {
	Start              int
	LoopStart          int
	LoopLength         int
	SuggestedTranspose int
	Name               string

type Model

type Model struct {
	// contains filtered or unexported fields

Model implements the mutable state for the tracker program GUI.

Go does not have immutable slices, so there's no efficient way to guarantee accidental mutations in the song. But at least the value members are protected.

func NewModel

func NewModel() *Model

func (*Model) AddInstrument

func (m *Model) AddInstrument(after bool)

func (*Model) AddOrderRow

func (m *Model) AddOrderRow(after bool)

func (*Model) AddPatchObserver

func (m *Model) AddPatchObserver(observer chan<- sointu.Patch)

func (*Model) AddPlayingObserver

func (m *Model) AddPlayingObserver(observer chan<- bool)

func (*Model) AddSamplesPerRowObserver

func (m *Model) AddSamplesPerRowObserver(observer chan<- int)

func (*Model) AddScoreObserver

func (m *Model) AddScoreObserver(observer chan<- sointu.Score)

func (*Model) AddTrack

func (m *Model) AddTrack(after bool)

func (*Model) AddUnit

func (m *Model) AddUnit(after bool)

func (*Model) AdjustSelectionPitch

func (m *Model) AdjustSelectionPitch(delta int)

func (*Model) CanAddInstrument

func (m *Model) CanAddInstrument() bool

func (*Model) CanAddTrack

func (m *Model) CanAddTrack() bool

func (*Model) CanDeleteInstrument

func (m *Model) CanDeleteInstrument() bool

func (*Model) CanDeleteTrack

func (m *Model) CanDeleteTrack() bool

func (*Model) CanDeleteUnit

func (m *Model) CanDeleteUnit() bool

func (*Model) CanRedo

func (m *Model) CanRedo() bool

func (*Model) CanUndo

func (m *Model) CanUndo() bool

func (*Model) ChangedSinceSave

func (m *Model) ChangedSinceSave() bool

func (*Model) ClearUndoHistory

func (m *Model) ClearUndoHistory()

func (*Model) Cursor

func (m *Model) Cursor() SongPoint

func (*Model) DeleteInstrument

func (m *Model) DeleteInstrument(forward bool)

func (*Model) DeleteOrderRow

func (m *Model) DeleteOrderRow(forward bool)

func (*Model) DeletePatternSelection

func (m *Model) DeletePatternSelection()

func (*Model) DeleteSelection

func (m *Model) DeleteSelection()

func (*Model) DeleteTrack

func (m *Model) DeleteTrack(forward bool)

func (*Model) DeleteUnit

func (m *Model) DeleteUnit(forward bool)

func (*Model) EditMode

func (m *Model) EditMode() EditMode

func (*Model) FilePath

func (m *Model) FilePath() string

func (*Model) InstrIndex

func (m *Model) InstrIndex() int

func (*Model) Instrument

func (m *Model) Instrument() sointu.Instrument

func (*Model) IsPatternUnique

func (m *Model) IsPatternUnique(track, pattern int) bool

func (*Model) LowNibble

func (m *Model) LowNibble() bool

func (*Model) MaxInstrumentVoices

func (m *Model) MaxInstrumentVoices() int

func (*Model) MaxTrackVoices

func (m *Model) MaxTrackVoices() int

func (*Model) Note

func (m *Model) Note() byte

func (*Model) NoteTracking

func (m *Model) NoteTracking() bool

func (*Model) NumParams

func (m *Model) NumParams() int

func (*Model) Octave

func (m *Model) Octave() int

func (*Model) Param

func (m *Model) Param(index int) (Parameter, error)

func (*Model) ParamIndex

func (m *Model) ParamIndex() int

func (*Model) Redo

func (m *Model) Redo()

func (*Model) ResetParam

func (m *Model) ResetParam()

func (*Model) ResetSong

func (m *Model) ResetSong()

func (*Model) SelectionCorner

func (m *Model) SelectionCorner() SongPoint

func (*Model) SetBPM

func (m *Model) SetBPM(value int)

func (*Model) SetChangedSinceSave

func (m *Model) SetChangedSinceSave(value bool)

func (*Model) SetCurrentPattern

func (m *Model) SetCurrentPattern(pat int)

func (*Model) SetCursor

func (m *Model) SetCursor(value SongPoint)

func (*Model) SetEditMode

func (m *Model) SetEditMode(value EditMode)

func (*Model) SetFilePath

func (m *Model) SetFilePath(value string)

func (*Model) SetInstrIndex

func (m *Model) SetInstrIndex(value int)

func (*Model) SetInstrument

func (m *Model) SetInstrument(instrument sointu.Instrument) bool

func (*Model) SetInstrumentName

func (m *Model) SetInstrumentName(name string)

func (*Model) SetInstrumentVoices

func (m *Model) SetInstrumentVoices(value int)

func (*Model) SetLowNibble

func (m *Model) SetLowNibble(value bool)

func (*Model) SetNote

func (m *Model) SetNote(iv byte)

SetCurrentNote sets the (note) value in current pattern under cursor to iv

func (*Model) SetNoteTracking

func (m *Model) SetNoteTracking(value bool)

func (*Model) SetOctave

func (m *Model) SetOctave(value int) bool

func (*Model) SetParam

func (m *Model) SetParam(value int)

func (*Model) SetParamIndex

func (m *Model) SetParamIndex(value int)

func (*Model) SetRowsPerBeat

func (m *Model) SetRowsPerBeat(value int)

func (*Model) SetRowsPerPattern

func (m *Model) SetRowsPerPattern(value int)

func (*Model) SetSelectionCorner

func (m *Model) SetSelectionCorner(value SongPoint)

func (*Model) SetSong

func (m *Model) SetSong(song sointu.Song)

func (*Model) SetSongLength

func (m *Model) SetSongLength(value int)

func (*Model) SetTrackVoices

func (m *Model) SetTrackVoices(value int)

func (*Model) SetUnitIndex

func (m *Model) SetUnitIndex(value int)

func (*Model) SetUnitType

func (m *Model) SetUnitType(t string)

func (*Model) Song

func (m *Model) Song() sointu.Song

func (*Model) SwapInstruments

func (m *Model) SwapInstruments(i, j int)

func (*Model) SwapUnits

func (m *Model) SwapUnits(i, j int)

func (*Model) Track

func (m *Model) Track() sointu.Track

func (*Model) Undo

func (m *Model) Undo()

func (*Model) Unit

func (m *Model) Unit() sointu.Unit

func (*Model) UnitIndex

func (m *Model) UnitIndex() int

type Parameter

type Parameter struct {
	Type      ParameterType
	Name      string
	Hint      string
	Value     int
	Min       int
	Max       int
	LargeStep int

type ParameterType

type ParameterType int
const (
	IntegerParameter ParameterType = iota

type Player

type Player struct {
	// contains filtered or unexported fields

func NewPlayer

func NewPlayer(service sointu.SynthService, closer <-chan struct{}, patchs <-chan sointu.Patch, scores <-chan sointu.Score, samplesPerRows <-chan int, posChanged chan<- struct{}, syncOutput chan<- []float32, outputs ...chan<- []float32) *Player

func (*Player) Disable

func (p *Player) Disable()

func (*Player) Enabled

func (p *Player) Enabled() bool

func (*Player) Play

func (p *Player) Play(position SongRow)

func (*Player) Playing

func (p *Player) Playing() bool

func (*Player) Position

func (p *Player) Position() (SongRow, bool)

Position returns the current play position (song row), and a bool indicating if the player is currently playing. The function is threadsafe.

func (*Player) Release

func (p *Player) Release(ID uint32)

Release is used to manually release a note on the player when jamming. Expects an ID that was previously acquired by calling Trigger.

func (*Player) Stop

func (p *Player) Stop()

func (*Player) Trigger

func (p *Player) Trigger(voiceStart, voiceEnd int, note byte) uint32

Trigger is used to manually play a note on the sequencer when jamming. It is thread-safe. It starts to play one of the voice in the range voiceStart (inclusive) and voiceEnd (exclusive). It returns a id that can be called to release the voice playing the note (in case the voice has not been captured by someone else already).

func (*Player) VoiceState

func (p *Player) VoiceState(voice int) (bool, int)

type SongPoint

type SongPoint struct {
	Track int

func (SongPoint) AddPatterns

func (r SongPoint) AddPatterns(patterns int) SongPoint

func (SongPoint) AddRows

func (r SongPoint) AddRows(rows int) SongPoint

func (SongPoint) Clamp

func (p SongPoint) Clamp(score sointu.Score) SongPoint

func (SongPoint) Wrap

func (p SongPoint) Wrap(score sointu.Score) SongPoint

type SongRect

type SongRect struct {
	Corner1 SongPoint
	Corner2 SongPoint

func (*SongRect) Contains

func (r *SongRect) Contains(p SongPoint) bool

type SongRow

type SongRow struct {
	Pattern int
	Row     int

func (SongRow) AddPatterns

func (r SongRow) AddPatterns(patterns int) SongRow

func (SongRow) AddRows

func (r SongRow) AddRows(rows int) SongRow

func (SongRow) Clamp

func (r SongRow) Clamp(score sointu.Score) SongRow

func (SongRow) Wrap

func (r SongRow) Wrap(score sointu.Score) SongRow

type Volume

type Volume struct {
	Average [2]float64
	Peak    [2]float64

Volume represents an average and peak volume measurement, in decibels. 0 dB = signal level of +-1.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL