mirror of
https://github.com/vsariola/sointu.git
synced 2025-09-26 23:25:39 -04:00
feat: midi note input for the tracker
This commit is contained in:
@ -78,9 +78,10 @@ type (
|
||||
synther sointu.Synther // the synther used to create new synths
|
||||
|
||||
PlayerMessages chan PlayerMsg
|
||||
modelMessages chan<- interface{}
|
||||
ModelMessages chan<- interface{}
|
||||
|
||||
MIDI MIDIContext
|
||||
MIDI MIDIContext
|
||||
trackMidiIn bool
|
||||
}
|
||||
|
||||
// Cursor identifies a row and a track in a song score.
|
||||
@ -130,6 +131,7 @@ type (
|
||||
MIDIContext interface {
|
||||
InputDevices(yield func(MIDIDevice) bool)
|
||||
Close()
|
||||
HasDeviceOpen() bool
|
||||
}
|
||||
|
||||
MIDIDevice interface {
|
||||
@ -183,9 +185,10 @@ func NewModelPlayer(synther sointu.Synther, midiContext MIDIContext, recoveryFil
|
||||
m := new(Model)
|
||||
m.synther = synther
|
||||
m.MIDI = midiContext
|
||||
m.trackMidiIn = midiContext.HasDeviceOpen()
|
||||
modelMessages := make(chan interface{}, 1024)
|
||||
playerMessages := make(chan PlayerMsg, 1024)
|
||||
m.modelMessages = modelMessages
|
||||
m.ModelMessages = modelMessages
|
||||
m.PlayerMessages = playerMessages
|
||||
m.d.Octave = 4
|
||||
m.linkInstrTrack = true
|
||||
@ -421,7 +424,7 @@ func (m *Model) resetSong() {
|
||||
|
||||
// send sends a message to the player
|
||||
func (m *Model) send(message interface{}) {
|
||||
m.modelMessages <- message
|
||||
m.ModelMessages <- message
|
||||
}
|
||||
|
||||
func (m *Model) maxID() int {
|
||||
|
Reference in New Issue
Block a user