hmt-0.20: Haskell Music Theory
Safe HaskellSafe-Inferred
LanguageHaskell2010

Music.Theory.Time.KeyKit

Description

A sequence structure, courtesy https://github.com/nosuchtim/keykit.

A note has a time, a duration and a value. A phrase is a time-ascending sequence of notes and a length. The length of a phrase is independent of the contents. The sequence operator, phrase_append, sums phrase lengths. The parallel operator, phrase_merge, selects the longer length.

Operations are ordinarily on phrases, notes are operated on indirectly. The phrase indexing operation, phrase_at returns a phrase of degree one.

Synopsis

Time

Note

data Note t Source #

Constructors

Note 

Instances

Instances details
Show t => Show (Note t) Source # 
Instance details

Defined in Music.Theory.Time.KeyKit

Methods

showsPrec :: Int -> Note t -> ShowS #

show :: Note t -> String #

showList :: [Note t] -> ShowS #

Eq t => Eq (Note t) Source # 
Instance details

Defined in Music.Theory.Time.KeyKit

Methods

(==) :: Note t -> Note t -> Bool #

(/=) :: Note t -> Note t -> Bool #

Ord t => Ord (Note t) Source # 
Instance details

Defined in Music.Theory.Time.KeyKit

Methods

compare :: Note t -> Note t -> Ordering #

(<) :: Note t -> Note t -> Bool #

(<=) :: Note t -> Note t -> Bool #

(>) :: Note t -> Note t -> Bool #

(>=) :: Note t -> Note t -> Bool #

max :: Note t -> Note t -> Note t #

min :: Note t -> Note t -> Note t #

Phrase

data Phrase t Source #

It is an un-checked invariant that the note list is in ascending order.

Constructors

Phrase 

Instances

Instances details
Show t => Show (Phrase t) Source # 
Instance details

Defined in Music.Theory.Time.KeyKit

Methods

showsPrec :: Int -> Phrase t -> ShowS #

show :: Phrase t -> String #

showList :: [Phrase t] -> ShowS #

Eq t => Eq (Phrase t) Source # 
Instance details

Defined in Music.Theory.Time.KeyKit

Methods

(==) :: Phrase t -> Phrase t -> Bool #

(/=) :: Phrase t -> Phrase t -> Bool #

Ord t => Ord (Phrase t) Source # 
Instance details

Defined in Music.Theory.Time.KeyKit

Methods

compare :: Phrase t -> Phrase t -> Ordering #

(<) :: Phrase t -> Phrase t -> Bool #

(<=) :: Phrase t -> Phrase t -> Bool #

(>) :: Phrase t -> Phrase t -> Bool #

(>=) :: Phrase t -> Phrase t -> Bool #

max :: Phrase t -> Phrase t -> Phrase t #

min :: Phrase t -> Phrase t -> Phrase t #

phrase_at :: Phrase t -> Int -> Phrase t Source #

Keykit sets the length to the duration, i.e. ('c,e,g'%2).length is 192.

phrase_at_put :: Ord t => Phrase t -> Int -> Phrase t -> Phrase t Source #

phrase_append :: Ord t => Phrase t -> Phrase t -> Phrase t Source #

KeyKits p+q

phrase_merge :: Ord t => Phrase t -> Phrase t -> Phrase t Source #

KeyKits p|q

Functor

note_map :: (t -> u) -> Note t -> Note u Source #

phrase_value_map :: (t -> u) -> Phrase t -> Phrase u Source #

phrase_note_map :: (Note t -> Note u) -> Phrase t -> Phrase u Source #

phrase_phrase_map :: Ord u => (Phrase t -> Phrase u) -> Phrase t -> Phrase u Source #

phrase_map :: Ord u => (Note t -> Phrase u) -> Phrase t -> Phrase u Source #

Seq