Documentation ¶
Index ¶
- Variables
- type ChordFilter
- type DetailedChord
- type DetailedChordQuality
- type DetailedKey
- type DetailedPitch
- type DetailedScale
- type Handler
- type KeyFilter
- type Repository
- type ScaleFilter
- type Service
- type SimplifiedChord
- type SimplifiedChordQuality
- type SimplifiedKey
- type SimplifiedPitch
- type SimplifiedScale
- type SliceInt
Constants ¶
This section is empty.
Variables ¶
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
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 ¶
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 ¶
SimplifiedKey is simplified key object
type SimplifiedPitch ¶
SimplifiedPitch is simplified pitch object
type SimplifiedScale ¶
SimplifiedScale is simplified scale object