controller

package
v0.0.0-...-486f928 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Config             *audio.AudioConfig
	Synth              *synth.Synth
	Sequencer          *sequencer.Sequencer
	InstrumentBankFile string
	PercussionBankFile string
	UI                 ui.UI
}

The Controller is a high level object that can be used to setup and control the Synthesizer, Sequencer and the instrument banks.

func NewController

func NewController(cfg *audio.AudioConfig) *Controller

func (*Controller) DecreaseSequencerBPM

func (c *Controller) DecreaseSequencerBPM()

func (*Controller) EnableSDLSink

func (c *Controller) EnableSDLSink() error

Enables "real-time" audio output using the SDL library.

func (*Controller) EnableWavSink

func (c *Controller) EnableWavSink(file string) error

Record all Synthesizer output in to a .wav file. The file gets written when the sink closes (usually when the program ends).

func (*Controller) IncreaseSequencerBPM

func (c *Controller) IncreaseSequencerBPM()

func (*Controller) LoadEmptySequencer

func (c *Controller) LoadEmptySequencer()

func (*Controller) LoadInstrumentBank

func (c *Controller) LoadInstrumentBank(file string) error

Load an instrument bank definition from a file.

func (*Controller) LoadPercussionBank

func (c *Controller) LoadPercussionBank(file string) error

Load an percussion instrument bank definition from a file.

func (*Controller) LoadSequencerFromFile

func (c *Controller) LoadSequencerFromFile(file string) error

Load a Sequencer definition from a file and start the sequencer in a go-routine.

func (*Controller) MoveSequencerBackward

func (c *Controller) MoveSequencerBackward()

func (*Controller) MoveSequencerForward

func (c *Controller) MoveSequencerForward()

func (*Controller) Quit

func (c *Controller) Quit()

Close the Synthesizer and its sinks.

func (*Controller) ReloadInstrumentBank

func (c *Controller) ReloadInstrumentBank() error

Reload the instrument bank by reloading the file.

func (*Controller) ReloadPercussionBank

func (c *Controller) ReloadPercussionBank() error

Reload the instrument percussion bank by reloading the file.

func (*Controller) ReloadSequencer

func (c *Controller) ReloadSequencer()

Reload the sequencer by reloading the file.

func (*Controller) StartSequencer

func (c *Controller) StartSequencer()

Start Sequencer. The sequencer is started in its own go-routine.

func (*Controller) StartSynth

func (c *Controller) StartSynth()

Start Synthesizer. Note that this synthesizer isn't run in a go-routine by default.

func (*Controller) ToggleSoloChannel

func (c *Controller) ToggleSoloChannel(ch int)

Jump to

Keyboard shortcuts

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