Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultTempo = 120.0
The Default BPM of the step sequencer
var InputChannels = 0
The number of portaudio input channels. This value is set to 0 since we're reading from disk.
var Microsecond = 1000000000
The number of microseconds in a Second.
var Minute = 60.0
The number of seconds in a Minute as a float.
var OutputChannels = 2
The number of portaudio output channels.
var Ppqn = 24.0
Pulses Per Quarter Note. A synchronization primative used in music technology.
var SampleRate = 44100
The standard audio sampling rate of 44.1kHz (44100)
Functions ¶
func LoadSample ¶
LoadSample loads an audio sample from the passed in filename Into memory and returns the buffer. Returns an error if there was one in audio processing.
Types ¶
type Sequencer ¶
type Sequencer struct { Timer *Timer Bar int Beat int Pattern *drum.Pattern Stream *portaudio.Stream }
Sequencer describes the mechanism that Triggers and synchronizses a Pattern for audio playback.
func NewSequencer ¶
NewSequencer creates and returns a pointer to a New Sequencer. Returns an error if there is one encountered During initializing portaudio, or the default stream
func (*Sequencer) PlayTrigger ¶
PlayTrigger triggers a playback for any track that is active for the passed in index. Triggers a playback by resetting the playhead for the matching tracks.
func (*Sequencer) ProcessAudio ¶
ProcessAudio is the callback function for the portaudio stream Attached the the current Sequencer. Writes all active Track Samples to the output buffer At the playhead for each track.