astconv

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASTClassifier

type ASTClassifier interface {
	// Classify AST type.
	Classify(v ast.Node) (ASTType, error)
}

type ASTConverter

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

func NewDegreeASTConverter

func NewDegreeASTConverter() *ASTConverter

func NewSyllableASTConverter

func NewSyllableASTConverter(scale *op.Scale) *ASTConverter

func (*ASTConverter) Convert

func (c *ASTConverter) Convert(v ast.ChordOrRest) (*input.Instance, error)

type ASTType

type ASTType int
const (
	UnknownASTType ASTType = iota
	SyllableAST
	DegreeAST
)

func (ASTType) String

func (i ASTType) String() string

type ASTTypeClassifier

type ASTTypeClassifier struct{}

func NewASTClassifier

func NewASTClassifier() *ASTTypeClassifier

func (ASTTypeClassifier) Classify

func (c ASTTypeClassifier) Classify(v ast.Node) (ASTType, error)

type ChordConverter

type ChordConverter interface {
	Convert(v *ast.Chord) (*input.Chord, error)
}

type Converter

type Converter interface {
	// Convert AST (from text) into Instance (yaml).
	Convert(v ast.ChordOrRest) (*input.Instance, error)
}

type DegreeChordConverter

type DegreeChordConverter struct{}

DegreeChordConverter converts AST contains only degrees.

func (DegreeChordConverter) Convert

func (c DegreeChordConverter) Convert(v *ast.Chord) (*input.Chord, error)

type MetaConverter

type MetaConverter interface {
	Convert(v *ast.ChordMeta) *op.Meta
}

type MetaConverterImpl

type MetaConverterImpl struct{}

func (MetaConverterImpl) Convert

func (MetaConverterImpl) Convert(v *ast.ChordMeta) *op.Meta

type MetaInstanceModifier

type MetaInstanceModifier interface {
	Modify(v *input.Instance, meta *op.Meta) error
}

type MetaInstanceModifierImpl

type MetaInstanceModifierImpl struct{}

func (MetaInstanceModifierImpl) Modify

func (m MetaInstanceModifierImpl) Modify(v *input.Instance, meta *op.Meta) error

type ScaleChangeable

type ScaleChangeable interface {
	ChangeScale(scale *op.Scale)
}

type SyllableChordConverter

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

SyllableChordConverter converts AST contains only syllables.

func NewSyllableChordConverter

func NewSyllableChordConverter(scale *op.Scale) *SyllableChordConverter

func (*SyllableChordConverter) ChangeScale

func (c *SyllableChordConverter) ChangeScale(scale *op.Scale)

func (SyllableChordConverter) Convert

func (c SyllableChordConverter) Convert(v *ast.Chord) (*input.Chord, error)

type ValuesConverter

type ValuesConverter interface {
	Convert(v *ast.ChordValues) ([]note.Value, error)
}

type ValuesConverterImpl

type ValuesConverterImpl struct{}

func (ValuesConverterImpl) Convert

func (c ValuesConverterImpl) Convert(v *ast.ChordValues) ([]note.Value, error)

Jump to

Keyboard shortcuts

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