items

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Aeolian = mode{
	// contains filtered or unexported fields
}
View Source
var DEBUG bool = false
View Source
var Dorian = mode{
	// contains filtered or unexported fields
}
View Source
var DottedLengths = map[string][2]uint32{

	":":   [2]uint32{1, 16},
	"::":  [2]uint32{1, 32},
	":::": [2]uint32{1, 64},
}
View Source
var End = end{}
View Source
var GlideExponential = GlideStart(true)
View Source
var GlideLinear = GlideStart(false)
View Source
var Hold = hold{}
View Source
var Ionian = mode{
	// contains filtered or unexported fields
}
View Source
var Locrian = mode{
	// contains filtered or unexported fields
}
View Source
var Lydian = mode{
	// contains filtered or unexported fields
}
View Source
var Major = mode{
	// contains filtered or unexported fields
}
View Source
var Minor = mode{
	// contains filtered or unexported fields
}
View Source
var Mixolydian = mode{
	// contains filtered or unexported fields
}
View Source
var Modes = map[string]Mode{
	"dorian":     Dorian,
	"phrygian":   Phrygian,
	"lydian":     Lydian,
	"mixolydian": Mixolydian,
	"aeolian":    Aeolian,
	"locrian":    Locrian,
	"ionian":     Ionian,
	"minor":      Minor,
	"major":      Major,
}
View Source
var Phrygian = mode{
	// contains filtered or unexported fields
}
View Source
var RepeatLastEvent = repeatLastEvent{}
View Source
var Rest = rest{}
View Source
var TemplateReg = regexp.MustCompile(regexp.QuoteMeta("#") + "([0-9]+)")

Functions

func AddDynamic added in v1.0.3

func AddDynamic(orig, dynAdd string) (nu string)

func CalcNoteDelay

func CalcNoteDelay(resolution smf.MetricTicks) (delay int32)

func CentsToPitchbend

func CentsToPitchbend(cents float64, _range uint8) int16

func DynamicToVelocity

func DynamicToVelocity(dyn string, min, max, randomness, step, center int8) (vel int8)

if returned vel is < 0, then it has not been set and is drived from the previous velocity always return such that rand.Intn(4) can be added or substracted

func ExponentialGlide

func ExponentialGlide(distance int64, noteDiff int64, callback func(pos uint, val float64))

func ExponentialTempoChange

func ExponentialTempoChange(distance int64, diff float64, callback func(step uint, val float64))

func FindEventThatIsNotRest added in v1.0.3

func FindEventThatIsNotRest(start int, evts []*Event) (found int)

func FindNextPos added in v1.0.3

func FindNextPos(i int, forward int, evts []*Event) int

findNextNotEmptyPos finds the next non empty position in evts and adds forward to it

func ForwardBars added in v1.0.4

func ForwardBars(bars []*Bar, diff uint)

func FreqRatioToCent

func FreqRatioToCent(num, denom uint8) float64

func GetQNNumberFromPos

func GetQNNumberFromPos(pos string) (qnnumber uint, rest string)

func HalfTonesToPitchbend

func HalfTonesToPitchbend(halftones float64, _range uint8) int16

func IsLoop added in v1.0.3

func IsLoop(it Item) int

func KeyToNote

func KeyToNote(key uint8) (letter, augmenter string, octave int)

func Length32ths

func Length32ths(num, denom uint8) uint

length returns the bar length in 32th

func LinearGlide

func LinearGlide(distance int64, noteDiff int64, callback func(step uint, val float64))

func LinearTempoChange

func LinearTempoChange(distance int64, diff float64, callback func(step uint, val float64))

func MultiHasNote added in v1.0.3

func MultiHasNote(me *MultiItem) bool

func NtupleHasNote added in v1.0.3

func NtupleHasNote(me *NTuple) bool

func Pos32thToString

func Pos32thToString(pos uint) string

func PositionTo32th

func PositionTo32th(lastBeatNo uint, pos string) (completed string, num32th uint, err error)

lastBeatNo is the number of the beat in the bar, starting with 1 if lastBeatNo = 0, then there is no lastBeatNo given

func PrintBars added in v1.0.4

func PrintBars(text string, bars ...*Bar)

func PrintEventStream added in v1.0.4

func PrintEventStream(message string, ess ...*EventStream)

func PrintEvents added in v1.0.4

func PrintEvents(message string, evts []*Event)

func ReplaceParams added in v1.0.3

func ReplaceParams(s string, params []string) string

func replaceParams(s string, params []interface{}) string {

func VelocityToDynamic

func VelocityToDynamic(vel uint8) (dyn string)

Types

type Bar added in v1.0.4

type Bar struct {
	TempoChange   float64
	TimeSigChange [2]uint8
	Position      uint // number of 32th from start of Piece

	No int
	// real time sig (inherited or changed)
	TimeSig           [2]uint8
	JumpTo            string
	Scale             *Scale
	Tilde             string
	Include           *Include
	Comment           string
	Part              string
	InnerTempoChanges map[uint]float64
	InnerScales       map[uint]*Scale
}

func GetBarsInPosRange added in v1.0.4

func GetBarsInPosRange(from, to uint, bars []*Bar) (res []*Bar)

func NewBar added in v1.0.4

func NewBar() *Bar

func (*Bar) Dup added in v1.0.4

func (b *Bar) Dup() (nuB *Bar)

func (*Bar) Length32th added in v1.0.4

func (b *Bar) Length32th() uint

func (Bar) Mount added in v1.0.4

func (b Bar) Mount(pos uint) *Bar

func (*Bar) String added in v1.0.4

func (b *Bar) String() string

type BarRepeater

type BarRepeater struct {
	LastN    int
	OnlyOnce bool
}

func (BarRepeater) Dup

func (b BarRepeater) Dup() Item

func (*BarRepeater) NewUnrollGetter added in v1.0.4

func (b *BarRepeater) NewUnrollGetter(evts []*Event, nextEv *Event) UnrollGetter

func (*BarRepeater) Parse

func (b *BarRepeater) Parse(data string, posIn32th uint) (err error)

func (BarRepeater) String

func (b BarRepeater) String() string

type BarRepeaterES added in v1.0.4

type BarRepeaterES struct {
	Item   *BarRepeater
	Evts   []*Event
	NextEv *Event
}

func (*BarRepeaterES) GetES added in v1.0.4

func (p *BarRepeaterES) GetES(c Columner, ev *Event, start, endPos uint) (x []*EventStream, err error)

type Columner added in v1.0.4

type Columner interface {
	Call(until uint, syncFirst bool, params ...string) (evts []*Event, absoluteEnd uint, err error)
	//IsSyncFirst() bool
	EndPosition() uint
	UnrollPattern(start uint, until uint, cc *Pattern) (evt []*Event, diff uint, end uint, err error)
	ModifyToken(tk *Token) (Item, error)
	ApplyLyricsTable(lt *LyricsTable, evts []*Event) ([]*Event, error)
	ParseEvents(syncfirst bool, data []string) (es *EventStream, err error)
	GetToken(origName string, params []string) (val string, err error)

	GetBarIdxOf(pos uint) int
	GetPart(partname string) (part [2]uint, has bool)
	GetBar(idx int) *Bar
	GetEventsInBars(start, end int, evts []*Event) []*Event
	UnrollAndMerge(es *EventStream, params []string) (mix *EventStream, err error)
	RepeatBars(repevts []*Event, diff uint) (evts []*Event, absend uint)
}

type Command added in v1.0.3

type Command struct {
	Name   string
	Params []string
	// contains filtered or unexported fields
}

func (Command) Dup added in v1.0.3

func (c Command) Dup() Item

func (Command) GetInclude added in v1.0.3

func (c Command) GetInclude() (inc Include)

func (Command) IsInclude added in v1.0.3

func (c Command) IsInclude() bool

func (*Command) Parse added in v1.0.3

func (p *Command) Parse(data string, posIn32th uint) error

func (Command) String added in v1.0.3

func (c Command) String() string

type DefaultES added in v1.0.4

type DefaultES struct{}

func (DefaultES) GetES added in v1.0.4

func (c DefaultES) GetES(p Columner, ev *Event, start, endPos uint) (mixed []*EventStream, err error)

type EuclideanRhythm

type EuclideanRhythm struct {
	StartPos32th uint
	Notes        int
	Positions    int
	Duration32th int
	Sketch       [][2]string
	LastPos      uint
}

func (*EuclideanRhythm) Parse

func (e *EuclideanRhythm) Parse(startPos32th uint, params ...string) error

type Event

type Event struct {
	Item     Item
	Position uint
	PosShift int // 0 = no, +n = laidback by n 64th, -n = ahead of time by n 64th
}

func ApplyLyrics added in v1.0.3

func ApplyLyrics(events []*Event, lyrics []string) (applied []*Event)

applyLyrics applies the lyrics to the items of the pattern

func ForwardEvents added in v1.0.3

func ForwardEvents(ins []*Event, diff uint) (outs []*Event)

func GetEventsInPosRange added in v1.0.3

func GetEventsInPosRange(from, to uint, evts []*Event) (res []*Event)

func MoveBySyncFirst added in v1.0.3

func MoveBySyncFirst(ins []*Event) (out []*Event)

func RollTheDice added in v1.0.3

func RollTheDice(events []*Event) []*Event

func SliceEvents added in v1.0.3

func SliceEvents(slice [2]int, all []*Event, projectedBarEnd uint) (evs []*Event, absoluteEnd uint)

sliceEvents slices the events according to the template call slice definition

func (*Event) AbsPosTicks

func (e *Event) AbsPosTicks(ticks4th uint32, trackDelay int) uint

AbsPosTicks returns the absolute Position in ticks

func (*Event) Dup

func (e *Event) Dup() *Event

func (*Event) Parse

func (e *Event) Parse(data string) error

func (*Event) String

func (e *Event) String() string

type EventSequence added in v1.0.2

type EventSequence []*Event

func (EventSequence) Call added in v1.0.2

func (s EventSequence) Call(mod *eventSequenceModifier) EventSequence

func (EventSequence) ChangeDynamic added in v1.0.2

func (s EventSequence) ChangeDynamic(mod *eventSequenceModifier) (evs EventSequence)

func (EventSequence) DiatonicTranspose added in v1.0.2

func (s EventSequence) DiatonicTranspose(steps int8) EventSequence

func (EventSequence) Len added in v1.0.2

func (s EventSequence) Len() int

func (EventSequence) Less added in v1.0.2

func (s EventSequence) Less(a, b int) bool

func (EventSequence) MircoTimingShift added in v1.0.2

func (s EventSequence) MircoTimingShift(shift int8) EventSequence

func (EventSequence) Override added in v1.0.2

func (s EventSequence) Override(over EventSequence) EventSequence

func (EventSequence) Slice added in v1.0.2

func (s EventSequence) Slice(mod *eventSequenceModifier) (evs EventSequence)

func (EventSequence) StartSync added in v1.0.2

func (s EventSequence) StartSync(position int64) EventSequence

func (EventSequence) Swap added in v1.0.2

func (s EventSequence) Swap(a, b int)

func (EventSequence) Transpose added in v1.0.2

func (s EventSequence) Transpose(halftones int8) EventSequence

func (EventSequence) TransposeOctave added in v1.0.2

func (s EventSequence) TransposeOctave(octave int8) EventSequence

type EventSequenceGetter added in v1.0.2

type EventSequenceGetter struct {
	Original string
	// contains filtered or unexported fields
}

func (EventSequenceGetter) Dup added in v1.0.2

func (e EventSequenceGetter) Dup() Item

func (*EventSequenceGetter) Get added in v1.0.2

func (*EventSequenceGetter) Parse added in v1.0.2

func (e *EventSequenceGetter) Parse(data string, posIn32th uint) error

func (*EventSequenceGetter) String added in v1.0.2

func (e *EventSequenceGetter) String() string

type EventSequenceItem added in v1.0.2

type EventSequenceItem struct {
	EventSequence EventSequence
	Original      string
}

func (EventSequenceItem) Dup added in v1.0.2

func (e EventSequenceItem) Dup() Item

func (*EventSequenceItem) Parse added in v1.0.2

func (e *EventSequenceItem) Parse(data string, posIn32th uint) error

func (*EventSequenceItem) String added in v1.0.2

func (e *EventSequenceItem) String() string

type EventSequenceMiddleWare added in v1.0.2

type EventSequenceMiddleWare []func(in EventSequence) EventSequence

func (EventSequenceMiddleWare) Get added in v1.0.2

func (mw EventSequenceMiddleWare) Get() (es EventSequence)

first function must retrieve the eventsequence (receives nil)

type EventSequencer added in v1.0.2

type EventSequencer interface {
	Get() EventSequence
}

type EventSequencerFunc added in v1.0.2

type EventSequencerFunc func() EventSequence

func (EventSequencerFunc) Get added in v1.0.2

type EventStream added in v1.0.3

type EventStream struct {
	Start      uint     // start position of the sketch column
	Events     []*Event // the events (each character is an event)
	IsOverride bool     // simulates wether the sketch column call is an override
	IsTemplate bool
	End        uint
	Repeat     uint
}

eventStream simulates a column of events

func MergeEventStreams added in v1.0.3

func MergeEventStreams(mixed []*EventStream, endPos uint) (es *EventStream)

func NewEventStream added in v1.0.3

func NewEventStream(syncFirst bool, start, end uint, isTemplate bool, events ...*Event) *EventStream

func NewEventStreamOverride added in v1.0.3

func NewEventStreamOverride(syncFirst bool, start, end uint, isTemplate bool, events ...*Event) *EventStream

func PipedEventStream added in v1.0.4

func PipedEventStream(p Columner, start uint, endPos uint, evts []*Event) (*EventStream, error)

func (*EventStream) GetEvents added in v1.0.4

func (c *EventStream) GetEvents(placementPos uint) (res []*Event)

func (*EventStream) Length32ths added in v1.0.4

func (c *EventStream) Length32ths() uint

func (*EventStream) Normalize added in v1.0.4

func (c *EventStream) Normalize()

func (*EventStream) SetEnd added in v1.0.4

func (c *EventStream) SetEnd(end uint)

SetEndToEndEvent sets the PosEnd to the first End item and returns the position. If there is no End item, 0 is returned

func (*EventStream) SetStart added in v1.0.4

func (c *EventStream) SetStart(syncFirst bool, start uint)

func (*EventStream) String added in v1.0.3

func (p *EventStream) String() string

type GlideStart

type GlideStart bool

func (GlideStart) Dup

func (g GlideStart) Dup() Item

func (*GlideStart) Parse

func (g *GlideStart) Parse(data string, posIn32th uint) error

func (GlideStart) String

func (g GlideStart) String() string

type Include

type Include struct {
	File        string
	Sketch      string
	Params      []string
	Position    uint
	Length32ths uint
}

func (Include) Dup

func (i Include) Dup() Item

func (Include) Parse

func (i Include) Parse(data string, posIn32th uint) error

func (Include) String

func (i Include) String() string

type Item

type Item interface {
	String() string
	Parse(data string, posIn32th uint) error
	Dup() Item
}

func Parse added in v1.0.3

func Parse(data string, posIn32th uint) (it Item, err error)

Parse is the major entry point for parsing an Item

func RollTheDiceForAnItem added in v1.0.3

func RollTheDiceForAnItem(it Item) Item

type ItemGroup added in v1.0.2

type ItemGroup []*Item

func (ItemGroup) Call added in v1.0.2

func (s ItemGroup) Call(params Params) ItemGroup

func (ItemGroup) ChangeDynamic added in v1.0.2

func (s ItemGroup) ChangeDynamic(diff int8) ItemGroup

func (ItemGroup) DiatonicTranspose added in v1.0.2

func (s ItemGroup) DiatonicTranspose(steps int8) ItemGroup

func (ItemGroup) MircoTimingShift added in v1.0.2

func (s ItemGroup) MircoTimingShift(shift int8) ItemGroup

func (ItemGroup) Slice added in v1.0.2

func (s ItemGroup) Slice(from, to int) ItemGroup

func (ItemGroup) ToParams added in v1.0.2

func (s ItemGroup) ToParams() Params

func (ItemGroup) Transpose added in v1.0.2

func (s ItemGroup) Transpose(halftones int8) ItemGroup

func (ItemGroup) TransposeOctave added in v1.0.2

func (s ItemGroup) TransposeOctave(octave int8) ItemGroup

type ItemGroupMiddleWare added in v1.0.2

type ItemGroupMiddleWare []func(in ItemGroup) ItemGroup

func (ItemGroupMiddleWare) Get added in v1.0.2

func (mw ItemGroupMiddleWare) Get() (es ItemGroup)

first function must retrieve the ItemGroup (receives nil)

type ItemGrouper added in v1.0.2

type ItemGrouper interface {
	Get() ItemGroup
}

type ItemGrouperFunc added in v1.0.2

type ItemGrouperFunc func() ItemGroup

func (ItemGrouperFunc) Get added in v1.0.2

func (e ItemGrouperFunc) Get() ItemGroup

type Lyric

type Lyric struct {
	Text string
}

func (*Lyric) Dup

func (l *Lyric) Dup() Item

func (*Lyric) Parse

func (l *Lyric) Parse(data string, posIn32th uint) (err error)

func (*Lyric) String

func (l *Lyric) String() string

type LyricsTable added in v1.0.2

type LyricsTable struct {
	Name   string
	Params []string
	Slice  [2]int
	Repeat uint
}

func (*LyricsTable) ApplyLyrics added in v1.0.4

func (c *LyricsTable) ApplyLyrics(column lyricser, evts []*Event) ([]*Event, error)

func (*LyricsTable) Dup added in v1.0.2

func (c *LyricsTable) Dup() Item

func (*LyricsTable) Parse added in v1.0.2

func (p *LyricsTable) Parse(call string, positionIn32th uint) error

func (*LyricsTable) String added in v1.0.2

func (p *LyricsTable) String() string

type MIDIAftertouch

type MIDIAftertouch struct {
	Value  uint8
	Dotted string
	Tilde  string
}

func (MIDIAftertouch) Dup

func (m MIDIAftertouch) Dup() Item

func (*MIDIAftertouch) Parse

func (at *MIDIAftertouch) Parse(data string, posIn32th uint) (err error)

func (MIDIAftertouch) String

func (m MIDIAftertouch) String() string

type MIDICC

type MIDICC struct {
	Controller uint8
	Value      uint8
	Dotted     string
	Tilde      string
}

func (MIDICC) Dup

func (m MIDICC) Dup() Item

func (*MIDICC) Parse

func (cc *MIDICC) Parse(data string, posIn32th uint) (err error)

func (MIDICC) String

func (m MIDICC) String() string

type MIDINote

type MIDINote struct {
	Note     int8
	Dynamic  string
	Dotted   string
	PosShift int // 0 = no, 1 = laidback, -1 = ahead of time
	NoteOn   bool
	NoteOff  bool
}

func (MIDINote) Dup

func (mn MIDINote) Dup() Item

func (*MIDINote) Parse

func (nt *MIDINote) Parse(data string, posIn32th uint) (err error)

func (*MIDINote) SetDynamic added in v1.0.3

func (nt *MIDINote) SetDynamic(dyn string)

func (MIDINote) String

func (m MIDINote) String() string

type MIDIPitchbend

type MIDIPitchbend struct {
	Value  int16
	Dotted string
	Tilde  string
}

func (MIDIPitchbend) Dup

func (m MIDIPitchbend) Dup() Item

func (*MIDIPitchbend) Parse

func (pb *MIDIPitchbend) Parse(data string, posIn32th uint) (err error)

func (MIDIPitchbend) String

func (m MIDIPitchbend) String() string

type MIDIPolyAftertouch

type MIDIPolyAftertouch struct {
	Key    uint8
	Value  uint8
	Dotted string
	Tilde  string
}

func (MIDIPolyAftertouch) Dup

func (m MIDIPolyAftertouch) Dup() Item

func (*MIDIPolyAftertouch) Parse

func (pt *MIDIPolyAftertouch) Parse(data string, posIn32th uint) (err error)

func (MIDIPolyAftertouch) String

func (m MIDIPolyAftertouch) String() string

type MIDIProgramChange

type MIDIProgramChange struct {
	Value uint8
}

func (MIDIProgramChange) Dup

func (m MIDIProgramChange) Dup() Item

func (*MIDIProgramChange) Parse

func (at *MIDIProgramChange) Parse(data string, posIn32th uint) (err error)

func (MIDIProgramChange) String

func (m MIDIProgramChange) String() string

type Mode

type Mode interface {
	Name() string
	NoteToStep(basenote, note uint8) (step int8)
	StepToNote(basenote uint8, step int8) (note uint8)
	All(basenote uint8) (notes []uint8)
}

type MultiItem

type MultiItem struct {
	Events []*Event
	// contains filtered or unexported fields
}

func (MultiItem) Dup

func (m MultiItem) Dup() Item

func (*MultiItem) GetES added in v1.0.4

func (p *MultiItem) GetES(c Columner, ev *Event, start, endPos uint) (x []*EventStream, err error)

func (MultiItem) IsHold

func (m MultiItem) IsHold() bool

func (*MultiItem) Parse

func (m *MultiItem) Parse(data string, posIn32th uint) (err error)

func (*MultiItem) Reset added in v1.0.3

func (i *MultiItem) Reset()

func (*MultiItem) SetDynamic added in v1.0.3

func (m *MultiItem) SetDynamic(dyn string)

func (MultiItem) String

func (m MultiItem) String() string

type NTuple

type NTuple struct {
	Events      []*Event
	LengthTicks uint
}

func ReplaceNtupleTokens added in v1.0.4

func ReplaceNtupleTokens(c Columner, in *NTuple) (out *NTuple, err error)

func (NTuple) Dup

func (m NTuple) Dup() Item

func (*NTuple) GetES added in v1.0.4

func (p *NTuple) GetES(c Columner, ev *Event, start, endPos uint) ([]*EventStream, error)

func (*NTuple) Parse

func (ntp *NTuple) Parse(data string, posIn32th uint) (err error)

ntuple has the form {c,e,d}>

func (*NTuple) SetDynamic added in v1.0.3

func (ntp *NTuple) SetDynamic(dyn string)

func (NTuple) String

func (m NTuple) String() string

type Note

type Note struct {
	Letter         string
	Octave         int
	Augmenter      string
	Dynamic        string
	GlissandoStart bool
	GlissandoExp   bool
	Dotted         string
	IsScaleNote    bool
	ScaleNote      int8
	PosShift       int // 0 = no, 1 = laidback, -1 = ahead of time
	NoteOn         bool
	NoteOff        bool
}

func ParseNote

func ParseNote(data string) (nt Note, err error)

func (Note) Dup

func (n Note) Dup() Item

func (*Note) Parse

func (nt *Note) Parse(data string, posIn32th uint) (err error)

func (*Note) SetDynamic added in v1.0.3

func (nt *Note) SetDynamic(dyn string)

func (Note) String

func (n Note) String() string

func (Note) ToMIDI

func (note Note) ToMIDI() (midinote_ uint8)

type OSCMessage

type OSCMessage struct {
	Path string
	Args []interface{}
}

func (OSCMessage) Dup

func (m OSCMessage) Dup() Item

func (*OSCMessage) Parse

func (*OSCMessage) Parse(data string, posIn32th uint) (err error)

func (OSCMessage) String

func (m OSCMessage) String() string

type Override

type Override struct {
	Item
}

func (*Override) Dup

func (o *Override) Dup() Item

func (*Override) GetES added in v1.0.4

func (c *Override) GetES(p Columner, ev *Event, start, endPos uint) (mixed []*EventStream, err error)

func (*Override) Parse added in v1.0.3

func (o *Override) Parse(data string, posIn32th uint) error

type Params added in v1.0.2

type Params []interface{}

type PartRepeat

type PartRepeat struct {
	Part      string
	Repeat    uint
	SyncFirst bool
}

func (*PartRepeat) Dup

func (pr *PartRepeat) Dup() Item

func (*PartRepeat) NewUnrollGetter added in v1.0.4

func (pr *PartRepeat) NewUnrollGetter(evts []*Event) UnrollGetter

func (*PartRepeat) Parse

func (pr *PartRepeat) Parse(data string, posIn32th uint) (err error)

func (*PartRepeat) String

func (pr *PartRepeat) String() string

type PartRepeatES added in v1.0.4

type PartRepeatES struct {
	Item *PartRepeat
	Evts []*Event
}

func (*PartRepeatES) GetES added in v1.0.4

func (c *PartRepeatES) GetES(p Columner, ev *Event, start, endPos uint) (mixed []*EventStream, err error)

type Pattern added in v1.0.2

type Pattern struct {
	Name      string
	Params    []string
	Slice     [2]int
	SyncFirst bool

	DynamicAdd           string
	ScaleMove            int8 // 0: force to scale (take next note in scale if not exact matching, no movement for in scale notes), n >0 || n < 0: move by n steps along the scale
	ScaleMoveMode        int8 // 0: no scale movement, 1: move only scale notes, 2: move only scale notes or non scale notes depending on the first item
	FirstNoteIsScaleNote int  // 0: not set, 1: true, 2: false
	FirstNoteAbsKey      uint8

	PosShift int // 0 = no, 1 = laidback, -1 = ahead of time
	Repeat   uint
	Lyrics   *LyricsTable
	Exploded bool // e.g. when token is (a b c) then =patt(token...) becomes =patt(a,b,c)
	// contains filtered or unexported fields
}

func (*Pattern) AddDynamic added in v1.0.2

func (p *Pattern) AddDynamic(orig string) (nu string)

func (*Pattern) Dup added in v1.0.2

func (c *Pattern) Dup() Item

func (*Pattern) GetES added in v1.0.4

func (c *Pattern) GetES(p Columner, ev *Event, start, endPos uint) (mixed []*EventStream, err error)

func (*Pattern) GetEventStream added in v1.0.4

func (p *Pattern) GetEventStream(column Columner, start, end uint) (*EventStream, error)

func (*Pattern) GetOverrideEventStream added in v1.0.4

func (p *Pattern) GetOverrideEventStream(column Columner, start, end uint) (*EventStream, error)

func (*Pattern) Parse added in v1.0.2

func (p *Pattern) Parse(call string, positionIn32th uint) (err error)

func (*Pattern) String added in v1.0.2

func (p *Pattern) String() string

func (*Pattern) Unroll added in v1.0.4

func (p *Pattern) Unroll(column Columner, start, until uint) (evt []*Event, end uint, err error)

type PipedPatternCommands

type PipedPatternCommands struct {
	Cmds []*Command
}

func (*PipedPatternCommands) Dup

func (p *PipedPatternCommands) Dup() Item

func (*PipedPatternCommands) Parse

func (p *PipedPatternCommands) Parse(data string, pos uint) error

func (*PipedPatternCommands) String

func (p *PipedPatternCommands) String() string

type Placeholder

type Placeholder int

func (Placeholder) Dup

func (v Placeholder) Dup() Item

func (*Placeholder) Parse

func (l *Placeholder) Parse(data string, posIn32th uint) (err error)

func (Placeholder) String

func (l Placeholder) String() string

type Rabbit

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

func (*Rabbit) Parse

func (e *Rabbit) Parse(startPos32th uint, params ...string) (err error)

params: 1. note 2. factor 3. percent 4. number of notes

func (*Rabbit) Strings

func (r *Rabbit) Strings() (s []string)

type RandomChooser

type RandomChooser struct {
	Alternatives             []Item
	AlternativesOriginalData []string
	Chosen                   int
}

func (RandomChooser) Dup

func (r RandomChooser) Dup() Item

func (*RandomChooser) Parse

func (r *RandomChooser) Parse(data string, posIn32th uint) (err error)

func (RandomChooser) String

func (r RandomChooser) String() string

type RandomProbability

type RandomProbability struct {
	Prob             uint8
	Item             Item
	Chosen           bool
	ItemOriginalData string
}

func (RandomProbability) Dup

func (r RandomProbability) Dup() Item

func (*RandomProbability) Parse

func (rp *RandomProbability) Parse(data string, posIn32th uint) (err error)

func (RandomProbability) String

func (r RandomProbability) String() string

type Scale

type Scale struct {
	Mode
	BaseNote uint8
	Name     string
	// contains filtered or unexported fields
}

func (*Scale) All

func (s *Scale) All() []uint8

func (*Scale) Dup

func (s *Scale) Dup() Item

func (Scale) NoteToStep

func (s Scale) NoteToStep(note uint8) int8

func (*Scale) Parse

func (s *Scale) Parse(data string, pos uint) error

func (*Scale) Reset added in v1.0.3

func (i *Scale) Reset()

func (Scale) StepToNote

func (s Scale) StepToNote(step int8) uint8

func (*Scale) String

func (s *Scale) String() string

type ScaleDefinition

type ScaleDefinition struct {
	Original string
	// contains filtered or unexported fields
}

func (*ScaleDefinition) All

func (s *ScaleDefinition) All(basenote uint8) (notes []uint8)

func (*ScaleDefinition) Name

func (s *ScaleDefinition) Name() string

func (*ScaleDefinition) NoteToStep

func (s *ScaleDefinition) NoteToStep(basenote, note uint8) (step int8)

func (*ScaleDefinition) Parse

func (t *ScaleDefinition) Parse(name string, def string) error

func (*ScaleDefinition) StepToNote

func (s *ScaleDefinition) StepToNote(basenote uint8, step int8) (note uint8)

type Token added in v1.0.2

type Token struct {
	Name string
	// contains filtered or unexported fields
}

func (Token) Dup added in v1.0.2

func (t Token) Dup() Item

func (*Token) GetES added in v1.0.4

func (c *Token) GetES(p Columner, ev *Event, start, endPos uint) (mixed []*EventStream, err error)

func (*Token) GetEventStream added in v1.0.4

func (t *Token) GetEventStream(column Columner, start, until uint) (*EventStream, error)

func (*Token) GetOverrideEventStream added in v1.0.4

func (t *Token) GetOverrideEventStream(column Columner, start, until uint) (*EventStream, error)

func (*Token) Parse added in v1.0.2

func (t *Token) Parse(data string, positionIn32th uint) (err error)

func (*Token) Reset added in v1.0.3

func (i *Token) Reset()

func (*Token) String added in v1.0.2

func (t *Token) String() string

type Tuning

type Tuning interface {
	Pitchbend(midinote uint8, _range uint8) int16
}

func ParseTuning

func ParseTuning(data string) (Tuning, error)

type TuningCents

type TuningCents struct {
	Name     string
	Original string
	// contains filtered or unexported fields
}

func (*TuningCents) CentsFor

func (m *TuningCents) CentsFor(midinote uint8) float64

func (*TuningCents) Parse

func (t *TuningCents) Parse(name, def string) error

func (*TuningCents) Pitchbend

func (t *TuningCents) Pitchbend(midinote uint8, _range uint8) int16

type TuningRatio

type TuningRatio struct {
	Name     string
	Original string
	// contains filtered or unexported fields
}

func (*TuningRatio) Parse

func (t *TuningRatio) Parse(name, baseFreq, def string) (err error)

func (*TuningRatio) Pitchbend

func (t *TuningRatio) Pitchbend(midinote uint8, _range uint8) int16

func (*TuningRatio) RatioFor

func (m *TuningRatio) RatioFor(midinote uint8) [2]uint8

type UnrollGetter added in v1.0.4

type UnrollGetter interface {
	GetES(c Columner, ev *Event, startPos, endPos uint) ([]*EventStream, error)
}

Jump to

Keyboard shortcuts

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