sketch

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateReg = regexp.MustCompile(regexp.QuoteMeta("#") + "([0-9]+)")

Functions

func EventsFromSketchDef added in v1.0.2

func EventsFromSketchDef(name string, sketchDef [][2]string, sc Score, params []string) (evts []*items.Event, err error)

Types

type Score

type Score interface {
	GetSketch(sketch_table string) (*Sketch, error)
	GetIncludedSketch(filename, sketch_table string, params []string) (*Sketch, error)
	GetExternalSketch(filename, sketch_table string, params []string) (*Sketch, error)
	HasTrack(name string) bool
	GetTrack(track string) (*track.Track, error)
	GetToken(name string) (string, error)
	GetExternalToken(file string, token string) (string, error)
	Embed(patterns ...string) error
	GetMode(name string) items.Mode
	FilterTrack(colName string, events []*items.Event) []*items.Event
	Properties() map[string]interface{}
	Lyric(part string, fromLine, toLine int) (tokens []string, err error)
}

type Sketch

type Sketch struct {
	Name      string
	Bars      []*items.Bar
	Positions [][2]uint // bar+position
	Columns   map[string][]string
	Parts     map[string][2]uint // absolute positions
	Score     Score
	File      string

	RealColNum int // is in the file, i.e. a group column counts as 1
	GroupCols  map[int][]string
	// contains filtered or unexported fields
}

func New added in v1.0.4

func New(name string, sc Score) *Sketch

func SketchFromSketchDef added in v1.0.2

func SketchFromSketchDef(name string, sketchDef [][2]string, sc Score) (*Sketch, error)

func (*Sketch) AddColumn

func (p *Sketch) AddColumn(name string)

func (*Sketch) FirstColumn

func (s *Sketch) FirstColumn() (colName string)

func (*Sketch) ParseLine

func (p *Sketch) ParseLine(tabs []string) error

parseLine parses a line in the body (everything after the =)

func (*Sketch) SetGroupCol added in v1.0.30

func (s *Sketch) SetGroupCol(pos int, subcols []string)

func (*Sketch) SetRealColNum added in v1.0.30

func (s *Sketch) SetRealColNum(n int)

func (*Sketch) Unroll

func (s *Sketch) Unroll(_tr *track.Track, colName string, params ...string) ([]*items.Event, error)

func (*Sketch) UnrolledBars

func (s *Sketch) UnrolledBars() (unrolled []*items.Bar, err error)

Jump to

Keyboard shortcuts

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