Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instrument ¶
type Instrument struct { // Name of the instrument, e.g. Snare Name string // File location of the instrument's audio sample (relative to root of project) // Filename string // Beat subdivisions where the instrument should be triggered Pattern []int // Manager for audio of instrument Audio audio.Manager }
Instrument stores audio for later playback.
func NewInstrument ¶
func NewInstrument(name, filename string, pattern []int) (*Instrument, error)
NewInstrument builds an Instrument object with Audio support.
type Track ¶
type Track struct { // Title of the track Title string // Amount of time the track should play Length time.Duration // Beats per minute (BPM) of the track BeatsPerMinute int // Number of beats per measure BeatsPerMeasure int // Number of times to divide each beat (e.g. 1 for quarter notes, 2 for eighth notes) DivisionsPerBeat int // Instruments used in the track. Instruments []*Instrument // Sequence of instruments to be played in the track. Patterns [][]*Instrument }
Track is an object which can be played.
Click to show internal directories.
Click to hide internal directories.