midi-util 0.2 → 0.2.0.1
raw patch · 3 files changed
+14/−7 lines, 3 filesdep ~basedep ~containersdep ~non-negativePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, containers, non-negative
API changes (from Hackage documentation)
- Sound.MIDI.Util: instance (GHC.Read.Read a, GHC.Read.Read b) => GHC.Read.Read (Sound.MIDI.Util.DoubleKey a b)
- Sound.MIDI.Util: instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Sound.MIDI.Util.DoubleKey a b)
+ Sound.MIDI.Util: instance (GHC.Read.Read b, GHC.Read.Read a) => GHC.Read.Read (Sound.MIDI.Util.DoubleKey a b)
+ Sound.MIDI.Util: instance (GHC.Show.Show b, GHC.Show.Show a) => GHC.Show.Show (Sound.MIDI.Util.DoubleKey a b)
+ Sound.MIDI.Util: instance Data.Semigroup.Semigroup Sound.MIDI.Util.BPS
+ Sound.MIDI.Util: instance Data.Semigroup.Semigroup Sound.MIDI.Util.Beats
+ Sound.MIDI.Util: instance Data.Semigroup.Semigroup Sound.MIDI.Util.Seconds
- Sound.MIDI.Util: trackDropZero :: (C t) => T t a -> (T t a)
+ Sound.MIDI.Util: trackDropZero :: (C t) => T t a -> T t a
Files
- changelog.md +4/−0
- midi-util.cabal +3/−3
- src/Sound/MIDI/Util.hs +7/−4
changelog.md view
@@ -1,3 +1,7 @@+## v0.2.1++ * Semigroup fix for GHC 8.4 (requires `non-negative` 0.1.2 with same fix)+ ## v0.2 * added `TimeSig` type and associated functions, so time signatures
midi-util.cabal view
@@ -1,5 +1,5 @@ name: midi-util-version: 0.2+version: 0.2.0.1 synopsis: Utility functions for processing MIDI files description: Common high-level tasks when processing MIDI files.@@ -26,10 +26,10 @@ exposed-modules: Sound.MIDI.Util build-depends:- base >= 4.7 && < 4.9+ base >= 4.7 && < 4.12 , midi >= 0.2.1 && < 0.3 , event-list >= 0.1.1 && < 0.2- , non-negative >= 0.1.1 && < 0.2+ , non-negative >= 0.1.2 && < 0.2 , containers >= 0.5.5 && < 0.6 hs-source-dirs: src default-language: Haskell2010
src/Sound/MIDI/Util.hs view
@@ -36,6 +36,9 @@ #if __GLASGOW_HASKELL__ < 710 import Data.Monoid (Monoid) #endif+#if __GLASGOW_HASKELL__ < 840+import Data.Semigroup (Semigroup)+#endif import Data.Ratio (denominator) import qualified Numeric.NonNegative.Wrapper as NN@@ -77,18 +80,18 @@ -- | Musical time, measured in beats a.k.a. quarter notes. newtype Beats = Beats { fromBeats :: NN.Rational }- deriving (Eq, Ord, Show, Monoid, NNC.C, Num, Real, Fractional, RealFrac)+ deriving (Eq, Ord, Show, Semigroup, Monoid, NNC.C, Num, Real, Fractional, RealFrac) data TimeSig = TimeSig { timeSigLength :: !Beats, timeSigUnit :: !Beats } deriving (Eq, Show) -- | Real time, measured in seconds. newtype Seconds = Seconds { fromSeconds :: NN.Rational }- deriving (Eq, Ord, Show, Monoid, NNC.C, Num, Real, Fractional, RealFrac)+ deriving (Eq, Ord, Show, Semigroup, Monoid, NNC.C, Num, Real, Fractional, RealFrac) -- | A ratio between musical time and real time, measured in beats per second. newtype BPS = BPS { fromBPS :: NN.Rational }- deriving (Eq, Ord, Show, Monoid, NNC.C, Num, Real, Fractional, RealFrac)+ deriving (Eq, Ord, Show, Semigroup, Monoid, NNC.C, Num, Real, Fractional, RealFrac) -- | Creates a tempo as a ratio of a music duration to a real time duration. makeTempo :: Beats -> Seconds -> BPS@@ -341,7 +344,7 @@ trackTakeZero = fst . trackSplitZero -- | Drops all events at position zero of the event list.-trackDropZero :: (NNC.C t) => RTB.T t a -> (RTB.T t a)+trackDropZero :: (NNC.C t) => RTB.T t a -> RTB.T t a trackDropZero = snd . trackSplitZero -- | Looks for a track name event at position zero.