fadno 1.1.0 → 1.1.2
raw patch · 4 files changed
+32/−28 lines, 4 filesdep ~Decimaldep ~HUnitdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: Decimal, HUnit, base, comonad, containers, data-default, deepseq, event-list, fadno-braids, fadno-xml, lens, midi, mtl, process, safe, split, text, unordered-containers, vector, xml
API changes (from Hackage documentation)
- Fadno.Note: instance (GHC.Classes.Eq d, GHC.Classes.Eq p) => GHC.Classes.Eq (Fadno.Note.Note p d)
+ Fadno.Notation: instance GHC.Base.Semigroup (Fadno.Notation.Bar n)
+ Fadno.Notation: instance GHC.Base.Semigroup Fadno.Notation.Direction
+ Fadno.Notation: instance GHC.Base.Semigroup Fadno.Notation.RehearsalMark
+ Fadno.Note: instance (GHC.Classes.Eq p, GHC.Classes.Eq d) => GHC.Classes.Eq (Fadno.Note.Note p d)
+ Fadno.Note: instance GHC.Num.Num p => GHC.Base.Semigroup (Fadno.Note.Mono p)
- Fadno.Midi: makeTrackFull :: (MidiNotes notes) => MidiTempo -> MidiChan -> MidiProgram -> MidiVelocity -> notes -> MidiTrack
+ Fadno.Midi: makeTrackFull :: MidiNotes notes => MidiTempo -> MidiChan -> MidiProgram -> MidiVelocity -> notes -> MidiTrack
- Fadno.Notation: bBarline :: forall n_aAXq. Lens' (Bar n_aAXq) (Maybe Barline)
+ Fadno.Notation: bBarline :: forall n_aAtq. Lens' (Bar n_aAtq) (Maybe Barline)
- Fadno.Notation: bClef :: forall n_aAXq. Lens' (Bar n_aAXq) (Maybe Clef)
+ Fadno.Notation: bClef :: forall n_aAtq. Lens' (Bar n_aAtq) (Maybe Clef)
- Fadno.Notation: bDirection :: forall n_aAXq. Lens' (Bar n_aAXq) (Maybe Direction)
+ Fadno.Notation: bDirection :: forall n_aAtq. Lens' (Bar n_aAtq) (Maybe Direction)
- Fadno.Notation: bNotes :: forall n_aAXq n_aBg3. Lens (Bar n_aAXq) (Bar n_aBg3) (Seq n_aAXq) (Seq n_aBg3)
+ Fadno.Notation: bNotes :: forall n_aAtq n_aAOT. Lens (Bar n_aAtq) (Bar n_aAOT) (Seq n_aAtq) (Seq n_aAOT)
- Fadno.Notation: bRehearsalMark :: forall n_aAXq. Lens' (Bar n_aAXq) (Maybe RehearsalMark)
+ Fadno.Notation: bRehearsalMark :: forall n_aAtq. Lens' (Bar n_aAtq) (Maybe RehearsalMark)
- Fadno.Notation: bRepeats :: forall n_aAXq. Lens' (Bar n_aAXq) (Maybe Repeats)
+ Fadno.Notation: bRepeats :: forall n_aAtq. Lens' (Bar n_aAtq) (Maybe Repeats)
- Fadno.Notation: bTimeSignature :: forall n_aAXq. Lens' (Bar n_aAXq) (Maybe TimeSignature)
+ Fadno.Notation: bTimeSignature :: forall n_aAtq. Lens' (Bar n_aAtq) (Maybe TimeSignature)
- Fadno.Notation: mshow :: (Show a) => Getter s (Maybe a) -> String -> s -> String
+ Fadno.Notation: mshow :: Show a => Getter s (Maybe a) -> String -> s -> String
- Fadno.Notation: nArticulation :: forall p_aANb d_aANc. Lens' (Note' p_aANb d_aANc) (Maybe Articulation)
+ Fadno.Notation: nArticulation :: forall p_aAje d_aAjf. Lens' (Note' p_aAje d_aAjf) (Maybe Articulation)
- Fadno.Notation: nNote :: forall p_aANb d_aANc p_aAWL d_aAWM. Lens (Note' p_aANb d_aANc) (Note' p_aAWL d_aAWM) (Note p_aANb d_aANc) (Note p_aAWL d_aAWM)
+ Fadno.Notation: nNote :: forall p_aAje d_aAjf p_aAsL d_aAsM. Lens (Note' p_aAje d_aAjf) (Note' p_aAsL d_aAsM) (Note p_aAje d_aAjf) (Note p_aAsL d_aAsM)
- Fadno.Notation: nSlur :: forall p_aANb d_aANc. Lens' (Note' p_aANb d_aANc) (Maybe Slur)
+ Fadno.Notation: nSlur :: forall p_aAje d_aAjf. Lens' (Note' p_aAje d_aAjf) (Maybe Slur)
- Fadno.Notation: nTie :: forall p_aANb d_aANc. Lens' (Note' p_aANb d_aANc) (Maybe Tie)
+ Fadno.Notation: nTie :: forall p_aAje d_aAjf. Lens' (Note' p_aAje d_aAjf) (Maybe Tie)
- Fadno.Notation: partIdx :: forall a_aAp2 a_aAMY. Iso (Part a_aAp2) (Part a_aAMY) a_aAp2 a_aAMY
+ Fadno.Notation: partIdx :: forall a_azQo a_aAj1. Iso (Part a_azQo) (Part a_aAj1) a_azQo a_aAj1
- Fadno.Note: _M :: forall p_amRt p_anjj. Prism (Mono p_anjj) (Mono p_amRt) p_anjj p_amRt
+ Fadno.Note: _M :: forall p_ap76 p_aqaj. Prism (Mono p_aqaj) (Mono p_ap76) p_aqaj p_ap76
- Fadno.Note: class HasNote s p d | s -> p d where notePitch = note . pitch noteDur = note . dur
+ Fadno.Note: class HasNote s p d | s -> p d
- Fadno.Note: dur :: forall p_ak7t d_ak7u d_amEb. Lens (Note p_ak7t d_ak7u) (Note p_ak7t d_amEb) d_ak7u d_amEb
+ Fadno.Note: dur :: forall p_aeF2 d_aeF3 d_aoS1. Lens (Note p_aeF2 d_aeF3) (Note p_aeF2 d_aoS1) d_aeF3 d_aoS1
- Fadno.Note: mPitch :: forall p_amRt p_anhW. Traversal (Mono p_amRt) (Mono p_anhW) p_amRt p_anhW
+ Fadno.Note: mPitch :: forall p_ap76 p_aq6h. Traversal (Mono p_ap76) (Mono p_aq6h) p_ap76 p_aq6h
- Fadno.Note: pitch :: forall p_ak7t d_ak7u p_amEc. Lens (Note p_ak7t d_ak7u) (Note p_amEc d_ak7u) p_ak7t p_amEc
+ Fadno.Note: pitch :: forall p_aeF2 d_aeF3 p_aoS2. Lens (Note p_aeF2 d_aeF3) (Note p_aoS2 d_aeF3) p_aeF2 p_aoS2
- Fadno.Util: filterOnKeys :: (Ord a) => [a] -> Map a b -> Map a b
+ Fadno.Util: filterOnKeys :: Ord a => [a] -> Map a b -> Map a b
- Fadno.Util: popping :: (MonadState s m) => Int -> Lens' s [a] -> ([a] -> m b) -> m b
+ Fadno.Util: popping :: MonadState s m => Int -> Lens' s [a] -> ([a] -> m b) -> m b
- Fadno.Util: popping' :: (MonadState s m) => Int -> Lens' s [a] -> ([a] -> m b) -> m (Maybe b)
+ Fadno.Util: popping' :: MonadState s m => Int -> Lens' s [a] -> ([a] -> m b) -> m (Maybe b)
- Fadno.Util: popping1 :: (MonadState s m) => Lens' s [a] -> (a -> m b) -> m (Maybe b)
+ Fadno.Util: popping1 :: MonadState s m => Lens' s [a] -> (a -> m b) -> m (Maybe b)
- Fadno.Xml: data Element :: *
+ Fadno.Xml: data Element
- Fadno.Xml: xmlAppendMeasureData :: (MeasureList f) => ChxMusicData -> f Measure -> f Measure
+ Fadno.Xml: xmlAppendMeasureData :: MeasureList f => ChxMusicData -> f Measure -> f Measure
- Fadno.Xml: xmlAppendMeasureDatas :: (MeasureList f) => [ChxMusicData] -> f Measure -> f Measure
+ Fadno.Xml: xmlAppendMeasureDatas :: MeasureList f => [ChxMusicData] -> f Measure -> f Measure
- Fadno.Xml: xmlBarline :: (ApplyMonoid c ChxMusicData) => HasBarline a => a -> c ChxMusicData
+ Fadno.Xml: xmlBarline :: ApplyMonoid c ChxMusicData => HasBarline a => a -> c ChxMusicData
- Fadno.Xml: xmlChord :: (HasNote a [PitchRep] Rational) => a -> [ChxMusicData]
+ Fadno.Xml: xmlChord :: HasNote a [PitchRep] Rational => a -> [ChxMusicData]
- Fadno.Xml: xmlNote :: (HasNote a (Mono PitchRep) Rational) => a -> ChxMusicData
+ Fadno.Xml: xmlNote :: HasNote a (Mono PitchRep) Rational => a -> ChxMusicData
- Fadno.Xml: xmlPrependMeasureData :: (MeasureList f) => ChxMusicData -> f Measure -> f Measure
+ Fadno.Xml: xmlPrependMeasureData :: MeasureList f => ChxMusicData -> f Measure -> f Measure
- Fadno.Xml: xmlPrependMeasureDatas :: (MeasureList f) => [ChxMusicData] -> f Measure -> f Measure
+ Fadno.Xml: xmlPrependMeasureDatas :: MeasureList f => [ChxMusicData] -> f Measure -> f Measure
- Fadno.Xml: xmlRepeats :: (ApplyMonoid t ChxMusicData) => HasRepeats a => a -> t ChxMusicData
+ Fadno.Xml: xmlRepeats :: ApplyMonoid t ChxMusicData => HasRepeats a => a -> t ChxMusicData
- Fadno.Xml: xmlTie :: (HasTie a) => a -> ChxMusicData -> ChxMusicData
+ Fadno.Xml: xmlTie :: HasTie a => a -> ChxMusicData -> ChxMusicData
Files
- fadno.cabal +21/−21
- src/Fadno/Meter.hs +3/−1
- src/Fadno/Notation.hs +4/−3
- src/Fadno/Note.hs +4/−3
fadno.cabal view
@@ -1,7 +1,7 @@ name: fadno category: Music synopsis: Minimal library for music generation and notation-version: 1.1.0+version: 1.1.2 homepage: http://github.com/slpopejoy/fadno description: Provides the Note type and HasNote class with polymorphic pitch and duration representations, metering, barring and time signature utilities, plus midi and MusicXML support.@@ -27,26 +27,26 @@ -- other-modules: -- other-extensions:- build-depends: Decimal == 0.4.*- , HUnit == 1.5.*- , base == 4.9.*- , containers == 0.5.*- , comonad == 5.*- , data-default == 0.7.*- , deepseq == 1.4.*- , event-list == 0.1.*- , fadno-braids == 0.1.*- , fadno-xml == 1.1.*- , lens == 4.15.*- , midi == 0.2.*- , mtl == 2.2.*- , process == 1.4.*- , safe == 0.3.*- , split == 0.2.*- , text == 1.2.*- , unordered-containers == 0.2.*- , vector == 0.12.*- , xml == 1.3.*+ build-depends: Decimal >= 0.4+ , HUnit >= 1.5+ , base >= 4.9 && < 4.13+ , containers >= 0.5+ , comonad >= 5 + , data-default >= 0.7+ , deepseq >= 1.4 + , event-list >= 0.1+ , fadno-braids >= 0.1+ , fadno-xml >= 1.1+ , lens >= 4.15 + , midi >= 0.2+ , mtl >= 2.2 + , process >= 1.4+ , safe >= 0.3+ , split >= 0.2+ , text >= 1.2+ , unordered-containers >= 0.2 + , vector >= 0.12 + , xml >= 1.3 hs-source-dirs: src default-language: Haskell2010
src/Fadno/Meter.hs view
@@ -3,6 +3,8 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE AllowAmbiguousTypes #-}+ module Fadno.Meter where import Fadno.Notation@@ -42,7 +44,7 @@ TimeSignature -> b n -> [c m] rebar ts = reverse . fixup . foldl' go [mempty] . fmap fromNote where tslen = tsToRatio ts- go [] _ = error "impossible"+ go bss@[] _ = bss -- error case but might as well be total go bss@(b:bs) n | barlen == tslen = go (mempty:bss) n | newBarLen <= tslen = (b |> n):bs | otherwise = {- trace1' "otherwise" (remaining, ndur) $ -} go ((b |> pre):bs) post
src/Fadno/Notation.hs view
@@ -127,7 +127,7 @@ -- | Bar rehearsal mark. newtype RehearsalMark = RehearsalMark { _rehearsalText :: String }- deriving (Eq,Ord,IsString,Generic,Monoid,Default)+ deriving (Eq,Ord,IsString,Generic,Semigroup,Monoid,Default) makeLenses ''RehearsalMark instance Show RehearsalMark where show = show . _rehearsalText class HasRehearsalMark a where rehearsalMark :: Lens' a (Maybe RehearsalMark)@@ -135,7 +135,7 @@ -- | Musical direction. newtype Direction = Direction { _directionText :: String }- deriving (Eq,Ord,IsString,Generic,Monoid,Default)+ deriving (Eq,Ord,IsString,Generic,Semigroup,Monoid,Default) makeLenses ''Direction instance Show Direction where show = show . _directionText class HasDirection a where direction :: Lens' a (Maybe Direction)@@ -243,9 +243,10 @@ ,mshow timeSignature "timeSignature" ,mshow clef "clef" ]+instance Semigroup (Bar n) where+ a <> b = over bNotes (<> view bNotes b) a instance Monoid (Bar n) where mempty = def- a `mappend` b = over bNotes (`mappend` view bNotes b) a -- | Bar smart ctor, used in 'Show'. bar :: [n] -> Bar n
src/Fadno/Note.hs view
@@ -73,11 +73,12 @@ show (M p) = "M " ++ show p makeLenses ''Mono makePrisms ''Mono+instance Num p => Semigroup (Mono p) where+ Rest <> b = b+ a <> Rest = a+ (M a) <> (M b) = M (a + b) instance Num p => Monoid (Mono p) where mempty = Rest- mappend Rest b = b- mappend a Rest = a- mappend (M a) (M b) = M (a + b) -- | Mono/Maybe isomorphism. maybeMono :: Iso' (Maybe a) (Mono a) maybeMono = iso toMono toMaybe