Documentation
¶
Index ¶
- Constants
- func Format(input []byte) ([]byte, error)
- func FormatFile(filename string) error
- func ToSMF(input []byte) (*smf.SMF, error)
- func ToXML(w io.Writer, input []byte) error
- type Bar
- type Channel
- type EvalError
- type Event
- type Interpreter
- type LiveShell
- type ParseError
- type Player
- type Pos
- type SMF
- type Sequencer
- type TrackEvent
- type Voice
Constants ¶
View Source
const (
// EOT is keycode for Ctrl+D.
EOT = 4
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bar ¶
type Bar struct {
Events []Event
// contains filtered or unexported fields
}
Bar is a single bar of events.
func (*Bar) IsZeroDuration ¶
IsZeroDuration returns whether the bar consists of only zero duration events.
func (*Bar) SetTimeSig ¶ added in v0.8.5
SetTimeSig sets the timesig for testing.
type Channel ¶ added in v0.8.5
type Channel uint8
Channel is a MIDI channel.
func NewChannelFromHuman ¶ added in v0.8.5
func NewChannelFromMIDI ¶ added in v0.8.5
type Event ¶
type Event struct {
Note *ast.Note // only for note on messages and rests
Message smf.Message
IsFlat bool // if the midi note was lowered due to key sig
Pos uint32 // in relative ticks from beginning of bar
Duration uint32 // in ticks
Voice Voice
Track uint8 // track is the MIDI channel in human value
}
Event is a balafon event.
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
Interpreter evaluates text input and emits events.
func (*Interpreter) Eval ¶
func (it *Interpreter) Eval(input []byte) error
Eval evaluates the input.
func (*Interpreter) EvalFile ¶
func (it *Interpreter) EvalFile(filepath string) error
EvalFile evaluates a file.
func (*Interpreter) EvalString ¶
func (it *Interpreter) EvalString(input string) error
EvalString evaluates the string input.
func (*Interpreter) Flush ¶
func (it *Interpreter) Flush() []*Bar
Flush flushes the parsed bar queue and resets the interpreter.
type LiveShell ¶
type LiveShell struct {
// contains filtered or unexported fields
}
LiveShell is an unbuffered live shell.
func NewLiveShell ¶
NewLiveShell creates a new live shell.
func (*LiveShell) HandleNext ¶
HandleNext handles the next character from input.
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player is a MIDI player.
func (*Player) Play ¶
func (p *Player) Play(events ...TrackEvent) error
Play the events into the out port.
type Sequencer ¶
type Sequencer struct {
// contains filtered or unexported fields
}
Sequencer is a MIDI sequencer.
type TrackEvent ¶
TrackEvent is an SMF track event.
func (*TrackEvent) String ¶ added in v0.8.5
func (s *TrackEvent) String() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
balafon-web
|
|
|
src
command
|
|
|
cmd
|
|
|
balafon
command
|
|
|
tokentype/tokentypes-gen
command
|
Click to show internal directories.
Click to hide internal directories.