Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Note p d = Note {}
- pitch :: forall p d p. Lens (Note p d) (Note p d) p p
- dur :: forall p d d. Lens (Note p d) (Note p d) d d
- class HasNote s p d | s -> p d where
- toPair :: Iso' (Note p d) (p, d)
- (|:) :: p -> d -> Note p d
- data Mono p
- maybeMono :: Iso' (Maybe a) (Mono a)
- mono :: HasNote n (Mono p) d => p -> d -> n
- mono' :: p -> d -> Note (Mono p) d
- mPitch :: forall p p. Traversal (Mono p) (Mono p) p p
- unMono :: b -> (a -> b) -> Mono a -> b
- catMonos :: Foldable f => f (Mono a) -> [a]
- _M :: forall p p. Prism (Mono p) (Mono p) p p
- rest :: (HasNote n p d, Monoid p) => d -> n
- isRest :: (Monoid p, Eq p, HasNote n p d) => n -> Bool
- data Spelling
- fromChroma :: Integral a => a -> Spelling
- toChroma :: Integral a => Spelling -> a
- spelling :: Integral a => Iso' a Spelling
- data PitchRep = PitchRep {}
- prPitch :: Lens' PitchRep Spelling
- prOctave :: Lens' PitchRep Int
- (@:) :: Spelling -> Int -> PitchRep
- pitchRep :: Integral a => Iso' a PitchRep
- sumDurs :: (Num d, HasNote a p d, Traversable t) => t a -> d
- mapTime :: (Num d, Ord d, HasNote a p d, Traversable t) => t a -> [(d, a)]
- tied :: (Eq p, Num d, HasNote a p d, Traversable t, Traversable u, Snoc (u a) (u a) a a, Monoid (u a)) => t a -> u a
- tied' :: (Eq p, Num d, HasNote a p d, Traversable t) => t a -> [a]
- legato :: (Eq p, Monoid p, Num d, HasNote a p d, Traversable t, Traversable u, Snoc (u a) (u a) a a, Monoid (u a)) => t a -> u a
- legato' :: (Eq p, Monoid p, Num d, HasNote a p d, Traversable t) => t a -> [a]
- merge :: (Num d, HasNote a p d, Traversable t, Traversable u, Snoc (u a) (u a) a a, Monoid (u a)) => (a -> a -> Bool) -> t a -> u a
- transpose :: (Num p, HasNote a p d, Traversable t) => p -> t a -> t a
- transpose' :: (Num p, Functor f, HasNote a (f p) d, Traversable t) => p -> t a -> t a
- (%) :: Integral a => a -> a -> Ratio a
Documentation
Note = pitch and duration.
Instances
Bifunctor Note Source # | |
(Integral p, Integral d, Traversable t) => MidiNotes (t (Note p d)) Source # | |
Defined in Fadno.Midi | |
(Integral p, Traversable c, Integral d, Traversable t) => MidiNotes (t (Note (c p) d)) Source # | |
Defined in Fadno.Midi | |
(Eq p, Eq d) => Eq (Note p d) Source # | |
(Show p, Show d) => Show (Note p d) Source # | |
Generic (Note p d) Source # | |
HasTie (Note p d) Source # | |
HasNote (Note p d) p d Source # | |
Field1 (Note a b) (Note a' b) a a' Source # | |
Field2 (Note a b) (Note a b') b b' Source # | |
type Rep (Note p d) Source # | |
Defined in Fadno.Note type Rep (Note p d) = D1 ('MetaData "Note" "Fadno.Note" "fadno-1.1.7-8zqatIJjYaO4EyDdvh95JX" 'False) (C1 ('MetaCons "Note" 'PrefixI 'True) (S1 ('MetaSel ('Just "_pitch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 p) :*: S1 ('MetaSel ('Just "_dur") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 d))) |
class HasNote s p d | s -> p d where Source #
Hand-rolled class providing monomorphic lenses.
note :: Lens' s (Note p d) Source #
fromNote :: HasNote n p d => n -> s Source #
Monophonic pitch functor, i.e. Maybe with a sum monoid.
Chroma as enharmonic names.
Instances
fromChroma :: Integral a => a -> Spelling Source #
Represent pitch as chroma and octave.
It's a full Num
, Integral
instance, so negative octave values OK.
Instances use C4 == 60.
Instances
Bounded PitchRep Source # | |
Enum PitchRep Source # | |
Eq PitchRep Source # | |
Integral PitchRep Source # | |
Defined in Fadno.Note | |
Num PitchRep Source # | |
Ord PitchRep Source # | |
Real PitchRep Source # | |
Defined in Fadno.Note toRational :: PitchRep -> Rational # | |
Show PitchRep Source # | |
Generic PitchRep Source # | |
type Rep PitchRep Source # | |
Defined in Fadno.Note type Rep PitchRep = D1 ('MetaData "PitchRep" "Fadno.Note" "fadno-1.1.7-8zqatIJjYaO4EyDdvh95JX" 'False) (C1 ('MetaCons "PitchRep" 'PrefixI 'True) (S1 ('MetaSel ('Just "_prPitch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Spelling) :*: S1 ('MetaSel ('Just "_prOctave") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
sumDurs :: (Num d, HasNote a p d, Traversable t) => t a -> d Source #
compute total duration of notes
mapTime :: (Num d, Ord d, HasNote a p d, Traversable t) => t a -> [(d, a)] Source #
map notes to arrival time
tied :: (Eq p, Num d, HasNote a p d, Traversable t, Traversable u, Snoc (u a) (u a) a a, Monoid (u a)) => t a -> u a Source #
merge same-pitch notes
legato :: (Eq p, Monoid p, Num d, HasNote a p d, Traversable t, Traversable u, Snoc (u a) (u a) a a, Monoid (u a)) => t a -> u a Source #
merge rests with prior note
merge :: (Num d, HasNote a p d, Traversable t, Traversable u, Snoc (u a) (u a) a a, Monoid (u a)) => (a -> a -> Bool) -> t a -> u a Source #
merge notes meeting some comparison by accumulating durations
transpose' :: (Num p, Functor f, HasNote a (f p) d, Traversable t) => p -> t a -> t a Source #
Pitch addition over a functor