engine

package
v0.0.0-...-fabf6b5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct {
	PPQN  int
	Tempo float64

	Pulses chan int
}

func NewClock

func NewClock(tempo float64) *Clock

func (*Clock) Start

func (c *Clock) Start()

type Instrument

type Instrument struct {
	ID         int
	Name       string
	EntryPoint *things.Output
	ExitPoint  *things.Output
	Things     []*things.Thing
	Settings   []*things.Setting
}

func NewInstrument

func NewInstrument(name string) *Instrument

func (*Instrument) AddThing

func (i *Instrument) AddThing(thing *things.Thing)

func (*Instrument) ExposeSetting

func (i *Instrument) ExposeSetting(name string, setting *things.Setting)

func (*Instrument) HideSetting

func (i *Instrument) HideSetting(setting *things.Setting)

func (*Instrument) Next

func (i *Instrument) Next(sample int, entryPoint int) float64

func (*Instrument) SetEntryPointNextable

func (i *Instrument) SetEntryPointNextable(entryPointNextable things.Nextable)

func (*Instrument) SetExitPoint

func (i *Instrument) SetExitPoint(exitPoint *things.Output)

type InstrumentPatch

type InstrumentPatch struct {
	ID int

	Instrument *Instrument
	// contains filtered or unexported fields
}

func NewInstrumentPatch

func NewInstrumentPatch(instrument *Instrument) *InstrumentPatch

func (*InstrumentPatch) Apply

func (ip *InstrumentPatch) Apply()

func (*InstrumentPatch) Get

func (ip *InstrumentPatch) Get(setting *things.Setting) float64

func (*InstrumentPatch) Next

func (ip *InstrumentPatch) Next(sample int) float64

func (*InstrumentPatch) NoteOff

func (ip *InstrumentPatch) NoteOff(hz float64)

func (*InstrumentPatch) NoteOn

func (ip *InstrumentPatch) NoteOn(hz float64)

func (*InstrumentPatch) Set

func (ip *InstrumentPatch) Set(setting *things.Setting, value float64)

type Loop

type Loop struct {
	ID int

	Pulses      int
	TotalPulses int
	IsRecording bool
	IsFinished  bool

	InstrumentPatch *InstrumentPatch
	// contains filtered or unexported fields
}

func NewLoop

func NewLoop(patch *InstrumentPatch) *Loop

func (*Loop) GetMessages

func (l *Loop) GetMessages(pulse int) []midi.Message

func (*Loop) SaveMessage

func (l *Loop) SaveMessage(message midi.Message)

func (*Loop) StartRecording

func (l *Loop) StartRecording()

func (*Loop) StopRecording

func (l *Loop) StopRecording()

type MidiDevice

type MidiDevice struct {
	Messages chan midi.Message
	// contains filtered or unexported fields
}

func NewMidiDevice

func NewMidiDevice(deviceID portmidi.DeviceID) *MidiDevice

func (*MidiDevice) Start

func (md *MidiDevice) Start() error

func (*MidiDevice) Stop

func (md *MidiDevice) Stop() error

type MidiManager

type MidiManager struct {
	// contains filtered or unexported fields
}

func NewMidiManager

func NewMidiManager() *MidiManager

func (*MidiManager) AttachSettingToNextEvent

func (mm *MidiManager) AttachSettingToNextEvent(patch *InstrumentPatch, setting *things.Setting)

func (*MidiManager) ConnectToDevice

func (mm *MidiManager) ConnectToDevice(deviceID portmidi.DeviceID)

func (*MidiManager) GetDevices

func (mm *MidiManager) GetDevices() []*portmidi.DeviceInfo

func (*MidiManager) Process

func (mm *MidiManager) Process(msg midi.Message)

func (*MidiManager) ProcessLoopMessage

func (mm *MidiManager) ProcessLoopMessage(patch *InstrumentPatch, msg midi.Message)

func (*MidiManager) SetCurrentInstrumentPatch

func (mm *MidiManager) SetCurrentInstrumentPatch(patch *InstrumentPatch)

func (*MidiManager) SetCurrentLoop

func (mm *MidiManager) SetCurrentLoop(loop *Loop)

func (*MidiManager) Start

func (mm *MidiManager) Start() error

func (*MidiManager) Stop

func (mm *MidiManager) Stop() error

type Mutable

type Mutable interface {
	Mute()
}

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

func NewPattern

func NewPattern(pattern []bool) *Pattern

func (*Pattern) AtBeat

func (p *Pattern) AtBeat(beat int) bool

type Playable

type Playable interface {
	PlayFrequency(float64)
	StopFrequency(float64)
}

type Player

type Player struct {
	Tracks []*Track
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer() *Player

func (*Player) AddTrack

func (p *Player) AddTrack(track *Track)

func (*Player) Start

func (p *Player) Start() error

func (*Player) Stop

func (p *Player) Stop() error

type Sequencable

type Sequencable interface {
	IsPlaying() bool
	Play()
	Stop()
}

type Sequencer

type Sequencer struct {
	// contains filtered or unexported fields
}

func NewSequencer

func NewSequencer(clock *Clock, midiManager *MidiManager) *Sequencer

func (*Sequencer) AddLoop

func (s *Sequencer) AddLoop(loop *Loop)

func (*Sequencer) Start

func (s *Sequencer) Start()

type Track

type Track struct {
	ID               int
	Name             string
	InstrumentPatchs []*InstrumentPatch
}

func NewTrack

func NewTrack(name string) *Track

func (*Track) AddInstrumentPatch

func (t *Track) AddInstrumentPatch(patch *InstrumentPatch)

func (*Track) Next

func (t *Track) Next(i int) float64

Jump to

Keyboard shortcuts

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