abcnotation 1.6 → 1.6.1
raw patch · 2 files changed
+34/−97 lines, 2 filesdep +process
Dependencies added: process
Files
- abcnotation.cabal +30/−25
- src/Music/Abc.hs +4/−72
abcnotation.cabal view
@@ -1,32 +1,37 @@ -name: abcnotation-version: 1.6-cabal-version: >= 1.2-author: Hans Hoglund-maintainer: Hans Hoglund-license: BSD3-license-file: COPYING-synopsis: Haskell representation and parser for ABC notation.-category: Music-tested-with: GHC-build-type: Simple+name: abcnotation+version: 1.6.1+synopsis: Haskell representation and parser for ABC notation.+author: Hans Hoglund+maintainer: Hans Hoglund+license: BSD3+license-file: COPYING+category: Music+tested-with: GHC+build-type: Simple+cabal-version: >= 1.10 -description: - This package contains a Haskell representation and parser for ABC notation. +description:+ This package contains a Haskell representation and parser for ABC notation. .- ABC notation is a text-based music notation system designed to be comprehensible by both people and + ABC notation is a text-based music notation system designed to be comprehensible by both people and computers. For more information see <http://abcnotation.com>. . Based on the 2.1 standard. -library - build-depends: - base >= 4 && < 5,- semigroups,- prettify,- network,- parsec- hs-source-dirs: src- exposed-modules:- Music.Abc- Music.Abc.Parser+source-repository head+ type: git+ location: git://github.com/music-suite/abcnotation.git++library+ exposed-modules: Music.Abc+ Music.Abc.Parser+ build-depends: base >= 4 && < 5,+ network,+ semigroups,+ prettify,+ parsec,+ -- debug+ process+ hs-source-dirs: src+ default-language: Haskell2010
src/Music/Abc.hs view
@@ -80,9 +80,9 @@ import Data.Ratio import Data.Char import Data.Semigroup+import Data.List (intersperse) import Text.Pretty hiding (Mode) - -------------------------------------------------------------------------------- -- File structure@@ -154,9 +154,10 @@ sepBy "\n" (fmap pretty info) --- | One line of music code.+-- | Lines of music code. type TuneBody = [Music]+-- TODO voices, see http://www.barfly.dial.pipex.com/multivoice.txt --------------------------------------------------------------------------------@@ -183,6 +184,7 @@ pretty = go where go (Chord a) = pretty a+ go (Sequence as) = sepBy " " $ fmap pretty as -- FIXME @@ -582,76 +584,6 @@ showAbc :: AbcFile -> String showAbc = error "Not impl"--------------------------------------------------------------------------------------- Tests--{-- - X:19004- T:Silent Night- T:Stille Nacht! Heilige Nacht!- R:Air- C:Franz Xaver Gruber, 1818- O:Austria- Z:Paul Hardy's Xmas Tunebook 2012 (see www.paulhardy.net). Creative Commons cc by-nc-sa licenced.- M:6/8- L:1/8- Q:3/8=60- K:C- "C"G>A G E3|G>A G E2z|"G"d2 d B3|"C"c2 c G2z|- "F"A2 A c>B A|"C"G>A G E2z|"F"A2 A c>B A|"C"G>A G E2z|- "G7"d2 d f>d B|"C"c3 e2z|cGE "G7"G>F D|"C"C3-C3|]- W:Silent night, holy night- W:All is calm, all is bright- W:Round yon Virgin Mother and Child- W:Holy Infant so tender and mild- W:Sleep in heavenly peace- W:Sleep in heavenly peace- W:- W:(Josef Mohr, 1818, Trans by John Young, 1819)- --}-test = AbcFile - (Just "1.2")- (Just $ FileHeader [- Title "Collection" - ] []) - [- Tune (AbcTune - (TuneHeader [- ReferenceNumber 19004,- Title "Silent Night",- Title "Stille Nacht! Heilige Nacht!",- Rhythm "Air",- Composer "Franz Xaver Gruber, 1818",- Origin "Austria",- Source "Paul Hardy's Xmas Tunebook 2012",- Meter (Simple $ 6/8),- UnitNoteLength (1/8),- Tempo (Tempo_ (Just "Andante", [3/8], 60)),- Key (Key_ (0, Minor)), -- Words "Silent night, holy night",- Words "All is calm, all is bright",- Words "Round yon Virgin Mother and Child",- Words "Holy Infant so tender and mild",- Words "Sleep in heavenly peace",- Words "Sleep in heavenly peace"- ]) - [- Chord (Chord_ ([(Pitch (C,Just Sharp,0))], Just 1))- ])-- ]--main = (putStrLn . show . pretty) test---- showRatio :: (Integral a, Show a) => Ratio a -> String