Documentation ¶
Index ¶
- func Must[T any](result T, err error) T
- func WalkNotes(node Node, props PropertyList, f func(*Note) error) error
- type Bar
- type BlockComment
- type CmdAssign
- type CmdChannel
- type CmdControl
- type CmdPlay
- type CmdProgram
- type CmdStart
- type CmdStop
- type CmdTempo
- type CmdTimeSig
- type CmdVelocity
- type Node
- type NodeList
- type Note
- type NoteGroup
- type PropertyList
- func (l PropertyList) IsLetRing() bool
- func (p PropertyList) Len() int
- func (p PropertyList) Less(i, j int) bool
- func (p PropertyList) Merge(list PropertyList) PropertyList
- func (l PropertyList) NoteLen() uint32
- func (l PropertyList) NumAccent() int
- func (l PropertyList) NumDot() int
- func (l PropertyList) NumFlat() int
- func (l PropertyList) NumGhost() int
- func (l PropertyList) NumMarcato() int
- func (l PropertyList) NumSharp() int
- func (l PropertyList) NumStaccato() int
- func (p PropertyList) Swap(i, j int)
- func (l PropertyList) Tuplet() int
- func (l PropertyList) Value() uint8
- func (p PropertyList) WriteTo(w io.Writer) (int64, error)
- type SourceFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockComment ¶ added in v0.8.4
type BlockComment struct {
Text string
}
BlockComment is a block comment.
func NewBlockComment ¶ added in v0.8.4
func NewBlockComment(text string) BlockComment
NewBlockComment creates a new block comment.
type CmdAssign ¶
CmdAssign is a note assignment command.
func NewCmdAssign ¶
NewCmdAssign creates a note assignment command.
type CmdChannel ¶
type CmdChannel struct {
Channel uint8
}
CmdChannel is a channel change command.
func NewCmdChannel ¶
func NewCmdChannel(value int64) (CmdChannel, error)
NewCmdChannel creates a channel change command.
type CmdControl ¶
CmdControl is a control change command.
func NewCmdControl ¶
func NewCmdControl(control, value int64) (CmdControl, error)
NewCmdControl creates a control change command.
type CmdProgram ¶
type CmdProgram struct {
Program uint8
}
CmdProgram is a program change command.
func NewCmdProgram ¶
func NewCmdProgram(value int64) (CmdProgram, error)
NewCmdProgram creates a program change command.
type CmdTempo ¶
type CmdTempo struct {
BPM uint16
}
CmdTempo is a tempo command.
func NewCmdTempo ¶
NewCmdTempo creates a tempo command.
type CmdTimeSig ¶
CmdTimeSig is a time signature change command.
func NewCmdTimeSig ¶
func NewCmdTimeSig(num, denom int64) (CmdTimeSig, error)
NewCmdTimeSig creates a time signature change command.
type CmdVelocity ¶
type CmdVelocity struct {
Velocity int
}
CmdVelocity is a velocity change command.
func NewCmdVelocity ¶
func NewCmdVelocity(value int64) (CmdVelocity, error)
NewCmdVelocity creates a velocity change command.
type Note ¶
type Note struct { Pos token.Pos Props PropertyList Name rune }
Note is a single note.
func NewNote ¶
func NewNote(pos token.Pos, name rune, propList PropertyList) *Note
NewNote creates a note with properties.
type NoteGroup ¶ added in v0.8.4
type NoteGroup struct { Nodes NodeList Props PropertyList }
NoteGroup is a group of notes with shared properties.
func NewNoteGroup ¶ added in v0.8.4
func NewNoteGroup(notes NodeList, props PropertyList) (NoteGroup, error)
NewNoteGroup creates a note group from a list of notes with shared properties.
type PropertyList ¶
PropertyList is a list of note properties.
func NewPropertyList ¶
func NewPropertyList(t *token.Token, inner interface{}) (PropertyList, error)
NewPropertyList creates a note property list.
func (PropertyList) IsLetRing ¶ added in v0.8.4
func (l PropertyList) IsLetRing() bool
IsLetRing reports whether the note must ring.
func (PropertyList) Len ¶
func (p PropertyList) Len() int
func (PropertyList) Less ¶
func (p PropertyList) Less(i, j int) bool
func (PropertyList) Merge ¶ added in v0.8.4
func (p PropertyList) Merge(list PropertyList) PropertyList
Merge merges list into a copy of p and returns the merged result. Unique properties are overwritten while additive properties are added.
func (PropertyList) NoteLen ¶ added in v0.8.4
func (l PropertyList) NoteLen() uint32
NoteLen returns the note duration in ticks.
func (PropertyList) NumAccent ¶ added in v0.8.4
func (l PropertyList) NumAccent() int
NumAccent reports the number of accent properties.
func (PropertyList) NumDot ¶ added in v0.8.4
func (l PropertyList) NumDot() int
NumDot reports the number of dot properties.
func (PropertyList) NumFlat ¶ added in v0.8.4
func (l PropertyList) NumFlat() int
NumFlat reports the number of flat signs.
func (PropertyList) NumGhost ¶ added in v0.8.4
func (l PropertyList) NumGhost() int
NumGhost reports the number of ghost properties.
func (PropertyList) NumMarcato ¶ added in v0.8.4
func (l PropertyList) NumMarcato() int
NumMarcato reports the number of marcato properties.
func (PropertyList) NumSharp ¶ added in v0.8.4
func (l PropertyList) NumSharp() int
NumSharp returns the number of sharp signs.
func (PropertyList) NumStaccato ¶ added in v0.8.4
func (l PropertyList) NumStaccato() int
NumStaccato reports the number of staccato properties.
func (PropertyList) Swap ¶
func (p PropertyList) Swap(i, j int)
func (PropertyList) Tuplet ¶ added in v0.8.4
func (l PropertyList) Tuplet() int
Tuplet returns the irregular division value if the note is a tuplet.
func (PropertyList) Value ¶ added in v0.8.4
func (l PropertyList) Value() uint8
Value returns the note value (1th, 2th, 4th, 8th, 16th, 32th and so on).
type SourceFile ¶
type SourceFile struct{}
func NewSourceFile ¶
func NewSourceFile(declList interface{}) SourceFile