zmidi-core 0.7.0 → 0.8.0
raw patch · 9 files changed
+57/−34 lines, 9 files
Files
- src/ZMidi/Core/Internal/ParserMonad.hs +4/−1
- src/ZMidi/Core/Internal/SimpleFormat.hs +6/−1
- src/ZMidi/Core/Pretty.hs +0/−1
- src/ZMidi/Core/Pretty/Ascii.hs +4/−1
- src/ZMidi/Core/Pretty/Internal.hs +4/−1
- src/ZMidi/Core/ReadFile.hs +26/−23
- src/ZMidi/Core/VersionNumber.hs +3/−3
- src/ZMidi/Core/WriteFile.hs +4/−1
- zmidi-core.cabal +6/−2
src/ZMidi/Core/Internal/ParserMonad.hs view
@@ -1,9 +1,10 @@+{-# LANGUAGE CPP #-} {-# OPTIONS -Wall #-} -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.Internal.ParseMonad--- Copyright : (c) Stephen Tetley 2010-2013+-- Copyright : (c) Stephen Tetley 2010-2015 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -53,7 +54,9 @@ ) where +#ifndef MIN_VERSION_GLASGOW_HASKELL import Control.Applicative+#endif import Data.Bits import qualified Data.ByteString.Lazy as L import Data.Char
src/ZMidi/Core/Internal/SimpleFormat.hs view
@@ -1,9 +1,10 @@+{-# LANGUAGE CPP #-} {-# OPTIONS -Wall #-} -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.Internal.SimpleFormat--- Copyright : (c) Stephen Tetley 2010-2013+-- Copyright : (c) Stephen Tetley 2010-2015 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -54,8 +55,12 @@ +#ifndef MIN_VERSION_GLASGOW_HASKELL import Control.Applicative+#endif+#ifndef MIN_VERSION_GLASGOW_HASKELL import Data.Monoid+#endif import Data.Word import Numeric
src/ZMidi/Core/Pretty.hs view
@@ -36,7 +36,6 @@ import ZMidi.Core.Pretty.Internal import ZMidi.Core.Pretty.Interp -import Data.Monoid -- | Print the MIDI file to stdout. --
src/ZMidi/Core/Pretty/Ascii.hs view
@@ -1,9 +1,10 @@+{-# LANGUAGE CPP #-} {-# OPTIONS -Wall #-} -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.Pretty.Ascii--- Copyright : (c) Stephen Tetley 2013+-- Copyright : (c) Stephen Tetley 2013-2015 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -29,7 +30,9 @@ import ZMidi.Core.Pretty.Internal import ZMidi.Core.Pretty.Interp +#ifndef MIN_VERSION_GLASGOW_HASKELL import Data.Monoid+#endif import Data.Word
src/ZMidi/Core/Pretty/Internal.hs view
@@ -1,9 +1,10 @@+{-# LANGUAGE CPP #-} {-# OPTIONS -Wall #-} -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.Pretty.Internal--- Copyright : (c) Stephen Tetley 2013+-- Copyright : (c) Stephen Tetley 2015 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -36,7 +37,9 @@ import Data.Char+#ifndef MIN_VERSION_GLASGOW_HASKELL import Data.Monoid+#endif import Data.Word -- | Column specs for Header - Header is printed as simple
src/ZMidi/Core/ReadFile.hs view
@@ -1,9 +1,10 @@+{-# LANGUAGE CPP #-} {-# OPTIONS -Wall #-} -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.ReadFile--- Copyright : (c) Stephen Tetley 2010-2013+-- Copyright : (c) Stephen Tetley 2010-2015 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -44,7 +45,9 @@ import ZMidi.Core.Internal.ParserMonad +#ifndef MIN_VERSION_GLASGOW_HASKELL import Control.Applicative+#endif import Control.Monad import Data.Bits import qualified Data.ByteString.Lazy as L@@ -107,7 +110,7 @@ event = peek >>= step where -- 00..7f -- /data/- step n + step n | n == 0xFF = MetaEvent <$> (dropW8 *> (word8 >>= metaEvent)) | n >= 0xF8 = SysRealTimeEvent <$> (dropW8 *> sysRealTimeEvent n) | n == 0xF7 = SysExEvent <$> (dropW8 *> sysExEscape)@@ -142,7 +145,7 @@ voiceEvent (SB 0xD0 ch) = setRunningEvent (RS_CHAN_AFT ch) >> chanAftertouch ch -voiceEvent (SB 0xE0 ch) = +voiceEvent (SB 0xE0 ch) = setRunningEvent (RS_PCH_BEND ch) >> pitchBend ch -- This is an /impossible/ match - to get here either @splitByte@ @@ -258,60 +261,60 @@ sysExEscape :: ParserM MidiSysExEvent sysExEscape = "sys-ex" <??> getVarlenBytes SysExEscape --- | 0xFF and the "type" byte already parsed, input to this +-- | 0xFF and the "type" byte already parsed, input to this -- function is the type byte. ----- Not all MetaEvents are enumerated - unrecognized ones are +-- Not all MetaEvents are enumerated - unrecognized ones are -- delegated to @MetaOther@. -- metaEvent :: Word8 -> ParserM MidiMetaEvent-metaEvent 0x00 = +metaEvent 0x00 = "sequence number" <??> SequenceNumber <$> (assertWord8 2 *> word16be) -metaEvent 0x01 = "generic text" <??> textEvent GENERIC_TEXT -metaEvent 0x02 = "copyrightn notice" <??> textEvent COPYRIGHT_NOTICE+metaEvent 0x01 = "generic text" <??> textEvent GENERIC_TEXT+metaEvent 0x02 = "copyright notice" <??> textEvent COPYRIGHT_NOTICE metaEvent 0x03 = "sequence name" <??> textEvent SEQUENCE_NAME metaEvent 0x04 = "instrument name" <??> textEvent INSTRUMENT_NAME metaEvent 0x05 = "lyrics" <??> textEvent LYRICS metaEvent 0x06 = "marker" <??> textEvent MARKER metaEvent 0x07 = "cue point" <??> textEvent CUE_POINT -metaEvent 0x20 = +metaEvent 0x20 = "channel prefix" <??> ChannelPrefix <$> (assertWord8 0x01 *> word8) -metaEvent 0x21 = +metaEvent 0x21 = "MIDI port" <??> MidiPort <$> (assertWord8 0x01 *> word8) -metaEvent 0x2F = - "end of track" <??> EndOfTrack <$ assertWord8 0 +metaEvent 0x2F =+ "end of track" <??> EndOfTrack <$ assertWord8 0 -metaEvent 0x51 = +metaEvent 0x51 = "set tempo" <??> SetTempo <$> (assertWord8 3 *> word24be) -metaEvent 0x54 = - "smpte offset" <??> SMPTEOffset <$> (assertWord8 5 *> word8) +metaEvent 0x54 =+ "smpte offset" <??> SMPTEOffset <$> (assertWord8 5 *> word8) <*> word8 <*> word8 <*> word8 <*> word8 -metaEvent 0x58 = +metaEvent 0x58 = "time signature" <??> TimeSignature <$> (assertWord8 4 *> word8)- <*> word8 <*> word8 - <*> word8 + <*> word8 <*> word8+ <*> word8 -metaEvent 0x59 = - "key signature" <??> KeySignature <$> (assertWord8 2 *> int8) +metaEvent 0x59 =+ "key signature" <??> KeySignature <$> (assertWord8 2 *> int8) <*> scale -metaEvent 0x7F = +metaEvent 0x7F = "system specific meta event" <??> getVarlenBytes SSME -metaEvent ty = +metaEvent ty = "meta other" <??> getVarlenBytes (MetaOther ty) - + fileFormat :: ParserM MidiFormat fileFormat = word16be >>= fn where
src/ZMidi/Core/VersionNumber.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.VersionNumber--- Copyright : (c) Stephen Tetley 2010-2013+-- Copyright : (c) Stephen Tetley 2010-2015 -- License : BSD3 -- -- Maintainer : stephen.tetley@gmail.com@@ -22,7 +22,7 @@ -- | Version number ----- > (0,7,0)+-- > (0,8,0) -- zmidi_core_version :: (Int,Int,Int)-zmidi_core_version = (0,7,0)+zmidi_core_version = (0,8,0)
src/ZMidi/Core/WriteFile.hs view
@@ -1,9 +1,10 @@+{-# LANGUAGE CPP #-} {-# OPTIONS -Wall #-} -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.WriteFile--- Copyright : (c) Stephen Tetley 2010-2013+-- Copyright : (c) Stephen Tetley 2010-2015 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -25,7 +26,9 @@ import Data.Binary.Put -- package: binary +#ifndef MIN_VERSION_GLASGOW_HASKELL import Control.Applicative+#endif import Data.Bits import qualified Data.ByteString.Lazy as L import Data.Char (ord)
zmidi-core.cabal view
@@ -1,10 +1,10 @@ name: zmidi-core-version: 0.7.0+version: 0.8.0 license: BSD3 license-file: LICENSE copyright: Stephen Tetley <stephen.tetley@gmail.com> maintainer: Stephen Tetley <stephen.tetley@gmail.com>-homepage: http://code.google.com/p/copperbox/+homepage: https://github.com/stephentetley/zmidi-core category: Music synopsis: Read and write MIDI files. description:@@ -13,6 +13,10 @@ dependencies only on ByteString, Containers and Data.Binary. . Changelog:+ + v0.7.0 to v0.8.0:+ .+ * Updated to compile without errors with GHC 7.10. . v0.6.0 to v0.7.0: .