theory

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrScaleNotFound        = errors.New("scale not found")
	ErrKeyNotFound          = errors.New("key not found")
	ErrChordNotFound        = errors.New("chord not found")
	ErrChordQualityNotFound = errors.New("chord quality not found")
	ErrPitchNotFound        = errors.New("pitch not found")
)

Error messages

Functions

This section is empty.

Types

type ChordFilter

type ChordFilter struct {
	ChordQualityID int64 `form:"chord_quality_id"`
	RootID         int64 `form:"root_id"`
	ZeitlerNumber  int   `form:"zeitler_number"`
	RingNumber     int   `form:"ring_number"`
	Cardinality    int   `form:"cardinality"`
}

ChordFilter represents chord filter

type DetailedChord

type DetailedChord struct {
	ID            int64                  `json:"id" db:"id"`
	Quality       SimplifiedChordQuality `json:"quality" db:"quality"`
	Root          SimplifiedPitch        `json:"root" db:"root"`
	Name          string                 `json:"name" db:"name"`
	ZeitlerNumber int                    `json:"zeitler_number" db:"zeitler_number"`
	RingNumber    int                    `json:"ring_number" db:"ring_number"`
}

DetailedChord is detailed chord object

type DetailedChordQuality

type DetailedChordQuality struct {
	ID              int64    `json:"id" db:"id"`
	Name            string   `json:"name" db:"name"`
	ZeitlerNumber   int      `json:"zeitler_number" db:"zeitler_number"`
	RingNumber      int      `json:"ring_number" db:"ring_number"`
	Cardinality     int      `json:"cardinality" db:"cardinality"`
	PitchClass      SliceInt `json:"pitch_class" db:"pitch_class"`
	IntervalPattern SliceInt `json:"interval_pattern" db:"interval_pattern"`
}

DetailedChordQuality is detailed chord quality object

type DetailedKey

type DetailedKey struct {
	ID            int             `json:"id" db:"id"`
	Scale         SimplifiedScale `json:"scale" db:"scale"`
	Tonic         SimplifiedPitch `json:"tonic" db:"tonic"`
	Name          string          `json:"name" db:"name"`
	ZeitlerNumber int             `json:"zeitler_number" db:"zeitler_number"`
	RingNumber    int             `json:"ring_number" db:"ring_number"`
	Balanced      bool            `json:"balanced" db:"balanced"`
	CenterX       float64         `json:"center_x" db:"center_x"`
	CenterY       float64         `json:"center_y" db:"center_y"`
}

DetailedKey is detailed key object

type DetailedPitch

type DetailedPitch struct {
	ID            int64   `json:"id" db:"id"`
	Name          string  `json:"name" db:"name"`
	ZeitlerNumber int     `json:"zeitler_number" db:"zeitler_number"`
	RingNumber    int     `json:"ring_number" db:"ring_number"`
	Frequency     float64 `json:"frequency" db:"frequency"`
}

DetailedPitch is detailed pitch object

type DetailedScale

type DetailedScale struct {
	ID                       int64    `json:"id" db:"id"`
	Name                     string   `json:"name" db:"name"`
	Cardinality              int      `json:"cardinality" db:"cardinality"`
	ZeitlerNumber            int      `json:"zeitler_number" db:"zeitler_number"`
	RingNumber               int      `json:"ring_number" db:"ring_number"`
	Perfection               int      `json:"perfection" db:"perfection"`
	Imperfection             int      `json:"imperfection" db:"imperfection"`
	PitchClass               SliceInt `json:"pitch_class" db:"pitch_class"`
	IntervalPattern          SliceInt `json:"interval_pattern" db:"interval_pattern"`
	RotationalSymmetric      bool     `json:"rotational_symmetric" db:"rotational_symmetric"`
	RotationalSymmetryLevel  int      `json:"rotational_symmetry_level" db:"rotational_symmetry_level"`
	Palindromic              bool     `json:"palindromic" db:"palindromic"`
	ReflectionalSymmetric    bool     `json:"reflectional_symmetric" db:"reflectional_symmetric"`
	ReflectionalSymmetryAxes SliceInt `json:"reflectional_symmetry_axes" db:"reflectional_symmetry_axes"`
	Balanced                 bool     `json:"balanced" db:"balanced"`
	FifthGeneratorRootDegree int      `json:"fifth_generator_root_degree" db:"fifth_generator_root_degree"`
}

DetailedScale is detailed scale object

type Handler

type Handler interface {
	InstallEndpoints(router *mux.Router)
	// contains filtered or unexported methods
}

Handler is theory handler

func NewHandler

func NewHandler(logger *zap.Logger, service Service) Handler

NewHandler instantiates theory handler

type KeyFilter

type KeyFilter struct {
	ScaleID                 int64 `form:"scale_id"`
	TonicID                 int64 `form:"tonic_id"`
	ZeitlerNumber           int   `form:"zeitler_number"`
	RingNumber              int   `form:"ring_number"`
	Perfection              *int  `form:"perfection"`
	Imperfection            *int  `form:"imperfection"`
	Balanced                *bool `form:"balanced"`
	RotationalSymmetric     *bool `form:"rotational_symmetric"`
	RotationalSymmetryLevel int   `form:"rotational_symmetry_level"`
	ReflectionalSymmetric   *bool `form:"reflectional_symmetric"`
	Palindromic             *bool `form:"palindromic"`
	Cardinality             int   `form:"cardinality"`
}

KeyFilter is key filter

type Repository

type Repository interface {
	// contains filtered or unexported methods
}

Repository is music theory data repository

func NewRepository

func NewRepository(logger *zap.Logger, db *sqlx.DB) Repository

NewRepository returns an implementation of music theory data repository

type ScaleFilter

type ScaleFilter struct {
	TonicID                 int64 `form:"tonic_id"`
	ZeitlerNumber           int   `form:"zeitler_number"`
	RingNumber              int   `form:"ring_number"`
	Perfection              *int  `form:"perfection"`
	Imperfection            *int  `form:"imperfection"`
	Balanced                *bool `form:"balanced"`
	RotationalSymmetric     *bool `form:"rotational_symmetric"`
	RotationalSymmetryLevel int   `form:"rotational_symmetry_level"`
	ReflectionalSymmetric   *bool `form:"reflectional_symmetric"`
	Palindromic             *bool `form:"palindromic"`
	Cardinality             int   `form:"cardinality"`
}

ScaleFilter is scale filter

type Service

type Service interface {
	// contains filtered or unexported methods
}

Service is music theory service

func NewService

func NewService(logger *zap.Logger, repository Repository) Service

NewService returns an implementation of music theory service

type SimplifiedChord

type SimplifiedChord struct {
	ID   int64  `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}

SimplifiedChord is simplified chord object

type SimplifiedChordQuality

type SimplifiedChordQuality struct {
	ID   int64  `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}

SimplifiedChordQuality is simplified chord quality object

type SimplifiedKey

type SimplifiedKey struct {
	ID   int64  `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}

SimplifiedKey is simplified key object

type SimplifiedPitch

type SimplifiedPitch struct {
	ID   int64  `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}

SimplifiedPitch is simplified pitch object

type SimplifiedScale

type SimplifiedScale struct {
	ID   int64  `json:"id" db:"id"`
	Name string `json:"name" db:"name"`
}

SimplifiedScale is simplified scale object

type SliceInt

type SliceInt []int

SliceInt implements array of int jsonb

func (*SliceInt) Scan

func (s *SliceInt) Scan(value interface{}) error

Scan scan JSONB array of int

Jump to

Keyboard shortcuts

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