sequencer

package
v2.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

type Bar struct {
	Number   uint
	TimeSig  [2]uint8
	Events   Events
	Key      *smf.Key // TODO a key change, if != nil
	AbsTicks int64
}

func (Bar) Len

func (b Bar) Len() uint8

func (*Bar) SortEvents added in v2.0.23

func (b *Bar) SortEvents()

type Bars

type Bars []*Bar

func (Bars) Len

func (b Bars) Len() int

func (Bars) Less

func (br Bars) Less(a, b int) bool

func (Bars) Renumber

func (br Bars) Renumber()

func (Bars) Swap

func (br Bars) Swap(a, b int)

type Event

type Event struct {
	TrackNo  int
	Pos      uint8       // in 32th
	Duration uint8       // in 32th for noteOn messages, it is the length of the note, for all other messages, it is 0
	Message  smf.Message // may only be channel messages or sysex messages. no noteon velocity 0, or noteoff messages, this is expressed via Duration
	// contains filtered or unexported fields
}

func (*Event) AbsTicks

func (e *Event) AbsTicks(b *Bar, ticks smf.MetricTicks) (start, end int64)

func (Event) Inspect added in v2.0.23

func (e Event) Inspect() string

type Events added in v2.0.23

type Events []*Event

func (Events) Len added in v2.0.23

func (e Events) Len() int

func (Events) Less added in v2.0.23

func (e Events) Less(a, b int) bool

warning: only works within a bar

func (Events) Swap added in v2.0.23

func (e Events) Swap(a, b int)

type Song

type Song struct {
	Title      string
	Composer   string
	TrackNames []string
	Ticks      smf.MetricTicks
	// contains filtered or unexported fields
}

func FromSMF

func FromSMF(sm smf.SMF) *Song

func New added in v2.0.23

func New() *Song

func (*Song) AddBar

func (s *Song) AddBar(b Bar)

func (*Song) Bars added in v2.0.23

func (s *Song) Bars() Bars

func (*Song) FindBar added in v2.0.23

func (s *Song) FindBar(absTicks int64) (found *Bar)

func (*Song) SetBarAbsTicks added in v2.0.23

func (s *Song) SetBarAbsTicks()

func (*Song) ToSMF0 added in v2.0.23

func (s *Song) ToSMF0() smf.SMF

func (Song) ToSMF1

func (s Song) ToSMF1() smf.SMF

Jump to

Keyboard shortcuts

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