music-parts 1.8.1 → 1.9.0
raw patch · 10 files changed
+1750/−3157 lines, 10 filesdep +bytestringdep +cassavadep +monadplusdep ~lensdep ~music-dynamicsdep ~music-pitchPVP ok
version bump matches the API change (PVP)
Dependencies added: bytestring, cassava, monadplus, vector-space, vector-space-points
Dependency ranges changed: lens, music-dynamics, music-pitch
API changes (from Hackage documentation)
- Music.Parts.Instrument: OtherInstrument :: String -> Instrument
- Music.Parts.Instrument: StdInstrument :: Int -> Instrument
- Music.Parts.Instrument: instrumentName :: Instrument -> String
- Music.Parts.Instrument: playableDynamics :: Instrument -> Pitch -> Dynamics
+ Music.Parts.Instrument: fromMidiProgram :: Int -> Instrument
+ Music.Parts.Instrument: fromMusicXmlSoundId :: String -> Instrument
+ Music.Parts.Instrument: gmClef :: Int -> Int
+ Music.Parts.Instrument: gmMidiChannel :: Int -> Int
+ Music.Parts.Instrument: gmScoreOrder :: Int -> Double
+ Music.Parts.Instrument: instance ToJSON Instrument
+ Music.Parts.Instrument: standardClef :: Instrument -> Maybe Clef
+ Music.Parts.Instrument: toMidiProgram :: Instrument -> Maybe Int
+ Music.Parts.Instrument: toMusicXmlSoundId :: Instrument -> Maybe String
+ Music.Parts.Internal.Data: InstrumentDef :: SoundId -> [Int] -> [Int] -> Maybe Int -> Double -> [Clef] -> [Clef] -> Interval -> Maybe (Ambitus Pitch) -> Maybe (Ambitus Pitch) -> Maybe String -> Maybe String -> Maybe String -> InstrumentDef
+ Music.Parts.Internal.Data: _allowedClefs :: InstrumentDef -> [Clef]
+ Music.Parts.Internal.Data: _comfortableRange :: InstrumentDef -> Maybe (Ambitus Pitch)
+ Music.Parts.Internal.Data: _defaultMidiChannel :: InstrumentDef -> Maybe Int
+ Music.Parts.Internal.Data: _generalMidiPercussionNote :: InstrumentDef -> [Int]
+ Music.Parts.Internal.Data: _generalMidiProgram :: InstrumentDef -> [Int]
+ Music.Parts.Internal.Data: _longName :: InstrumentDef -> Maybe String
+ Music.Parts.Internal.Data: _playableRange :: InstrumentDef -> Maybe (Ambitus Pitch)
+ Music.Parts.Internal.Data: _scoreOrder :: InstrumentDef -> Double
+ Music.Parts.Internal.Data: _shortName :: InstrumentDef -> Maybe String
+ Music.Parts.Internal.Data: _sibeliusName :: InstrumentDef -> Maybe String
+ Music.Parts.Internal.Data: _soundId :: InstrumentDef -> SoundId
+ Music.Parts.Internal.Data: _standardClef :: InstrumentDef -> [Clef]
+ Music.Parts.Internal.Data: _transposition :: InstrumentDef -> Interval
+ Music.Parts.Internal.Data: data InstrumentDef
+ Music.Parts.Internal.Data: getInstrumentDefByGeneralMidiPercussionNote :: Int -> Maybe InstrumentDef
+ Music.Parts.Internal.Data: getInstrumentDefByGeneralMidiProgram :: Int -> Maybe InstrumentDef
+ Music.Parts.Internal.Data: getInstrumentDefById :: String -> Maybe InstrumentDef
+ Music.Parts.Internal.Data: instance FromField (Maybe (Ambitus Pitch))
+ Music.Parts.Internal.Data: instance FromField Clef
+ Music.Parts.Internal.Data: instance FromField Pitch
+ Music.Parts.Internal.Data: instance FromField [Clef]
+ Music.Parts.Internal.Data: instance FromField [Int]
+ Music.Parts.Internal.Data: instance FromRecord InstrumentDef
+ Music.Parts.Internal.Data: instance Num Clef
+ Music.Parts.Internal.Data: instance Show InstrumentDef
+ Music.Parts.Internal.Data: instance Show InstrumentTopCategory
+ Music.Parts.Internal.Data: type SoundId = String
- Music.Parts.Instrument: fullName :: Instrument -> String
+ Music.Parts.Instrument: fullName :: Instrument -> Maybe String
- Music.Parts.Instrument: shortName :: Instrument -> String
+ Music.Parts.Instrument: shortName :: Instrument -> Maybe String
Files
- data/instruments.csv +888/−0
- music-parts.cabal +25/−7
- src/Music/Parts.hs +450/−1668
- src/Music/Parts/Basic.hs +2/−22
- src/Music/Parts/Division.hs +4/−21
- src/Music/Parts/Instrument.hs +141/−269
- src/Music/Parts/Internal/Data.hs +220/−1113
- src/Music/Parts/Solo.hs +1/−16
- src/Music/Parts/Subpart.hs +17/−22
- src/Music/Parts/Voices.hs +2/−19
+ data/instruments.csv view
@@ -0,0 +1,888 @@+ID,GM Program,GM Percussion Note,Default MIDI Channel,Score Order,Allowed Clefs,Standard Clef,Transposition,Playable Range,Comfortable Range,Long Name,Short Name,Sibelius Name+wind.flutes.bansuri,,,,1,treble,treble,C4,,,,,+wind.flutes.blown-bottle,77,,,1,treble,treble,C4,,,,,+wind.flutes.calliope,83,,,1,treble,treble,C4,,,,,+wind.flutes.danso,,,,1,treble,treble,C4,,,,,+wind.flutes.di-zi,,,,1,treble,treble,C4,,,,,+wind.flutes.dvojnice,,,,1,treble,treble,C4,,,,,+wind.flutes.fife,,,,1,treble,treble,C4,,,,,+wind.flutes.flageolet,,,,1,treble,treble,C4,,,,,+wind.flutes.flute.bass,,,,1,treble,treble,C4,,,,,+wind.flutes.flute.contra-alto,,,,1,treble,treble,C4,,,,,+wind.flutes.flute.contrabass,,,,1,treble,treble,C4,,,,,+wind.flutes.flute.double-contrabass,,,,1,treble,treble,C4,,,,,+wind.flutes.flute.irish,,,,1,treble,treble,C4,,,,,+wind.flutes.flute.subcontrabass,,,,1,treble,treble,C4,,,,,+wind.flutes.fujara,,,,1,treble,treble,C4,,,,,+wind.flutes.gemshorn,,,,1,treble,treble,C4,,,,,+wind.flutes.hocchiku,,,,1,treble,treble,C4,,,,,+wind.flutes.hun,,,,1,treble,treble,C4,,,,,+wind.flutes.kaval,,,,1,treble,treble,C4,,,,,+wind.flutes.kawala,,,,1,treble,treble,C4,,,,,+wind.flutes.khlui,,,,1,treble,treble,C4,,,,,+wind.flutes.knotweed,,,,1,treble,treble,C4,,,,,+wind.flutes.koncovka.alto,,,,1,treble,treble,C4,,,,,+wind.flutes.koudi,,,,1,treble,treble,C4,,,,,+wind.flutes.ney,,,,1,treble,treble,C4,,,,,+wind.flutes.nohkan,,,,1,treble,treble,C4,,,,,+wind.flutes.nose,,,,1,treble,treble,C4,,,,,+wind.flutes.ocarina,80,,,1,treble,treble,C4,,,,,+wind.flutes.overtone.tenor,,,,1,treble,treble,C4,,,,,+wind.flutes.palendag,,,,1,treble,treble,C4,,,,,+wind.flutes.panpipes,76,,,1,treble,treble,C4,,,,,+wind.flutes.quena,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder,75,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.alto,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.bass,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.contrabass,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.descant,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.garklein,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.great-bass,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.sopranino,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.soprano,,,,1,treble,treble,C4,,,,,+wind.flutes.recorder.tenor,,,,1,treble,treble,C4,,,,,+wind.flutes.ryuteki,,,,1,treble,treble,C4,,,,,+wind.flutes.shakuhachi,78,,,1,treble,treble,C4,,,,,+wind.flutes.shepherds-pipe,,,,1,treble,treble,C4,,,,,+wind.flutes.shinobue,,,,1,treble,treble,C4,,,,,+wind.flutes.shvi,,,,1,treble,treble,C4,,,,,+wind.flutes.suling,,,,1,treble,treble,C4,,,,,+wind.flutes.tarka,,,,1,treble,treble,C4,,,,,+wind.flutes.tumpong,,,,1,treble,treble,C4,,,,,+wind.flutes.venu,,,,1,treble,treble,C4,,,,,+wind.flutes.whistle,79,,,1,treble,treble,C4,,,,,+wind.flutes.whistle.alto,,,,1,treble,treble,C4,,,,,+wind.flutes.whistle.low-irish,,,,1,treble,treble,C4,,,,,+wind.flutes.whistle.shiva,,,,1,treble,treble,C4,,,,,+wind.flutes.whistle.slide,,,,1,treble,treble,C4,,,,,+wind.flutes.whistle.tin,,,,1,treble,treble,C4,,,,,+wind.flutes.whistle.tin.bflat,,,,1,treble,treble,C4,,,,,+wind.flutes.whistle.tin.d,,,,1,treble,treble,C4,,,,,+wind.flutes.xiao,,,,1,treble,treble,C4,,,,,+wind.flutes.xun,,,,1,treble,treble,C4,,,,,+wind.group,,,,1,treble,treble,C4,,,,,+wind.jug,,,,1,treble,treble,C4,,,,,+wind.pipes.bagpipes,110,,,1,treble,treble,C4,,,,,+wind.pipes.gaida,,,,1,treble,treble,C4,,,,,+wind.pipes.highland,,,,1,treble,treble,C4,,,,,+wind.pipes.uilleann,,,,1,treble,treble,C4,,,,,+wind.pungi,,,,1,treble,treble,C4,,,,,+wind.reed.albogue,,,,1,treble,treble,C4,,,,,+wind.reed.alboka,,,,1,treble,treble,C4,,,,,+wind.reed.algaita,,,,1,treble,treble,C4,,,,,+wind.reed.arghul,,,,1,treble,treble,C4,,,,,+wind.reed.bawu,,,,1,treble,treble,C4,,,,,+wind.reed.bifora,,,,1,treble,treble,C4,,,,,+wind.reed.bombarde,,,,1,treble,treble,C4,,,,,+wind.reed.contrabass,,,,1,treble,treble,C4,,,,,+wind.reed.cornamuse,,,,1,treble,treble,C4,,,,,+wind.reed.cromorne,,,,1,treble,treble,C4,,,,,+wind.reed.crumhorn,,,,1,treble,treble,C4,,,,,+wind.reed.crumhorn.alto,,,,1,treble,treble,C4,,,,,+wind.reed.crumhorn.bass,,,,1,treble,treble,C4,,,,,+wind.reed.crumhorn.great-bass,,,,1,treble,treble,C4,,,,,+wind.reed.crumhorn.soprano,,,,1,treble,treble,C4,,,,,+wind.reed.crumhorn.tenor,,,,1,treble,treble,C4,,,,,+wind.reed.diple,,,,1,treble,treble,C4,,,,,+wind.reed.diplica,,,,1,treble,treble,C4,,,,,+wind.reed.duduk,,,,1,treble,treble,C4,,,,,+wind.reed.dulcian,,,,1,treble,treble,C4,,,,,+wind.reed.dulzaina,,,,1,treble,treble,C4,,,,,+wind.reed.guanzi,,,,1,treble,treble,C4,,,,,+wind.reed.harmonica,23,,,1,treble,treble,C4,,,Harmonica,,+wind.reed.harmonica.bass,,,,1,treble,treble,C4,,,,,+wind.reed.heckel-clarina,,,,1,treble,treble,C4,,,,,+wind.reed.heckelphone,,,,1,treble,treble,C4,,,,,+wind.reed.heckelphone-clarinet,,,,1,treble,treble,C4,,,,,+wind.reed.heckelphone.piccolo,,,,1,treble,treble,C4,,,,,+wind.reed.hichiriki,,,,1,treble,treble,C4,,,,,+wind.reed.hirtenschalmei,,,,1,treble,treble,C4,,,,,+wind.reed.hne,,,,1,treble,treble,C4,,,,,+wind.reed.hornpipe,,,,1,treble,treble,C4,,,,,+wind.reed.houguan,,,,1,treble,treble,C4,,,,,+wind.reed.hulusi,,,,1,treble,treble,C4,,,,,+wind.reed.jogi-baja,,,,1,treble,treble,C4,,,,,+wind.reed.ken-bau,,,,1,treble,treble,C4,,,,,+wind.reed.khaen-mouth-organ,,,,1,treble,treble,C4,,,,,+wind.reed.launeddas,,,,1,treble,treble,C4,,,,,+wind.reed.maqrunah,,,,1,treble,treble,C4,,,,,+wind.reed.melodica,,,,1,treble,treble,C4,,,,,+wind.reed.mijwiz,,,,1,treble,treble,C4,,,,,+wind.reed.mizmar,,,,1,treble,treble,C4,,,,,+wind.reed.nadaswaram,,,,1,treble,treble,C4,,,,,+wind.reed.octavin,,,,1,treble,treble,C4,,,,,+wind.reed.pi,,,,1,treble,treble,C4,,,,,+wind.reed.pibgorn,,,,1,treble,treble,C4,,,,,+wind.reed.piri,,,,1,treble,treble,C4,,,,,+wind.reed.rackett,,,,1,treble,treble,C4,,,,,+wind.reed.rauschpfeife,,,,1,treble,treble,C4,,,,,+wind.reed.rhaita,,,,1,treble,treble,C4,,,,,+wind.reed.rothphone,,,,1,treble,treble,C4,,,,,+wind.reed.sarrusaphone,,,,1,treble,treble,C4,,,,,+wind.reed.saxonette,,,,1,treble,treble,C4,,,,,+wind.reed.shawm,,,,1,treble,treble,C4,,,,,+wind.reed.shenai,112,,,1,treble,treble,C4,,,,,+wind.reed.sheng,,,,1,treble,treble,C4,,,,,+wind.reed.sipsi,,,,1,treble,treble,C4,,,,,+wind.reed.sopila,,,,1,treble,treble,C4,,,,,+wind.reed.sorna,,,,1,treble,treble,C4,,,,,+wind.reed.sralai,,,,1,treble,treble,C4,,,,,+wind.reed.suona,,,,1,treble,treble,C4,,,,,+wind.reed.surnai,,,,1,treble,treble,C4,,,,,+wind.reed.taepyeongso,,,,1,treble,treble,C4,,,,,+wind.reed.tarogato,,,,1,treble,treble,C4,,,,,+wind.reed.tarogato.ancient,,,,1,treble,treble,C4,,,,,+wind.reed.trompeta-china,,,,1,treble,treble,C4,,,,,+wind.reed.tubax,,,,1,treble,treble,C4,,,,,+wind.reed.xaphoon,,,,1,treble,treble,C4,,,,,+wind.reed.zhaleika,,,,1,treble,treble,C4,,,,,+wind.reed.zurla,,,,1,treble,treble,C4,,,,,+wind.reed.zurna,,,,1,treble,treble,C4,,,,,+wind.flutes.flute.piccolo,73,,,1.1,treble,treble,C5,D5-B6,,Piccolo Flute,,Piccolo+wind.flutes.flute,74,,,1.2,treble,treble,C4,C4-B6,,Flute,,+wind.flutes.flute.alto,,,,1.25,treble,treble,G3,G3-D6,,Alto Flute,,+wind.flutes.flute.x.bass,,,,1.26,treble,treble,C3,C3-C5,,Bass Flute,,+wind.reed.oboe-da-caccia,,,,1.3,treble,treble,C4,,,,,+wind.reed.oboe.piccolo,,,,1.31,treble,treble,C4,,,Piccolo Oboe,,+wind.reed.oboe,69,,1,1.35,treble,treble,C4,D4-F6,,Oboe,,+wind.reed.oboe-damore,,,,1.36,treble,treble,A3,,,Oboe d'Amore,,+wind.reed.english-horn,70,,1,1.37,treble,treble,F3,G3-C6,,English Horn,,+wind.reed.oboe.bass,,,,1.38,treble,treble,C3,,,Bass Oboe,,+wind.reed.saxophone,,,,1.5,treble,treble,Bb3,,,Saxophone,,+wind.reed.saxophone.aulochrome,,,,1.5,treble,treble,Bb3,,,,,+wind.reed.saxophone.melody,,,,1.5,treble,treble,Bb3,,,,,+wind.reed.saxophone.sopranissimo,,,,1.501,treble,treble,Bb4,,,Sopranissimo Saxophone,,+wind.reed.saxophone.sopranino,,,,1.5015,treble,treble,Eb4,,,Sopranino Saxophone,,+wind.reed.saxophone.soprano,65,,,1.502,treble,treble,Bb3,,,Soprano Saxophone,,+wind.reed.saxophone.mezzo-soprano,,,,1.5025,treble,treble,F3,,,Mezzo-soprano Saxophone,,+wind.reed.saxophone.alto,66,,,1.503,treble,treble,Eb3,,,Alto Saxophone,,+wind.reed.saxophone.tenor,67,,,1.504,treble,treble,Bb2,,,Tenor Saxophone,,+wind.reed.saxophone.baritone,68,,,1.505,treble,treble,Eb2,,,Baritone Saxophone,,+wind.reed.saxophone.bass,,,,1.506,treble,treble,Bb1,,,Bass Saxophone,,+wind.reed.saxophone.contrabass,,,,1.507,treble,treble,Eb1,,,Contrabass Saxophone,,+wind.reed.saxophone.subcontrabass,,,,1.508,treble,treble,Bb0,,,Subcontrabass Saxophone,,+wind.reed.chalumeau,,,,1.6,treble,treble,C4,,,,,+wind.reed.clarinette-damour,,,,1.6,treble,treble,C4,,,,,+wind.reed.clarinet.piccolo.aflat,,,,1.601,treble,treble,Ab4,,,Piccolo Clarinet,,Piccolo Clarinet+wind.reed.clarinet.eflat,,,,1.61,treble,treble,Eb4,G3-Bb6,,Clarinet in Eb, ,Clarinet in Eb+wind.reed.clarinet,,,2,1.64,treble,treble,Bb3,,,Clarinet,,Clarinet+wind.reed.clarinet.bflat,72,,2,1.64,treble,treble,Bb3,D3-Eb6,,Clarinet in Bb,,Clarinet in Bb+wind.reed.clarinet.a,,,2,1.65,treble,treble,A3,,,Clarinet in A,,Clarinet in A+wind.reed.clarinet.alto,,,2,1.67,treble,treble,Eb3,,,Alto Clarinet,,Alto Clarinet+wind.reed.basset-horn,,,,1.68,treble,treble,F3,,,Basset Horn,,Basset Horn+wind.reed.clarinet.basset,,,2,1.68,treble,treble,F3,,,Basset Clarinet,,Basset Clarinet+wind.reed.clarinet.bass,,,,1.69,treble,treble,Bb2,D2-Eb5,,Bass Clarinet,,Bass Clarinet+wind.reed.clarinet.contra-alto,,,,1.694,treble,treble,Eb2,,,Contra-alto Clarinet,,Contra-alto Clarinet+wind.reed.clarinet.contrabass,,,,1.695,treble,treble,Bb1,,,Contrabass Clarinet,,Contrabass Clarinet+wind.reed.bassoon,71,,3,1.7,"treble,ten,bass",bass,C4,Bb1-D5,,Bassoon,,+wind.reed.contrabassoon,,,,1.75,"treble,ten,bass",bass,C3,Bb0-G5,,Contrabassoon,,+brass.alphorn,,,,2,treble,treble,C4,,,,,+brass.alto-horn,,,,2,treble,treble,Eb3,,,,,+brass.baritone-horn,,,,2,treble,treble,Bb2,,,,,+brass.bugle,,,,2,treble,treble,C4,,,,,+brass.bugle.alto,,,,2,treble,treble,C4,,,,,+brass.bugle.baritone,,,,2,treble,treble,C4,,,,,+brass.bugle.contrabass,,,,2,treble,bass,C4,,,,,+brass.bugle.euphonium-bugle,,,,2,treble,treble,C4,,,,,+brass.bugle.mellophone-bugle,,,,2,treble,treble,C4,,,,,+brass.bugle.soprano,,,,2,treble,treble,C4,,,,,+brass.cimbasso,,,,2,treble,treble,C4,,,,,+brass.conch-shell,,,,2,treble,treble,C4,,,,,+brass.didgeridoo,,,,2,treble,treble,C4,,,,,+brass.fiscorn,,,,2,treble,treble,C4,,,,,+brass.group,62,,,2,treble,treble,C4,,,,,+brass.group.synth,"63,64",,,2,treble,treble,C4,,,,,+brass.helicon,,,,2,treble,treble,C4,,,,,+brass.horagai,,,,2,treble,treble,C4,,,,,+brass.kuhlohorn,,,,2,treble,treble,C4,,,,,+brass.mellophone,,,,2,treble,treble,C4,,,,,+brass.natural-horn,,,,2,treble,treble,C4,,,,,+brass.ophicleide,,,,2,treble,treble,C4,,,,,+brass.posthorn,,,,2,treble,treble,C4,,,,,+brass.rag-dung,,,,2,treble,treble,C4,,,,,+brass.sackbutt,,,,2,treble,treble,C4,,,,,+brass.sackbutt.alto,,,,2,treble,treble,C4,,,,,+brass.sackbutt.bass,,,,2,treble,treble,C4,,,,,+brass.sackbutt.tenor,,,,2,treble,treble,C4,,,,,+brass.saxhorn,,,,2,treble,treble,C4,,,,,+brass.serpent,,,,2,treble,treble,C4,,,,,+brass.shofar,,,,2,treble,treble,C4,,,,,+brass.sousaphone,,,,2,treble,treble,C4,,,,,+brass.vienna-horn,,,,2,treble,treble,C4,,,,,+brass.vuvuzela,,,,2,treble,treble,C4,,,,,+brass.french-horn,61,,4,2.1,treble,treble,F3,C2-C5,,Horn,,Horn in F+brass.wagner-tuba,,,,2.15,bass,bass,C4,,,,,+brass.trumpet,"57,60",,5,2.2,treble,treble,Bb3,G3-Bb5,,Trumpet,,Trumpet in Bb+brass.trumpet.baroque,,,,2.2,treble,treble,Bb3,,,,,+brass.trumpet.pocket,,,,2.2,treble,treble,Bb3,,,,,+brass.trumpet.slide,,,,2.2,treble,treble,Bb3,,,,,+brass.trumpet.piccolo,,,,2.201,treble,treble,Bb4,,,Piccolo Trumpet,,+brass.trumpet.d,,,,2.21,treble,treble,D4,G3-Bb5,,Trumpet in D,,+brass.trumpet.c,,,,2.22,treble,treble,C4,G3-Bb5,,Trumpet in C,,+brass.trumpet.bflat,,,,2.23,treble,treble,Bb3,G3-Bb5,,Trumpet in Bb,,+brass.cornet,,,,2.24,treble,treble,Bb3,,,Cornet,,+brass.cornet.soprano,,,,2.24,treble,treble,Eb4,,,Soprano Cornet,,+brass.cornett,,,,2.24,treble,treble,C4,,,,,+brass.cornett.tenor,,,,2.24,treble,treble,C4,,,,,+brass.cornettino,,,,2.24,treble,treble,C4,,,,,+brass.flugelhorn,,,,2.24,treble,treble,Bb3,,,Flugelhorn,,+brass.trumpet.tenor,,,,2.28,treble,treble,Bb3,,,Tenor Trumpet,,+brass.trumpet.bass,,,,2.29,treble,treble,Eb3,,,Bass Trumpet,,+brass.trombone,58,,6,2.3,"ten,bass",bass,C4,E2-C5,,Trombone,,+brass.trombone.alto,,,,2.31,"alto,ten,bass",alto,C4,,,Alto Trombone,,+brass.trombone.tenor,,,,2.32,"ten,bass",bass,C4,E2-C5,,Trombone,,+brass.trombone.bass,,,,2.34,"ten,bass",bass,C4,E1-G4,,Bass Trombone,,+brass.trombone.contrabass,,,,2.35,"ten,bass",bass,C4,,,Contrabass Trombone,,+brass.euphonium,,,,2.401,treble,treble,C4,,,,,+brass.tuba,59,,7,2.41,bass,bass,C4,C2-A4,,Tuba,,+brass.tuba.bass,,,,2.41,bass,bass,C4,C2-A4,,Tuba,,+brass.tuba.subcontrabass,,,,2.42,bass,bass,C4,,,Subcontrabass Tuba,,+drum.timpani,48,,8,3,bass,bass,C4,C2-C4,,Timpani,,+drum.apentemma,,,,4,perc,perc,C4,,,,,+drum.ashiko,,,,4,perc,perc,C4,,,,,+drum.atabaque,,,,4,perc,perc,C4,,,,,+drum.atoke,,,,4,perc,perc,C4,,,,,+drum.atsimevu,,,,4,perc,perc,C4,,,,,+drum.axatse,,,,4,perc,perc,C4,,,,,+drum.bass-drum,,"35,36",,4,perc,perc,C4,,,,,+drum.bata,,,,4,perc,perc,C4,,,,,+drum.bata.itotele,,,,4,perc,perc,C4,,,,,+drum.bata.iya,,,,4,perc,perc,C4,,,,,+drum.bata.okonkolo,,,,4,perc,perc,C4,,,,,+drum.bendir,,,,4,perc,perc,C4,,,,,+drum.bodhran,,,,4,perc,perc,C4,,,,,+drum.bombo,,,,4,perc,perc,C4,,,,,+drum.bongo,,"60,61",,4,perc,perc,C4,,,,,+drum.bougarabou,,,,4,perc,perc,C4,,,,,+drum.buffalo-drum,,,,4,perc,perc,C4,,,,,+drum.cajon,,,,4,perc,perc,C4,,,,,+drum.chenda,,,,4,perc,perc,C4,,,,,+drum.chu-daiko,,,,4,perc,perc,C4,,,,,+drum.conga,,"62,63,64",,4,perc,perc,C4,,,,,+drum.cuica,,"78,79",,4,perc,perc,C4,,,,,+drum.dabakan,,,,4,perc,perc,C4,,,,,+drum.daff,,,,4,perc,perc,C4,,,,,+drum.dafli,,,,4,perc,perc,C4,,,,,+drum.daibyosi,,,,4,perc,perc,C4,,,,,+drum.damroo,,,,4,perc,perc,C4,,,,,+drum.darabuka,,,,4,perc,perc,C4,,,,,+drum.def,,,,4,perc,perc,C4,,,,,+drum.dhol,,,,4,perc,perc,C4,,,,,+drum.dholak,,,,4,perc,perc,C4,,,,,+drum.djembe,,,,4,perc,perc,C4,,,,,+drum.doira,,,,4,perc,perc,C4,,,,,+drum.dondo,,,,4,perc,perc,C4,,,,,+drum.doun-doun-ba,,,,4,perc,perc,C4,,,,,+drum.duff,,,,4,perc,perc,C4,,,,,+drum.dumbek,,,,4,perc,perc,C4,,,,,+drum.fontomfrom,,,,4,perc,perc,C4,,,,,+drum.frame-drum,,,,4,perc,perc,C4,,,,,+drum.frame-drum.arabian,,,,4,perc,perc,C4,,,,,+drum.geduk,,,,4,perc,perc,C4,,,,,+drum.ghatam,,,,4,perc,perc,C4,,,,,+drum.gome,,,,4,perc,perc,C4,,,,,+drum.group,,,,4,perc,perc,C4,,,,,+drum.group.chinese,,,,4,perc,perc,C4,,,,,+drum.group.ewe,,,,4,perc,perc,C4,,,,,+drum.group.indian,,,,4,perc,perc,C4,,,,,+drum.group.set,,,,4,perc,perc,C4,,,,,+drum.hand-drum,,,,4,perc,perc,C4,,,,,+drum.hira-daiko,,,,4,perc,perc,C4,,,,,+drum.ibo,,,,4,perc,perc,C4,,,,,+drum.igihumurizo,,,,4,perc,perc,C4,,,,,+drum.inyahura,,,,4,perc,perc,C4,,,,,+drum.ishakwe,,,,4,perc,perc,C4,,,,,+drum.jang-gu,,,,4,perc,perc,C4,,,,,+drum.kagan,,,,4,perc,perc,C4,,,,,+drum.kakko,,,,4,perc,perc,C4,,,,,+drum.kanjira,,,,4,perc,perc,C4,,,,,+drum.kendhang,,,,4,perc,perc,C4,,,,,+drum.kendhang.ageng,,,,4,perc,perc,C4,,,,,+drum.kendhang.ciblon,,,,4,perc,perc,C4,,,,,+drum.kenkeni,,,,4,perc,perc,C4,,,,,+drum.khol,,,,4,perc,perc,C4,,,,,+drum.kick-drum,,,,4,perc,perc,C4,,,,,+drum.kidi,,,,4,perc,perc,C4,,,,,+drum.ko-daiko,,,,4,perc,perc,C4,,,,,+drum.kpanlogo,,,,4,perc,perc,C4,,,,,+drum.kudum,,,,4,perc,perc,C4,,,,,+drum.lambeg,,,,4,perc,perc,C4,,,,,+drum.lion-drum,,,,4,perc,perc,C4,,,,,+drum.log-drum,,,,4,perc,perc,C4,,,,,+drum.log-drum.african,,,,4,perc,perc,C4,,,,,+drum.log-drum.native,,,,4,perc,perc,C4,,,,,+drum.log-drum.nigerian,,,,4,perc,perc,C4,,,,,+drum.madal,,,,4,perc,perc,C4,,,,,+drum.maddale,,,,4,perc,perc,C4,,,,,+drum.mridangam,,,,4,perc,perc,C4,,,,,+drum.naal,,,,4,perc,perc,C4,,,,,+drum.nagado-daiko,,,,4,perc,perc,C4,,,,,+drum.nagara,,,,4,perc,perc,C4,,,,,+drum.naqara,,,,4,perc,perc,C4,,,,,+drum.o-daiko,,,,4,perc,perc,C4,,,,,+drum.okawa,,,,4,perc,perc,C4,,,,,+drum.okedo-daiko,,,,4,perc,perc,C4,,,,,+drum.pahu-hula,,,,4,perc,perc,C4,,,,,+drum.pakhawaj,,,,4,perc,perc,C4,,,,,+drum.pandeiro,,,,4,perc,perc,C4,,,,,+drum.pandero,,,,4,perc,perc,C4,,,,,+drum.powwow,,,,4,perc,perc,C4,,,,,+drum.pueblo,,,,4,perc,perc,C4,,,,,+drum.repinique,,,,4,perc,perc,C4,,,,,+drum.riq,,,,4,perc,perc,C4,,,,,+drum.rototom,,,,4,perc,perc,C4,,,,,+drum.sabar,,,,4,perc,perc,C4,,,,,+drum.sakara,,,,4,perc,perc,C4,,,,,+drum.sampho,,,,4,perc,perc,C4,,,,,+drum.sangban,,,,4,perc,perc,C4,,,,,+drum.shime-daiko,,,,4,perc,perc,C4,,,,,+drum.slit-drum,,,,4,perc,perc,C4,,,,,+drum.slit-drum.krin,,,,4,perc,perc,C4,,,,,+drum.snare-drum,,"38,40,37",,4,perc,perc,C4,,,,,+drum.snare-drum.electric,,,,4,perc,perc,C4,,,,,+drum.sogo,,,,4,perc,perc,C4,,,,,+drum.surdo,,,,4,perc,perc,C4,,,,,+drum.tabla,,,,4,perc,perc,C4,,,,,+drum.tabla.bayan,,,,4,perc,perc,C4,,,,,+drum.tabla.dayan,,,,4,perc,perc,C4,,,,,+drum.taiko,117,,,4,perc,perc,C4,,,,,+drum.talking,,,,4,perc,perc,C4,,,,,+drum.tama,,,,4,perc,perc,C4,,,,,+drum.tamborita,,,,4,perc,perc,C4,,,,,+drum.tambourine,,54,,4,perc,perc,C4,,,,,+drum.tamte,,,,4,perc,perc,C4,,,,,+drum.tan-tan,,,,4,perc,perc,C4,,,,,+drum.tangku,,,,4,perc,perc,C4,,,,,+drum.taphon,,,,4,perc,perc,C4,,,,,+drum.tar,,,,4,perc,perc,C4,,,,,+drum.tasha,,,,4,perc,perc,C4,,,,,+drum.tenor-drum,,,,4,perc,perc,C4,,,,,+drum.teponaxtli,,,,4,perc,perc,C4,,,,,+drum.thavil,,,,4,perc,perc,C4,,,,,+drum.the-box,,,,4,perc,perc,C4,,,,,+drum.timbale,,"65,66",,4,perc,perc,C4,,,,,+drum.tinaja,,,,4,perc,perc,C4,,,,,+drum.toere,,,,4,perc,perc,C4,,,,,+drum.tom-tom,118,"41,43,45,47,48,50",,4,perc,perc,C4,,,,,+drum.tom-tom.synth,119,,,4,perc,perc,C4,,,,,+drum.tombak,,,,4,perc,perc,C4,,,,,+drum.tsuzumi,,,,4,perc,perc,C4,,,,,+drum.tumbak,,,,4,perc,perc,C4,,,,,+drum.uchiwa-daiko,,,,4,perc,perc,C4,,,,,+drum.udaku,,,,4,perc,perc,C4,,,,,+drum.udu,,,,4,perc,perc,C4,,,,,+drum.zarb,,,,4,perc,perc,C4,,,,,+effect.aeolian-harp,,,,4,perc,perc,C4,,,,,+effect.air-horn,,,,4,perc,perc,C4,,,,,+effect.applause,127,,,4,perc,perc,C4,,,,,+effect.bass-string-slap,,,,4,perc,perc,C4,,,,,+effect.bird,,,,4,perc,perc,C4,,,,,+effect.bird.nightingale,,,,4,perc,perc,C4,,,,,+effect.bird.tweet,124,,,4,perc,perc,C4,,,,,+effect.breath,122,,,4,perc,perc,C4,,,,,+effect.bubble,,,,4,perc,perc,C4,,,,,+effect.bullroarer,,,,4,perc,perc,C4,,,,,+effect.burst,,,,4,perc,perc,C4,,,,,+effect.car,,,,4,perc,perc,C4,,,,,+effect.car.crash,,,,4,perc,perc,C4,,,,,+effect.car.engine,,,,4,perc,perc,C4,,,,,+effect.car.pass,,,,4,perc,perc,C4,,,,,+effect.car.stop,,,,4,perc,perc,C4,,,,,+effect.crickets,,,,4,perc,perc,C4,,,,,+effect.dog,,,,4,perc,perc,C4,,,,,+effect.door.creak,,,,4,perc,perc,C4,,,,,+effect.door.slam,,,,4,perc,perc,C4,,,,,+effect.explosion,,,,4,perc,perc,C4,,,,,+effect.flute-key-click,,,,4,perc,perc,C4,,,,,+effect.footsteps,,,,4,perc,perc,C4,,,,,+effect.frogs,,,,4,perc,perc,C4,,,,,+effect.guitar-cutting,,,,4,perc,perc,C4,,,,,+effect.guitar-fret,121,,,4,perc,perc,C4,,,,,+effect.gunshot,128,,,4,perc,perc,C4,,,,,+effect.hand-clap,,39,,4,perc,perc,C4,,,,,+effect.heartbeat,,,,4,perc,perc,C4,,,,,+effect.helicopter,126,,,4,perc,perc,C4,,,,,+effect.high-q,,,,4,perc,perc,C4,,,,,+effect.horse-gallop,,,,4,perc,perc,C4,,,,,+effect.jet-plane,,,,4,perc,perc,C4,,,,,+effect.laser-gun,,,,4,perc,perc,C4,,,,,+effect.laugh,,,,4,perc,perc,C4,,,,,+effect.lions-roar,,,,4,perc,perc,C4,,,,,+effect.machine-gun,,,,4,perc,perc,C4,,,,,+effect.marching-machine,,,,4,perc,perc,C4,,,,,+effect.metronome-bell,,,,4,perc,perc,C4,,,,,+effect.metronome-click,,,,4,perc,perc,C4,,,,,+effect.pat,,,,4,perc,perc,C4,,,,,+effect.punch,,,,4,perc,perc,C4,,,,,+effect.rain,97,,,4,perc,perc,C4,,,,,+effect.scratch,,,,4,perc,perc,C4,,,,,+effect.scream,"56,98,99,100,101,102,103,104",,,4,perc,perc,C4,,,,,+effect.seashore,123,,,4,perc,perc,C4,,,,,+effect.siren,,,,4,perc,perc,C4,,,,,+effect.slap,,,,4,perc,perc,C4,,,,,+effect.snap,,,,4,perc,perc,C4,,,,,+effect.stamp,,,,4,perc,perc,C4,,,,,+effect.starship,,,,4,perc,perc,C4,,,,,+effect.stream,,,,4,perc,perc,C4,,,,,+effect.telephone-ring,125,,,4,perc,perc,C4,,,,,+effect.thunder,,,,4,perc,perc,C4,,,,,+effect.train,,,,4,perc,perc,C4,,,,,+effect.trash-can,,,,4,perc,perc,C4,,,,,+effect.whip,,,,4,perc,perc,C4,,,,,+effect.whistle,,"71,72",,4,perc,perc,C4,,,,,+effect.whistle.mouth-siren,,,,4,perc,perc,C4,,,,,+effect.whistle.police,,,,4,perc,perc,C4,,,,,+effect.whistle.slide,,,,4,perc,perc,C4,,,,,+effect.whistle.train,,,,4,perc,perc,C4,,,,,+effect.wind,,,,4,perc,perc,C4,,,,,+metal.adodo,,,,4,perc,perc,C4,,,,,+metal.anvil,,,,4,perc,perc,C4,,,,,+metal.babendil,,,,4,perc,perc,C4,,,,,+metal.bells.agogo,,"67,68",,4,perc,perc,C4,,,,,+metal.bells.almglocken,,,,4,perc,perc,C4,,,,,+metal.bells.bell-plate,,,,4,perc,perc,C4,,,,,+metal.bells.bell-tree,,,,4,perc,perc,C4,,,,,+metal.bells.carillon,,,,4,perc,perc,C4,,,,,+metal.bells.chimes,,,,4,perc,perc,C4,,,,,+metal.bells.chimta,,,,4,perc,perc,C4,,,,,+metal.bells.chippli,,,,4,perc,perc,C4,,,,,+metal.bells.church,,,,4,perc,perc,C4,,,,,+metal.bells.cowbell,,56,,4,perc,perc,C4,,,,,+metal.bells.dawuro,,,,4,perc,perc,C4,,,,,+metal.bells.gankokwe,,,,4,perc,perc,C4,,,,,+metal.bells.ghungroo,,,,4,perc,perc,C4,,,,,+metal.bells.hatheli,,,,4,perc,perc,C4,,,,,+metal.bells.jingle-bell,,,,4,perc,perc,C4,,,,,+metal.bells.khartal,,,,4,perc,perc,C4,,,,,+metal.bells.mark-tree,,,,4,perc,perc,C4,,,,,+metal.bells.sistrum,,,,4,perc,perc,C4,,,,,+metal.bells.sleigh-bells,,,,4,perc,perc,C4,,,,,+metal.bells.temple,,,,4,perc,perc,C4,,,,,+metal.bells.tibetan,,,,4,perc,perc,C4,,,,,+metal.bells.tinklebell,113,,,4,perc,perc,C4,,,,,+metal.bells.trychel,,,,4,perc,perc,C4,,,,,+metal.bells.wind-chimes,,,,4,perc,perc,C4,,,,,+metal.bells.zills,,,,4,perc,perc,C4,,,,,+metal.berimbau,,,,4,perc,perc,C4,,,,,+metal.brake-drums,,,,4,perc,perc,C4,,,,,+metal.crotales,,,,4,perc,perc,C6,,,,,+metal.cymbal.bo,,,,4,perc,perc,C4,,,,,+metal.cymbal.ceng-ceng,,,,4,perc,perc,C4,,,,,+metal.cymbal.chabara,,,,4,perc,perc,C4,,,,,+metal.cymbal.chinese,,,,4,perc,perc,C4,,,,,+metal.cymbal.ching,,,,4,perc,perc,C4,,,,,+metal.cymbal.clash,,,,4,perc,perc,C4,,,,,+metal.cymbal.crash,,"49,57",,4,perc,perc,C4,,,,,+metal.cymbal.finger,,,,4,perc,perc,C4,,,,,+metal.cymbal.hand,,,,4,perc,perc,C4,,,,,+metal.cymbal.kesi,,,,4,perc,perc,C4,,,,,+metal.cymbal.manjeera,,,,4,perc,perc,C4,,,,,+metal.cymbal.reverse,120,,,4,perc,perc,C4,,,,,+metal.cymbal.ride,,"51,59,53",,4,perc,perc,C4,,,,,+metal.cymbal.sizzle,,,,4,perc,perc,C4,,,,,+metal.cymbal.splash,,55,,4,perc,perc,C4,,,,,+metal.cymbal.suspended,,,,4,perc,perc,C4,,,,,+metal.cymbal.tebyoshi,,,,4,perc,perc,C4,,,,,+metal.cymbal.tibetan,,,,4,perc,perc,C4,,,,,+metal.cymbal.tingsha,,,,4,perc,perc,C4,,,,,+metal.flexatone,,,,4,perc,perc,C4,,,,,+metal.gong,,,,4,perc,perc,C4,,,,,+metal.gong.ageng,,,,4,perc,perc,C4,,,,,+metal.gong.agung,,,,4,perc,perc,C4,,,,,+metal.gong.chanchiki,,,,4,perc,perc,C4,,,,,+metal.gong.chinese,,52,,4,perc,perc,C4,,,,,+metal.gong.gandingan,,,,4,perc,perc,C4,,,,,+metal.gong.kempul,,,,4,perc,perc,C4,,,,,+metal.gong.kempyang,,,,4,perc,perc,C4,,,,,+metal.gong.ketuk,,,,4,perc,perc,C4,,,,,+metal.gong.kkwenggwari,,,,4,perc,perc,C4,,,,,+metal.gong.luo,,,,4,perc,perc,C4,,,,,+metal.gong.singing,,,,4,perc,perc,C4,,,,,+metal.gong.thai,,,,4,perc,perc,C4,,,,,+metal.guira,,,,4,perc,perc,C4,,,,,+metal.hang,,,,4,perc,perc,C4,,,,,+metal.hi-hat,,"42,44,46",,4,perc,perc,C4,,,,,+metal.jaw-harp,,,,4,perc,perc,C4,,,,,+metal.kengong,,,,4,perc,perc,C4,,,,,+metal.murchang,,,,4,perc,perc,C4,,,,,+metal.musical-saw,,,,4,perc,perc,C4,,,,,+metal.singing-bowl,,,,4,perc,perc,C4,,,,,+metal.spoons,,,,4,perc,perc,C4,,,,,+metal.steel-drums,115,,,4,perc,perc,C4,,,,,+metal.tamtam,,,,4,perc,perc,C4,,,,,+metal.thundersheet,,,,4,perc,perc,C4,,,,,+metal.triangle,,"80,81",,4,perc,perc,C4,,,,,+metal.washboard,,,,4,perc,perc,C4,,,,,+rattle.afoxe,,,,4,perc,perc,C4,,,,,+rattle.birds,,,,4,perc,perc,C4,,,,,+rattle.cabasa,,69,,4,perc,perc,C4,,,,,+rattle.caxixi,,,,4,perc,perc,C4,,,,,+rattle.cog,,,,4,perc,perc,C4,,,,,+rattle.ganza,,,,4,perc,perc,C4,,,,,+rattle.hosho,,,,4,perc,perc,C4,,,,,+rattle.jawbone,,,,4,perc,perc,C4,,,,,+rattle.kayamba,,,,4,perc,perc,C4,,,,,+rattle.kpoko-kpoko,,,,4,perc,perc,C4,,,,,+rattle.lava-stones,,,,4,perc,perc,C4,,,,,+rattle.maraca,,70,,4,perc,perc,C4,,,,,+rattle.rain-stick,,,,4,perc,perc,C4,,,,,+rattle.ratchet,,,,4,perc,perc,C4,,,,,+rattle.rattle,,,,4,perc,perc,C4,,,,,+rattle.shaker,,,,4,perc,perc,C4,,,,,+rattle.shaker.egg,,,,4,perc,perc,C4,,,,,+rattle.shekere,,,,4,perc,perc,C4,,,,,+rattle.sistre,,,,4,perc,perc,C4,,,,,+rattle.televi,,,,4,perc,perc,C4,,,,,+rattle.vibraslap,,58,,4,perc,perc,C4,,,,,+rattle.wasembe,,,,4,perc,perc,C4,,,,,+wood.agogo-block,114,,,4,perc,perc,C4,,,,,+wood.agung-a-tamlang,,,,4,perc,perc,C4,,,,,+wood.ahoko,,,,4,perc,perc,C4,,,,,+wood.bones,,,,4,perc,perc,C4,,,,,+wood.castanets,,,,4,perc,perc,C4,,,,,+wood.claves,,75,,4,perc,perc,C4,,,,,+wood.drum-sticks,,,,4,perc,perc,C4,,,,,+wood.gourd,,,,4,perc,perc,C4,,,,,+wood.granite-block,,,,4,perc,perc,C4,,,,,+wood.guban,,,,4,perc,perc,C4,,,,,+wood.guiro,,"73,74",,4,perc,perc,C4,,,,,+wood.hyoushigi,,,,4,perc,perc,C4,,,,,+wood.ipu,,,,4,perc,perc,C4,,,,,+wood.jam-block,,,,4,perc,perc,C4,,,,,+wood.kaekeeke,,,,4,perc,perc,C4,,,,,+wood.kagul,,,,4,perc,perc,C4,,,,,+wood.kalaau,,,,4,perc,perc,C4,,,,,+wood.kashiklar,,,,4,perc,perc,C4,,,,,+wood.kubing,,,,4,perc,perc,C4,,,,,+wood.pan-clappers,,,,4,perc,perc,C4,,,,,+wood.sand-block,,,,4,perc,perc,C4,,,,,+wood.slapstick,,,,4,perc,perc,C4,,,,,+wood.stir-drum,,,,4,perc,perc,C4,,,,,+wood.temple-block,,,,4,perc,perc,C4,,,,,+wood.tic-toc-block,,,,4,perc,perc,C4,,,,,+wood.tonetang,,,,4,perc,perc,C4,,,,,+wood.wood-block,116,"76,77",,4,perc,perc,C4,,,,,+pitched-percussion.angklung,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.balafon,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.bell-lyre,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.bells,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.bianqing,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.bianzhong,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.bonang,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.cimbalom,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.crystal-glasses,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.dan-tam-thap-luc,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.fangxiang,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.gandingan-a-kayo,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.gangsa,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.gender,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.giying,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.glass-harmonica,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.glockenspiel,10,,,4.1,treble,treble,C6,,,Glockenspiel,,+pitched-percussion.glockenspiel.alto,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.glockenspiel.soprano,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.gyil,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.hammer-dulcimer,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.handbells,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.kalimba,109,,,4.1,treble,treble,C4,,,,,+pitched-percussion.kantil,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.khim,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.kulintang,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.kulintang-a-kayo,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.kulintang-a-tiniok,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.likembe,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.luntang,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.marimba,13,,,4.1,treble,treble,C4,,,Marimba,,+pitched-percussion.marimba.bass,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.mbira,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.mbira.array,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.metallophone,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.metallophone.alto,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.metallophone.bass,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.metallophone.soprano,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.music-box,11,,,4.1,treble,treble,C4,,,Music Box,,+pitched-percussion.pelog-panerus,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.pemade,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.penyacah,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.ranat.ek,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.ranat.ek-lek,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.ranat.thum,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.ranat.thum-lek,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.reyong,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.sanza,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.saron-barung,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.saron-demong,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.saron-panerus,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.slendro-panerus,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.slentem,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.tsymbaly,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.tubes,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.tubular-bells,15,,,4.1,treble,treble,C4,,,Tubular Bells,,+pitched-percussion.vibraphone,12,,,4.1,treble,treble,C4,F3-F6,,Vibraphone,,+pitched-percussion.xylophone,14,,,4.1,treble,treble,C4,,,Xylophone,,+pitched-percussion.xylophone.alto,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.xylophone.bass,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.xylophone.soprano,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.xylorimba,,,,4.1,treble,treble,C4,,,,,+pitched-percussion.yangqin,,,,4.1,treble,treble,C4,,,,,+keyboard.accordion,22,,,5,"treble,bass","treble,bass",C4,,,Accordion,,+keyboard.bandoneon,24,,,5,"treble,bass","treble,bass",C4,,,Bandoneon,,+keyboard.celesta,9,,,5,"treble,bass","treble,bass",C4,C2-C7,,Celesta,,+keyboard.clavichord,,,,5,"treble,bass","treble,bass",C4,,,,,+keyboard.clavichord.synth,,,,5,"treble,bass","treble,bass",C4,,,,,+keyboard.concertina,,,,5,"treble,bass","treble,bass",C4,,,,,+keyboard.fortepiano,,,,5,"treble,bass","treble,bass",C4,,,,,+keyboard.harmonium,,,,5,"treble,bass","treble,bass",C4,,,,,+keyboard.harpsichord,7,,,5,"treble,bass","treble,bass",C4,,,Harpsichord,,+keyboard.ondes-martenot,,,,5,"treble,bass","treble,bass",C4,,,,,+keyboard.organ,,,,5,"treble,bass","treble,treble,bass",C4,,,,,+keyboard.organ.drawbar,17,,,5,"treble,bass","treble,treble,bass",C4,,,Drawbar Organ,,+keyboard.organ.percussive,"18,19",,,5,"treble,bass","treble,treble,bass",C4,,,Percussive Organ,,+keyboard.organ.pipe,20,,,5,"treble,bass","treble,treble,bass",C4,,,Organ,,+keyboard.organ.reed,21,,,5,"treble,bass","treble,treble,bass",C4,,,Reed Organ,,+keyboard.organ.rotary,,,,5,"treble,bass","treble,treble,bass",C4,,,,,+keyboard.piano,,,,5,"treble,bass","treble,bass",C4,A0-C8,,,,+keyboard.piano.electric,"3,5,6,8",,,5,"treble,bass","treble,bass",C4,A0-C8,,Electric Grand Piano,,+keyboard.piano.grand,"1,2",,0,5,"treble,bass","treble,bass",C4,A0-C8,,Acoustic Grand Piano,,Piano+keyboard.piano.honky-tonk,4,,,5,"treble,bass","treble,bass",C4,A0-C8,,Honky-tonk Piano,,+keyboard.piano.prepared,,,,5,"treble,bass","treble,bass",C4,A0-C8,,,,+keyboard.piano.toy,,,,5,"treble,bass","treble,bass",C4,,,,,+keyboard.piano.upright,,,,5,"treble,bass","treble,bass",C4,A0-C8,,,,+keyboard.virginal,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects.atmosphere,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects.brightness,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects.crystal,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects.echoes,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects.goblins,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects.rain,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects.sci-fi,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.effects.soundtrack,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.group,86,,,5,"treble,bass","treble,bass",C4,,,,,+synth.group.fifths,87,,,5,"treble,bass","treble,bass",C4,,,,,+synth.group.orchestra,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.pad,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.pad.bowed,"93,89",,,5,"treble,bass","treble,bass",C4,,,,,+synth.pad.choir,92,,,5,"treble,bass","treble,bass",C4,,,,,+synth.pad.halo,95,,,5,"treble,bass","treble,bass",C4,,,,,+synth.pad.metallic,94,,,5,"treble,bass","treble,bass",C4,,,,,+synth.pad.polysynth,91,,,5,"treble,bass","treble,bass",C4,,,,,+synth.pad.sweep,96,,,5,"treble,bass","treble,bass",C4,,,,,+synth.pad.warm,90,,,5,"treble,bass","treble,bass",C4,,,,,+synth.theremin,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.tone.sawtooth,82,,,5,"treble,bass","treble,bass",C4,,,,,+synth.tone.sine,,,,5,"treble,bass","treble,bass",C4,,,,,+synth.tone.square,81,,,5,"treble,bass","treble,bass",C4,,,,,+pluck.harp,47,,11,5.1,"treble,bass","treble,bass",C4,C2-C6,,Harp,,+pluck.archlute,,,,5.2,treble,treble,C4,,,,,+pluck.autoharp,,,,5.2,treble,treble,C4,,,,,+pluck.baglama,,,,5.2,treble,treble,C4,,,,,+pluck.bajo,,,,5.2,treble,treble,C4,,,,,+pluck.balalaika,,,,5.2,treble,treble,C4,,,,,+pluck.balalaika.alto,,,,5.2,treble,treble,C4,,,,,+pluck.balalaika.bass,,,,5.2,treble,treble,C4,,,,,+pluck.balalaika.contrabass,,,,5.2,treble,treble,C4,,,,,+pluck.balalaika.piccolo,,,,5.2,treble,treble,C4,,,,,+pluck.balalaika.prima,,,,5.2,treble,treble,C4,,,,,+pluck.balalaika.secunda,,,,5.2,treble,treble,C4,,,,,+pluck.bandola,,,,5.2,treble,treble,C4,,,,,+pluck.bandura,,,,5.2,treble,treble,C4,,,,,+pluck.bandurria,,,,5.2,treble,treble,C4,,,,,+pluck.banjo,106,,,5.2,treble,treble,C4,,,,,+pluck.banjo.tenor,,,,5.2,treble,treble,C4,,,,,+pluck.banjolele,,,,5.2,treble,treble,C4,,,,,+pluck.barbat,,,,5.2,treble,treble,C4,,,,,+pluck.bass,"37,38",,,5.2,bass,bass,C4,,,Bass,,+pluck.bass.acoustic,33,,,5.2,bass,bass,C4,,,Acoustic Bass,,+pluck.bass.bolon,,,,5.2,bass,bass,C4,,,,,+pluck.bass.electric,"34,35,37,38",,,5.2,bass,bass,C4,,,Electric Bass,,+pluck.bass.fretless,36,,,5.2,bass,bass,C4,,,Fretless Bass,,+pluck.bass.guitarron,,,,5.2,bass,bass,C4,,,,,+pluck.bass.synth,"39,40",,,5.2,bass,bass,C4,,,Synth Bass,,+pluck.bass.synth.lead,88,,,5.2,bass,bass,C4,,,,,+pluck.bass.washtub,,,,5.2,bass,bass,C4,,,,,+pluck.bass.whamola,,,,5.2,bass,bass,C4,,,,,+pluck.begena,,,,5.2,treble,treble,C4,,,,,+pluck.biwa,,,,5.2,treble,treble,C4,,,,,+pluck.bordonua,,,,5.2,treble,treble,C4,,,,,+pluck.bouzouki,,,,5.2,treble,treble,C4,,,,,+pluck.bouzouki.irish,,,,5.2,treble,treble,C4,,,,,+pluck.celtic-harp,,,,5.2,treble,treble,C4,,,,,+pluck.charango,,,,5.2,treble,treble,C4,,,,,+pluck.chitarra-battente,,,,5.2,treble,treble,C4,,,,,+pluck.cithara,,,,5.2,treble,treble,C4,,,,,+pluck.cittern,,,,5.2,treble,treble,C4,,,,,+pluck.cuatro,,,,5.2,treble,treble,C4,,,,,+pluck.dan-bau,,,,5.2,treble,treble,C4,,,,,+pluck.dan-nguyet,,,,5.2,treble,treble,C4,,,,,+pluck.dan-tranh,,,,5.2,treble,treble,C4,,,,,+pluck.dan-ty-ba,,,,5.2,treble,treble,C4,,,,,+pluck.diddley-bow,,,,5.2,treble,treble,C4,,,,,+pluck.domra,,,,5.2,treble,treble,C4,,,,,+pluck.domu,,,,5.2,treble,treble,C4,,,,,+pluck.dulcimer,16,,,5.2,treble,treble,C4,,,Dulcimer,,+pluck.dutar,,,,5.2,treble,treble,C4,,,,,+pluck.duxianqin,,,,5.2,treble,treble,C4,,,,,+pluck.ektara,,,,5.2,treble,treble,C4,,,,,+pluck.geomungo,,,,5.2,treble,treble,C4,,,,,+pluck.gottuvadhyam,,,,5.2,treble,treble,C4,,,,,+pluck.guitar,,,,5.2,treble,treble,C3,,,,,+pluck.guitar.acoustic,25,,,5.2,treble,treble,C3,,,Acoustic Guitar,,+pluck.guitar.electric,"27,28,29,30,31,32",,,5.2,treble,treble,C3,,,Electric Guitar,,+pluck.guitar.nylon-string,,,,5.2,treble,treble,C3,,,,,+pluck.guitar.pedal-steel,,,,5.2,treble,treble,C3,,,,,+pluck.guitar.portuguese,,,,5.2,treble,treble,C3,,,,,+pluck.guitar.requinto,,,,5.2,treble,treble,C3,,,,,+pluck.guitar.resonator,,,,5.2,treble,treble,C3,,,,,+pluck.guitar.steel-string,26,,,5.2,treble,treble,C3,,,Steel-String Guitar,,+pluck.guitjo,,,,5.2,treble,treble,C4,,,,,+pluck.guitjo.double-neck,,,,5.2,treble,treble,C4,,,,,+pluck.guqin,,,,5.2,treble,treble,C4,,,,,+pluck.guzheng,,,,5.2,treble,treble,C4,,,,,+pluck.guzheng.choazhou,,,,5.2,treble,treble,C4,,,,,+pluck.harp-guitar,,,,5.2,treble,treble,C4,,,,,+pluck.huapanguera,,,,5.2,treble,treble,C4,,,,,+pluck.jarana-huasteca,,,,5.2,treble,treble,C4,,,,,+pluck.jarana-jarocha,,,,5.2,treble,treble,C4,,,,,+pluck.jarana-jarocha.mosquito,,,,5.2,treble,treble,C4,,,,,+pluck.jarana-jarocha.primera,,,,5.2,treble,treble,C4,,,,,+pluck.jarana-jarocha.segunda,,,,5.2,treble,treble,C4,,,,,+pluck.jarana-jarocha.tercera,,,,5.2,treble,treble,C4,,,,,+pluck.kabosy,,,,5.2,treble,treble,C4,,,,,+pluck.kantele,,,,5.2,treble,treble,C4,,,,,+pluck.kanun,,,,5.2,treble,treble,C4,,,,,+pluck.kayagum,,,,5.2,treble,treble,C4,,,,,+pluck.kobza,,,,5.2,treble,treble,C4,,,,,+pluck.komuz,,,,5.2,treble,treble,C4,,,,,+pluck.kora,,,,5.2,treble,treble,C4,,,,,+pluck.koto,108,,,5.2,treble,treble,C4,,,,,+pluck.kutiyapi,,,,5.2,treble,treble,C4,,,,,+pluck.langeleik,,,,5.2,treble,treble,C4,,,,,+pluck.laud,,,,5.2,treble,treble,C4,,,,,+pluck.lute,,,,5.2,treble,treble,C4,,,,,+pluck.lyre,,,,5.2,treble,treble,C4,,,,,+pluck.mandobass,,,,5.2,treble,treble,C4,,,,,+pluck.mandocello,,,,5.2,treble,treble,C4,,,,,+pluck.mandola,,,,5.2,treble,treble,C4,,,,,+pluck.mandolin,,,,5.2,treble,treble,C4,,,,,+pluck.mandolin.octave,,,,5.2,treble,treble,C4,,,,,+pluck.mandora,,,,5.2,treble,treble,C4,,,,,+pluck.mandore,,,,5.2,treble,treble,C4,,,,,+pluck.marovany,,,,5.2,treble,treble,C4,,,,,+pluck.musical-bow,,,,5.2,treble,treble,C4,,,,,+pluck.ngoni,,,,5.2,treble,treble,C4,,,,,+pluck.oud,,,,5.2,treble,treble,C4,,,,,+pluck.pipa,,,,5.2,treble,treble,C4,,,,,+pluck.psaltery,,,,5.2,treble,treble,C4,,,,,+pluck.ruan,,,,5.2,treble,treble,C4,,,,,+pluck.sallaneh,,,,5.2,treble,treble,C4,,,,,+pluck.sanshin,,,,5.2,treble,treble,C4,,,,,+pluck.santoor,,,,5.2,treble,treble,C4,,,,,+pluck.sanxian,,,,5.2,treble,treble,C4,,,,,+pluck.sarod,,,,5.2,treble,treble,C4,,,,,+pluck.saung,,,,5.2,treble,treble,C4,,,,,+pluck.saz,,,,5.2,treble,treble,C4,,,,,+pluck.se,,,,5.2,treble,treble,C4,,,,,+pluck.setar,,,,5.2,treble,treble,C4,,,,,+pluck.shamisen,107,,,5.2,treble,treble,C4,,,,,+pluck.sitar,105,,,5.2,treble,treble,C4,,,,,+pluck.synth,,,,5.2,treble,treble,C4,,,,,+pluck.synth.charang,85,,,5.2,treble,treble,C4,,,,,+pluck.synth.chiff,84,,,5.2,treble,treble,C4,,,,,+pluck.synth.stick,,,,5.2,treble,treble,C4,,,,,+pluck.tambura,,,,5.2,treble,treble,C4,,,,,+pluck.tambura.bulgarian,,,,5.2,treble,treble,C4,,,,,+pluck.tambura.female,,,,5.2,treble,treble,C4,,,,,+pluck.tambura.male,,,,5.2,treble,treble,C4,,,,,+pluck.tar,,,,5.2,treble,treble,C4,,,,,+pluck.theorbo,,,,5.2,treble,treble,C4,,,,,+pluck.timple,,,,5.2,treble,treble,C4,,,,,+pluck.tiple,,,,5.2,treble,treble,C4,,,,,+pluck.tres,,,,5.2,treble,treble,C4,,,,,+pluck.ukulele,,,,5.2,treble,treble,C4,,,,,+pluck.ukulele.tenor,,,,5.2,treble,treble,C4,,,,,+pluck.valiha,,,,5.2,treble,treble,C4,,,,,+pluck.veena,,,,5.2,treble,treble,C4,,,,,+pluck.veena.mohan,,,,5.2,treble,treble,C4,,,,,+pluck.veena.rudra,,,,5.2,treble,treble,C4,,,,,+pluck.veena.vichitra,,,,5.2,treble,treble,C4,,,,,+pluck.vihuela,,,,5.2,treble,treble,C4,,,,,+pluck.vihuela.mexican,,,,5.2,treble,treble,C4,,,,,+pluck.xalam,,,,5.2,treble,treble,C4,,,,,+pluck.yueqin,,,,5.2,treble,treble,C4,,,,,+pluck.zither,,,,5.2,treble,treble,C4,,,,,+pluck.zither.overtone,,,,5.2,treble,treble,C4,,,,,+voice.aa,53,,,6,treble,treble,C4,,,,,+voice.alto,,,,6,treble,treble,C4,,,,,+voice.aw,,,,6,treble,treble,C4,,,,,+voice.baritone,,,,6,bass,bass,C4,,,,,+voice.bass,,,,6,bass,bass,C4,,,,,+voice.child,,,,6,treble,treble,C4,,,,,+voice.countertenor,,,,6,treble,treble,C4,,,,,+voice.doo,,,,6,treble,treble,C4,,,,,+voice.ee,,,,6,treble,treble,C4,,,,,+voice.female,,,,6,treble,treble,C4,,,,,+voice.kazoo,,,,6,treble,treble,C4,,,,,+voice.male,,,,6,treble,treble,C4,,,,,+voice.mezzo-soprano,,,,6,treble,treble,C4,,,,,+voice.mm,,,,6,treble,treble,C4,,,,,+voice.oo,54,,,6,treble,treble,C4,,,,,+voice.percussion,,,,6,treble,treble,C4,,,,,+voice.percussion.beatbox,,,,6,treble,treble,C4,,,,,+voice.soprano,,,,6,treble,treble,C4,,,,,+voice.synth,55,,,6,treble,treble,C4,,,,,+voice.talk-box,,,,6,treble,treble,C4,,,,,+voice.tenor,,,,6,treble,treble,C4,,,,,+voice.vocals,,,,6,treble,treble,C4,,,,,+strings.ajaeng,,,,7,treble,treble,C4,,,,,+strings.arpeggione,,,,7,treble,treble,C4,,,,,+strings.baryton,,,,7,treble,treble,C4,,,,,+strings.cello.piccolo,,,,7,"treble,tenor,bass",bass,C4,,,,,+strings.crwth,,,,7,treble,treble,C4,,,,,+strings.dan-gao,,,,7,treble,treble,C4,,,,,+strings.dihu,,,,7,treble,treble,C4,,,,,+strings.erhu,,,,7,treble,treble,C4,,,,,+strings.erxian,,,,7,treble,treble,C4,,,,,+strings.esraj,,,,7,treble,treble,C4,,,,,+strings.fiddle,111,,,7,treble,treble,C4,,,,,+strings.fiddle.hardanger,,,,7,treble,treble,C4,,,,,+strings.gadulka,,,,7,treble,treble,C4,,,,,+strings.gaohu,,,,7,treble,treble,C4,,,,,+strings.gehu,,,,7,treble,treble,C4,,,,,+strings.group,"49,50,45,46",,,7,treble,treble,C4,,,,,+strings.group.synth,"51,52",,,7,treble,treble,C4,,,,,+strings.haegeum,,,,7,treble,treble,C4,,,,,+strings.hurdy-gurdy,,,,7,treble,treble,C4,,,,,+strings.igil,,,,7,treble,treble,C4,,,,,+strings.kamancha,,,,7,treble,treble,C4,,,,,+strings.kokyu,,,,7,treble,treble,C4,,,,,+strings.laruan,,,,7,treble,treble,C4,,,,,+strings.leiqin,,,,7,treble,treble,C4,,,,,+strings.lirone,,,,7,treble,treble,C4,,,,,+strings.lyra.byzantine,,,,7,treble,treble,C4,,,,,+strings.lyra.cretan,,,,7,treble,treble,C4,,,,,+strings.morin-khuur,,,,7,treble,treble,C4,,,,,+strings.nyckelharpa,,,,7,treble,treble,C4,,,,,+strings.octobass,,,,7,treble,treble,C4,,,,,+strings.rebab,,,,7,treble,treble,C4,,,,,+strings.rebec,,,,7,treble,treble,C4,,,,,+strings.sarangi,,,,7,treble,treble,C4,,,,,+strings.stroh-violin,,,,7,treble,treble,C4,,,,,+strings.tromba-marina,,,,7,treble,treble,C4,,,,,+strings.vielle,,,,7,treble,treble,C4,,,,,+strings.viol,,,,7,treble,treble,C4,,,,,+strings.viol.alto,,,,7,treble,treble,C4,,,,,+strings.viol.bass,,,,7,treble,treble,C4,,,,,+strings.viol.tenor,,,,7,treble,treble,C4,,,,,+strings.viol.treble,,,,7,treble,treble,C4,,,,,+strings.viol.violone,,,,7,treble,treble,C4,,,,,+strings.viola-damore,,,,7,treble,treble,C4,,,,,+strings.violono.piccolo,,,,7,treble,treble,C4,,,,,+strings.violotta,,,,7,treble,treble,C4,,,,,+strings.yayli-tanbur,,,,7,treble,treble,C4,,,,,+strings.yazheng,,,,7,treble,treble,C4,,,,,+strings.zhonghu,,,,7,treble,treble,C4,,,,,+strings.violin,41,,12,7.1,treble,treble,C4,G3-B6,G3-B6,Violin,,+strings.viola,42,,13,7.2,"treble,alto",alto,C4,C3-C6,C3-C6,Viola,,+strings.cello,43,,14,7.3,"treble,tenor,bass",bass,C4,C2-A5,C2-A5,Cello,,Violoncello+strings.contrabass,44,,15,7.4,"treble,bass",bass,C3,E1-C5,E1-C5,Contrabass,,
music-parts.cabal view
@@ -1,6 +1,6 @@ name: music-parts-version: 1.8.1+version: 1.9.0 author: Hans Hoglund maintainer: Hans Hoglund license: BSD3@@ -10,6 +10,7 @@ tested-with: GHC build-type: Simple cabal-version: >= 1.10+data-files: data/instruments.csv description: Abstract representation of musical parts and instruments.@@ -19,18 +20,24 @@ source-repository head type: git location: git://github.com/music-suite/music-parts.git- + library build-depends: base >= 4 && < 5, containers >= 0.5.5.1 && < 1,+ monadplus, aeson >= 0.7.0.6 && < 1,- lens >= 4.6 && < 4.7,+ lens >= 4.11 && < 5, semigroups >= 0.13.0.1 && < 1, data-default >= 0.5.3 && < 1, adjunctions >= 4.1 && < 5, roman-numerals >= 0.5.1.4 && < 1,- music-pitch == 1.8.1,- music-dynamics == 1.8.1+ cassava >= 0.4.3.0 && < 1,+ bytestring >= 0.10.4.0 && < 1,+ vector-space >= 0.10.2 && < 1,+ vector-space-points >= 0.2 && < 1,++ music-pitch == 1.9.0,+ music-dynamics == 1.9.0 exposed-modules: Data.Semigroup.Option.Instances Music.Parts@@ -73,7 +80,18 @@ -- so we know what goes on which staff, what kind of bracket to generate etc -- TODO some sub-subdivision (not for player allocation, but hand/finger)- - other-modules: Music.Parts.Internal.Data++ -- For GHCI+ Music.Parts.Internal.Data+ other-modules: Paths_music_parts hs-source-dirs: src default-language: Haskell2010+ default-extensions: StandaloneDeriving,+ TypeFamilies,+ TypeOperators,+ GeneralizedNewtypeDeriving,+ MultiParamTypeClasses,+ DeriveDataTypeable,+ ViewPatterns,+ OverloadedStrings+
src/Music/Parts.hs view
@@ -1,1670 +1,452 @@ -{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeFamilies #-}----------------------------------------------------------------------------------------- |--- Copyright : (c) Hans Hoglund 2012-2015------ License : BSD-style------ Maintainer : hans@hanshoglund.se--- Stability : experimental--- Portability : non-portable (TF,GNTD)------ Provides various representaitons of musical instruments, subdivisions and parts.-------------------------------------------------------------------------------------------module Music.Parts (- -- * Terminology- -- $terminology--- -- * Subparts- module Music.Parts.Division,- module Music.Parts.Subpart,-- -- * Solo vs. tutti- module Music.Parts.Solo,- - -- * Instruments- module Music.Parts.Instrument,-- -- * Parts- Part(..),- _solo,- _subpart,- _instrument,- divide,- containsPart,- smallestPart,- smallestSubpart,- largestPart,- largestSubpart,- distinctFrom,- allDistinct,- solo,- tutti,-- -- ** Instruments etc- piccoloFlute,- flute,- altoFlute,- bassFlute,-- oboe,- corAnglais,- heckelphone,-- ebClarinet,- clarinet,- aClarinet,- bassClarinet,-- sopranoSax,- altoSax,- tenorSax,- baritoneSax,-- bassoon,- contraBassoon,-- horn,- piccoloTrumpet,- trumpet,- bassTrumpet,- altoTrombone,- tenorTrombone,- trombone,- bassTrombone,- tuba,-- timpani,- piano,-- celesta,- glockenspiel,- vibraphone,- marimba,- xylophone,- xylorimba,- tubularBells,- dulcimer,-- accordion,- harmonica,-- violin,- viola,- cello,- doubleBass,-- -- ** Ensembles- piccoloFlutes,- flutes,- oboes,- clarinets,- bassoons,-- flutes1,- flutes2,- oboes1,- oboes2,- clarinets1,- clarinets2,-- horns,- highHorns,- lowHorns,- trumpets,- trombones,- trumpets1,- trumpets2,- trombones1,- trombones2,- tubas,-- violins,- violins1,- violins2,- violas,- cellos,- doubleBasses,-- harp,-- -- ** Default values- defaultClef,- defaultMidiProgram,- defaultMidiChannel,- defaultMidiNote,--- -- * Basic- module Music.Parts.Basic-- ) where--import Control.Applicative-import Control.Lens (toListOf, Lens, Lens')-import Data.Default-import Data.Functor.Adjunction (unzipR)-import qualified Data.List-import Data.Maybe-import Data.Semigroup-import Data.Semigroup.Option.Instances-import Data.Traversable (traverse)-import Data.Typeable-import Text.Numeral.Roman (toRoman)--import Music.Parts.Basic-import Music.Parts.Subpart-import Music.Parts.Division-import Music.Parts.Solo-import Music.Parts.Instrument--{- $terminology--Parts represent a subset of a group of performers. It is mainly used for instrumental and-vocal music, but some concetps may be useful in electronic music as well.--- 'Section' refers to a set of instrumentfamilies related by sound production method (i.e. woodwind).--- 'Family' refers to a set of instrument or voice types, which typically differ in size (i.e. saxophones).--- 'Instrument' refers to a set of instruments or voice types of a given type (i.e. soprano saxophones).- Perhaps confusingly, this includes vocal types such as alto, tenor etc as well. However, there is- no good general term that incorporate both /instrument/ and /voice type/.--- A 'Part' is made up of an 'Instrument' and a 'Division' (i.e. Violin I). Solo parts are treated- separately, so i.e. /Violin solo II/ (as in a double concerto) is distinct from /Violin II/.---}-------- | A part is a subdivided group of instruments of a given type.----data Part = Part Solo Instrument Subpart- deriving (Eq, Ord)--instance Show Part where- show (Part Solo instr subp) = "Solo " ++ show instr ++ addS (show subp)- where- addS "" = ""- addS x = " " ++ x- show (Part _ instr subp) = show instr ++ addS (show subp)- where- addS "" = ""- addS x = " " ++ x---- FIXME bad instance (?)-instance Enum Part where- toEnum x = Part Tutti (toEnum x) def- fromEnum (Part solo instr subp) = fromEnum instr---- Semantics: Monoid (Option . First)-instance Monoid Part where- mappend x _ = x- mempty = def-instance Semigroup Part where- (<>) = mappend-instance Default Part where- def = Part def def def---- |--- @a \`containsPart\` b@ holds if the set of players represented by a is an improper subset of the--- set of players represented by b.-containsPart :: Part -> Part -> Bool-Part solo1 instr1 subp1 `containsPart` Part solo2 instr2 subp2 =- solo1 == solo2- && instr1 == instr2- && subp1 `containsSubpart` subp2--smallestPart :: Part -> Part -> Part-smallestPart p1@(Part _ _ sp1) p2@(Part _ _ sp2)- | sp1 `smallestSubpart` sp2 == sp1 = p1- | sp1 `smallestSubpart` sp2 == sp2 = p2--smallestSubpart :: Subpart -> Subpart -> Subpart-smallestSubpart x y- | x `isProperSubpartOf` y = x- | y `isProperSubpartOf` x = y- -- arbitrarily:- | otherwise = x--largestPart :: Part -> Part -> Part-largestPart p1@(Part _ _ sp1) p2@(Part _ _ sp2)- | sp1 `largestSubpart` sp2 == sp1 = p1- | sp1 `largestSubpart` sp2 == sp2 = p2--largestSubpart :: Subpart -> Subpart -> Subpart-largestSubpart x y- | x `isProperSubpartOf` y = y- | y `isProperSubpartOf` x = x- -- arbitrarily:- | otherwise = x----- | Returns 'True' iff all given parts are distinct (as per 'distinctFrom').-allDistinct :: [Part] -> Bool-allDistinct [] = True-allDistinct (x:xs) = all (distinctFrom x) xs && allDistinct xs---- | Returns 'True' iff x and y are completely distinct, i.e. neither contains the other.--- --- >>> violins `distinctFrom` trumpets--- True--- >>> violins `distinctFrom` violins--- False--- >>> violins `distinctFrom` violins1--- False--- >>> violins1 `distinctFrom` violins--- False--- >>> violins1 `distinctFrom` violins2--- True----distinctFrom :: Part -> Part -> Bool-distinctFrom (Part s1 i1 sp1) (Part s2 i2 sp2) = s1 /= s2 || i1 /= i2 || noneSubpart- where- -- Is this needed?- noneSubpart = not (sp1 `isSubpartOf` sp2) && not (sp2 `isSubpartOf` sp1)--- - -- if equal- -- [pa',pb'] = divide 2 pa--_solo :: Lens' Part Solo-_solo f (Part s i u) = fmap (\s -> Part s i u) $ f s--_subpart :: Lens' Part Subpart-_subpart f (Part s i u) = fmap (\u -> Part s i u) $ f u--_instrument :: Lens' Part Instrument-_instrument f (Part s i u) = fmap (\i -> Part s i u) $ f i---- | Divide a part into @n@ subparts.-divide :: Int -> Part -> [Part]-divide n (Part solo instr subp) = fmap (\x -> Part solo instr (subp <> Subpart [x])) $ divisions n--solo instr = Part Solo instr def-tutti instr = Part Tutti instr def---piccoloFlute = StdInstrument 72-flute = StdInstrument 73-altoFlute = OtherInstrument "Woodwind.Flute.Alto"-bassFlute = OtherInstrument "Woodwind.Flute.Bass"--oboe = StdInstrument 68-corAnglais = StdInstrument 69-heckelphone = OtherInstrument "Woodwind.DoubleReed.Heckelphone"--ebClarinet = OtherInstrument "Woodwind.SingleReed.Clarinet.Eb"-clarinet = StdInstrument 71-aClarinet = OtherInstrument "Woodwind.SingleReed.Clarinet.A"-bassClarinet = OtherInstrument "Woodwind.SingleReed.Clarinet.Bass"--sopranoSax = StdInstrument 64-altoSax = StdInstrument 65-tenorSax = StdInstrument 66-baritoneSax = StdInstrument 67--bassoon = StdInstrument 70-contraBassoon = OtherInstrument "Woodwind.DoubleReed.Bassoon.Contra"--horn = StdInstrument 60-piccoloTrumpet = OtherInstrument "Brass.Trumpet.Piccolo"-trumpet = StdInstrument 56-bassTrumpet = OtherInstrument "Brass.Trumpet.Bass"-altoTrombone = OtherInstrument "Brass.Trombone.Alto"-tenorTrombone = StdInstrument 57-trombone = StdInstrument 57-bassTrombone = OtherInstrument "Brass.Trombone.Bass"-tuba = StdInstrument 58--timpani = StdInstrument 47-piano = StdInstrument 0--celesta = StdInstrument 8-glockenspiel = StdInstrument 9-vibraphone = StdInstrument 11-marimba = StdInstrument 12-xylophone = StdInstrument 13-xylorimba = OtherInstrument "Percussion.Pitched.Xylorimba"-tubularBells = StdInstrument 14-dulcimer = StdInstrument 15--accordion = StdInstrument 21-harmonica = StdInstrument 22--violin = StdInstrument 40-viola = StdInstrument 41-cello = StdInstrument 42-doubleBass = StdInstrument 43----defaultClef :: Part -> Int-defaultMidiNote :: Part -> Int-defaultMidiProgram :: Part -> Int-defaultMidiChannel :: Part -> Int-defaultScoreOrder :: Part -> Double--defaultMidiNote _ = 0--defaultMidiProgram (Part _ (StdInstrument x) _) = x--defaultMidiChannel = fromMaybe 0 . fmap get . (`lookup` gmInstrs) . defaultMidiProgram- where get (x,_,_,_) = x--defaultScoreOrder = fromMaybe 0 . fmap get . (`lookup` gmInstrs) . defaultMidiProgram- where get (_,x,_,_) = x--defaultClef = fromMaybe 0 . fmap get . (`lookup` gmInstrs) . defaultMidiProgram- where get (_,_,x,_) = x----gmClef :: Int -> Int-gmMidiChannel :: Int -> Int-gmScoreOrder :: Int -> Double--gmMidiChannel = fromMaybe 0 . fmap get . (`lookup` gmInstrs)- where get (x,_,_,_) = x--gmScoreOrder = fromMaybe 0 . fmap get . (`lookup` gmInstrs)- where get (_,x,_,_) = x--gmClef = fromMaybe 0 . fmap get . (`lookup` gmInstrs)- where get (_,_,x,_) = x---gmInstrName :: Int -> Maybe String-gmInstrName = fmap get . (`lookup` gmInstrs)- where get (_,_,_,x) = x---- (midi program, (def midi ch, score order, def clef 0=g/1=c/2=f, name))-{-- Score order:- Woodwinds: 1- Brass: 2- Timpani: 3- Percussion: 4- Keyboard/Harp 5- Singers 6- Strings: 7- Bass: 8--}-gmInstrs :: [(Int, (Int, Double, Int, String))]-gmInstrs = [- -- (0, (0, 5.0, 0, "Acoustic Grand Piano")),- (0, (0, 5.0, 0, "Piano")),- (1, (0, 5.0, 0, "Bright Acoustic Piano")),- (2, (0, 5.0, 0, "Electric Grand Piano")),- (3, (0, 5.0, 0, "Honky-tonk Piano")),- (4, (0, 5.0, 0, "Electric Piano 1")),- (5, (0, 5.0, 0, "Electric Piano 2")),- (6, (0, 5.0, 0, "Harpsichord")),- (7, (0, 5.0, 0, "Clavinet")),-- (8, (0, 5.0, 0, "Celesta")),- (9, (0, 5.0, 0, "Glockenspiel")),- (9, (0, 5.0, 0, "Music Box")),- (11, (0, 4.0, 0, "Vibraphone")),- (12, (0, 4.0, 0, "Marimba")),- (13, (0, 4.0, 0, "Xylophone")),- (14, (0, 4.0, 0, "Tubular Bells")),- (15, (0, 4.0, 0, "Dulcimer")),-- (16, (0, 5.0, 0, "Drawbar Organ")),- (17, (0, 5.0, 0, "Percussive Organ")),- (18, (0, 5.0, 0, "Rock Organ")),- (19, (0, 5.0, 0, "Church Organ")),- (20, (0, 5.0, 0, "Reed Organ")),- (21, (0, 5.0, 0, "Accordion")),- (22, (0, 5.0, 0, "Harmonica")),- (23, (0, 5.0, 0, "Tango Accordion")),-- (24, (0, 5.0, 0, "Acoustic Guitar (nylon)")),- (25, (0, 5.0, 0, "Acoustic Guitar (steel)")),- (26, (0, 5.0, 0, "Electric Guitar (jazz)")),- (27, (0, 5.0, 0, "Electric Guitar (clean)")),- (28, (0, 5.0, 0, "Electric Guitar (muted)")),- (29, (0, 5.0, 0, "Overdriven Guitar")),- (30, (0, 5.0, 0, "Distortion Guitar")),- (31, (0, 5.0, 0, "Guitar Harmonics")),-- (32, (0, 8.0, 2, "Acoustic Bass")),- (33, (0, 8.0, 2, "Electric Bass (finger)")),- (34, (0, 8.0, 2, "Electric Bass (pick)")),- (35, (0, 8.0, 2, "Fretless Bass")),- (36, (0, 8.0, 2, "Slap Bass 1")),- (37, (0, 8.0, 2, "Slap Bass 2")),- (38, (0, 8.0, 2, "Synth Bass 1")),- (39, (0, 8.0, 2, "Synth Bass 2")),-- (40, (12, 7.1, 0, "Violin")),- (41, (13, 7.2, 1, "Viola")),- -- (42, (0, 1.0, 0, "Cello")),- (42, (14, 7.3, 2, "Violoncello")),- (43, (15, 7.4, 2, "Contrabass")),- (44, (0, 7.0, 0, "Tremolo Strings")),- (45, (0, 7.0, 0, "Pizzicato Strings")),- (46, (11, 5.9, 0, "Orchestral Harp")),-- (47, (8, 2.5, 2, "Timpani")),-- (48, (0, 7.0, 0, "String Ensemble 1")),- (49, (0, 7.0, 0, "String Ensemble 2")),- (50, (0, 7.0, 0, "Synth Strings 1")),- (51, (0, 7.0, 0, "Synth Strings 2")),-- (52, (0, 1.0, 0, "Choir Aahs")),- (53, (0, 1.0, 0, "Voice Oohs")),- (54, (0, 1.0, 0, "Synth Choir")),- (55, (0, 1.0, 0, "Orchestra Hit")),-- (56, (5, 2.2, 0, "Trumpet in Bb")),- (57, (6, 2.3, 2, "Trombone")),- (58, (7, 2.4, 2, "Tuba")),- (59, (0, 2.2, 0, "Muted Trumpet")),- -- (60, (4, 2.1, 0, "French Horn")),- (60, (4, 2.1, 0, "Horn in F")),- (61, (0, 2.0, 0, "Brass Section")),- (62, (0, 2.0, 0, "Synth Brass 1")),- (63, (0, 2.0, 0, "Synth Brass 2")),-- (64, (0, 1.51, 0, "Soprano Sax")),- (65, (0, 1.52, 0, "Alto Sax")),- (66, (0, 1.53, 0, "Tenor Sax")),- (67, (0, 1.54, 0, "Baritone Sax")),- (68, (1, 1.3, 0, "Oboe")),- (69, (1, 1.4, 0, "English Horn")),- (70, (3, 1.7, 2, "Bassoon")),- (71, (2, 1.6, 0, "Clarinet in Bb")),-- (72, (0, 1.1, 0, "Piccolo")),- (73, (0, 1.2, 0, "Flute")),- (74, (0, 1.0, 0, "Recorder")),- (75, (0, 1.0, 0, "Pan Flute")),- (76, (0, 1.0, 0, "Blown bottle")),- (77, (0, 1.0, 0, "Shakuhachi")),- (78, (0, 1.0, 0, "Whistle")),- (79, (0, 1.0, 0, "Ocarina")),-- (80, (0, 1.0, 0, "Lead 1 (square)")),- (81, (0, 1.0, 0, "Lead 2 (sawtooth)")),- (82, (0, 1.0, 0, "Lead 3 (calliope)")),- (83, (0, 1.0, 0, "Lead 4 (chiff)")),- (84, (0, 1.0, 0, "Lead 5 (charang)")),- (85, (0, 1.0, 0, "Lead 6 (voice)")),- (86, (0, 1.0, 0, "Lead 7 (fifths)")),- (87, (0, 1.0, 0, "Lead 8 (bass + lead)")),-- (88, (0, 1.0, 0, "Pad 1 (new age)")),- (89, (0, 1.0, 0, "Pad 2 (warm)")),- (90, (0, 1.0, 0, "Pad 3 (polysynth)")),- (91, (0, 1.0, 0, "Pad 4 (choir)")),- (92, (0, 1.0, 0, "Pad 5 (bowed)")),- (93, (0, 1.0, 0, "Pad 6 (metallic)")),- (94, (0, 1.0, 0, "Pad 7 (halo)")),- (95, (0, 1.0, 0, "Pad 8 (sweep)")),-- (96, (0, 1.0, 0, "FX 1 (rain)")),- (97, (0, 1.0, 0, "FX 2 (soundtrack)")),- (98, (0, 1.0, 0, "FX 3 (crystal)")),- (99, (0, 1.0, 0, "FX 4 (atmosphere)")),- (100, (0, 1.0, 0, "FX 5 (brightness)")),- (101, (0, 1.0, 0, "FX 6 (goblins)")),- (102, (0, 1.0, 0, "FX 7 (echoes)")),- (103, (0, 1.0, 0, "FX 8 (sci-fi)")),-- (104, (0, 1.0, 0, "Sitar")),- (105, (0, 1.0, 0, "Banjo")),- (106, (0, 1.0, 0, "Shamisen")),- (107, (0, 1.0, 0, "Koto")),- (108, (0, 1.0, 0, "Kalimba")),- (109, (0, 1.0, 0, "Bagpipe")),- (110, (0, 1.0, 0, "Fiddle")),- (111, (0, 1.0, 0, "Shanai")),-- (112, (0, 1.0, 0, "Tinkle Bell")),- (113, (0, 1.0, 0, "Agogo")),- (114, (0, 1.0, 0, "Steel Drums")),- (115, (0, 1.0, 0, "Woodblock")),- (116, (0, 1.0, 0, "Taiko Drum")),- (117, (0, 1.0, 0, "Melodic Tom")),- (118, (0, 1.0, 0, "Synth Drum")),- (119, (0, 1.0, 0, "Reverse Cymbal")),-- (120, (0, 1.0, 0, "Guitar Fret Noise")),- (121, (0, 1.0, 0, "Breath Noise")),- (122, (0, 1.0, 0, "Seashore")),- (123, (0, 1.0, 0, "Bird Tweet")),- (124, (0, 1.0, 0, "Telephone Ring")),- (125, (0, 1.0, 0, "Helicopter")),- (126, (0, 1.0, 0, "Applause")),- (127, (0, 1.0, 0, "Gunshot"))- ]--gmPerc :: [(Int, String)]-gmPerc = [- (35, "Bass Drum 2"),- (36, "Bass Drum 1"),- (37, "Side Stick/Rimshot"),- (38, "Snare Drum 1"),- (39, "Hand Clap"),- (40, "Snare Drum 2"),- (41, "Low Tom 2"),- (42, "Closed Hi-hat"),- (43, "Low Tom 1"),- (44, "Pedal Hi-hat"),- (45, "Mid Tom 2"),- (46, "Open Hi-hat"),- (47, "Mid Tom 1"),- (48, "High Tom 2"),- (49, "Crash Cymbal 1"),- (50, "High Tom 1"),- (51, "Ride Cymbal 1"),- (52, "Chinese Cymbal"),- (53, "Ride Bell"),- (54, "Tambourine"),- (55, "Splash Cymbal"),- (56, "Cowbell"),- (57, "Crash Cymbal 2"),- (58, "Vibra Slap"),- (59, "Ride Cymbal 2"),- (60, "High Bongo"),- (61, "Low Bongo"),- (62, "Mute High Conga"),- (63, "Open High Conga"),- (64, "Low Conga"),- (65, "High Timbale"),- (66, "Low Timbale"),- (67, "High Agogô"),- (68, "Low Agogô"),- (69, "Cabasa"),- (70, "Maracas"),- (71, "Short Whistle"),- (72, "Long Whistle"),- (73, "Short Güiro"),- (74, "Long Güiro"),- (75, "Claves"),- (76, "High Wood Block"),- (77, "Low Wood Block"),- (78, "Mute Cuíca"),- (79, "Open Cuíca"),- (80, "Mute Triangle"),- (81, "Open Triangle")- ]----------- data Section--- = Woodwind--- | Brass--- | Percussion--- | Keyboard--- | Voices--- | Strings------ data VoicePart--- = Soprano--- | MezzoSoprano--- | Alto--- | Tenor--- | Baritone--- | Bass--------- data GMInstrumentType--- = GMPiano--- | GMChromaticPercussion--- | GMOrgan--- | GMGuitar--- | GMBass--- | GMStrings--- | GMEnsemble--- | GMBrass--- | GMReed--- | GMPipe--- | GMSynthLead--- | GMSynthPad--- | GMSynthEffects--- | GMEthnic--- | GMPercussive--- | GMSoundEffects----{-- ## Terminology: Voice vs Part-- A voice is a container of notes (non-overlapping)-- A part is an identifier for a set of singers/musicians AND all the notes in a score- designated for this set of performers. Part extraction has the type-- extractParts :: HasPart a => Score a -> [Score a]-- I.e. in a score for piano and ensemble, certain notes may be *in the piano part*, i.e.- designated for the piano. Typically, a part is monophonic or polyphonic. A monophonic- part is a voice, i.e.-- -- | Are there overlapping notes?- isMonophonic :: Score a -> Bool-- -- | Fails for polyphonic scores.- s_oreToVoice :: Score a -> Voice (Maybe a)-- A polyphonic score contains several voices, i.e.-- s_oreToVoices :: Score a -> [Voice (Maybe a)]--- A part is any type a that satisfies (Ord a, Show a).- Optionally, we may add a contraint (HasPartName a), i.e.-- class HasPartName a where- partName :: a -> String- partAbbr :: a -> String--- These contraints are used when printing scores (to get the order of the parts and their name).-- Vln1, Vln2 etc.-- Often we want to group parts, i.e.-- Chorus {- Sop { Sop1 Sop2 }- Alto { Alto1 Alto2 }- Ten { Ten1 Ten 2 }- Bass { Bass1 Bass2 }- }- Orchestra {- Woodwinds { ... }- Brass { ... }- Perc { ... }- Strings { ... }- }--- isInGroup :: Group -> Part -> Bool- partGroups :: Part -> [Group]--- partGroup :: (Part -> [Group] -> a) -> Group -> a- tree :: (a -> [Tree a] -> b) -> Tree a -> b--- data MyPart- = Fl- | Sop- | Vl1- | Vl2- | Pno---}--- TODO move--- instance Num a => Num (Option a) where--- (+) = liftA2 (+)--- (-) = liftA2 (-)--- (*) = liftA2 (*)--- abs = fmap abs--- signum = fmap signum--- fromInteger = pure . fromInteger--- instance Integral a => Integral (Option a) where--- quotRem x y = unzipR $ liftA2 quotRem x y--- toInteger = toInteger . get where get = (head.toListOf traverse)--- instance Real a => Real (Option a) where--- toRational = toRational . get where get = (head.toListOf traverse)--- instance Enum a => Enum (Option a) where--- fromEnum = fromEnum . get where get = (head.toListOf traverse)--- toEnum = pure . toEnum------ instance Num a => Num (First a) where--- (+) = liftA2 (+)--- (-) = liftA2 (-)--- (*) = liftA2 (*)--- abs = fmap abs--- signum = fmap signum--- fromInteger = pure . fromInteger--- instance Integral a => Integral (First a) where--- quotRem x y = unzipR $ liftA2 quotRem x y--- toInteger = toInteger . get where get = (head.toListOf traverse)--- instance Real a => Real (First a) where--- toRational = toRational . get where get = (head.toListOf traverse)--- -- instance Enum a => Enum (First a) where--- -- toEnum = toEnum . get where get = (head.toListOf traverse)--- -- fromEnum = pure . fromEnum---piccoloFlutes = tutti piccoloFlute-flutes = tutti flute-oboes = tutti oboe-clarinets = tutti clarinet-bassoons = tutti bassoon--[flutes1, flutes2] = divide 2 flutes-[oboes1, oboes2] = divide 2 oboes-[clarinets1, clarinets2] = divide 2 clarinets---horns = tutti horn-highHorns = zipWith (!!) (repeat $ divide 4 horns) [0,2]-lowHorns = zipWith (!!) (repeat $ divide 4 horns) [1,3]-trumpets = tutti trumpet-trombones = tutti trombone-[trumpets1, trumpets2] = divide 2 trumpets-[trombones1, trombones2] = divide 2 trombones-tubas = tutti tuba--violins = tutti violin-[violins1, violins2] = divide 2 violins-violas = tutti viola-cellos = tutti cello-doubleBasses = tutti doubleBass--harp' = StdInstrument 46-harp = tutti harp'---{-- <sound id="brass.alphorn"/>- <sound id="brass.alto-horn"/>- <sound id="brass.baritone-horn"/>- <sound id="brass.bugle"/>- <sound id="brass.bugle.alto"/>- <sound id="brass.bugle.baritone"/>- <sound id="brass.bugle.contrabass"/>- <sound id="brass.bugle.euphonium-bugle"/>- <sound id="brass.bugle.mellophone-bugle"/>- <sound id="brass.bugle.soprano"/>- <sound id="brass.cimbasso"/>- <sound id="brass.conch-shell"/>- <sound id="brass.cornet"/>- <sound id="brass.cornet.soprano"/>- <sound id="brass.cornett"/>- <sound id="brass.cornett.tenor"/>- <sound id="brass.cornettino"/>- <sound id="brass.didgeridoo"/>- <sound id="brass.euphonium"/>- <sound id="brass.fiscorn"/>- <sound id="brass.flugelhorn"/>- <sound id="brass.french-horn"/>- <sound id="brass.group"/>- <sound id="brass.group.synth"/>- <sound id="brass.helicon"/>- <sound id="brass.horagai"/>- <sound id="brass.kuhlohorn"/>- <sound id="brass.mellophone"/>- <sound id="brass.natural-horn"/>- <sound id="brass.ophicleide"/>- <sound id="brass.posthorn"/>- <sound id="brass.rag-dung"/>- <sound id="brass.sackbutt"/>- <sound id="brass.sackbutt.alto"/>- <sound id="brass.sackbutt.bass"/>- <sound id="brass.sackbutt.tenor"/>- <sound id="brass.saxhorn"/>- <sound id="brass.serpent"/>- <sound id="brass.shofar"/>- <sound id="brass.sousaphone"/>- <sound id="brass.trombone"/>- <sound id="brass.trombone.alto"/>- <sound id="brass.trombone.bass"/>- <sound id="brass.trombone.contrabass"/>- <sound id="brass.trombone.tenor"/>- <sound id="brass.trumpet"/>- <sound id="brass.trumpet.baroque"/>- <sound id="brass.trumpet.bass"/>- <sound id="brass.trumpet.bflat"/>- <sound id="brass.trumpet.c"/>- <sound id="brass.trumpet.d"/>- <sound id="brass.trumpet.piccolo"/>- <sound id="brass.trumpet.pocket"/>- <sound id="brass.trumpet.slide"/>- <sound id="brass.trumpet.tenor"/>- <sound id="brass.tuba"/>- <sound id="brass.tuba.bass"/>- <sound id="brass.tuba.subcontrabass"/>- <sound id="brass.vienna-horn"/>- <sound id="brass.vuvuzela"/>- <sound id="brass.wagner-tuba"/>- <sound id="drum.apentemma"/>- <sound id="drum.ashiko"/>- <sound id="drum.atabaque"/>- <sound id="drum.atoke"/>- <sound id="drum.atsimevu"/>- <sound id="drum.axatse"/>- <sound id="drum.bass-drum"/>- <sound id="drum.bata"/>- <sound id="drum.bata.itotele"/>- <sound id="drum.bata.iya"/>- <sound id="drum.bata.okonkolo"/>- <sound id="drum.bendir"/>- <sound id="drum.bodhran"/>- <sound id="drum.bombo"/>- <sound id="drum.bongo"/>- <sound id="drum.bougarabou"/>- <sound id="drum.buffalo-drum"/>- <sound id="drum.cajon"/>- <sound id="drum.chenda"/>- <sound id="drum.chu-daiko"/>- <sound id="drum.conga"/>- <sound id="drum.cuica"/>- <sound id="drum.dabakan"/>- <sound id="drum.daff"/>- <sound id="drum.dafli"/>- <sound id="drum.daibyosi"/>- <sound id="drum.damroo"/>- <sound id="drum.darabuka"/>- <sound id="drum.def"/>- <sound id="drum.dhol"/>- <sound id="drum.dholak"/>- <sound id="drum.djembe"/>- <sound id="drum.doira"/>- <sound id="drum.dondo"/>- <sound id="drum.doun-doun-ba"/>- <sound id="drum.duff"/>- <sound id="drum.dumbek"/>- <sound id="drum.fontomfrom"/>- <sound id="drum.frame-drum"/>- <sound id="drum.frame-drum.arabian"/>- <sound id="drum.geduk"/>- <sound id="drum.ghatam"/>- <sound id="drum.gome"/>- <sound id="drum.group"/>- <sound id="drum.group.chinese"/>- <sound id="drum.group.ewe"/>- <sound id="drum.group.indian"/>- <sound id="drum.group.set"/>- <sound id="drum.hand-drum"/>- <sound id="drum.hira-daiko"/>- <sound id="drum.ibo"/>- <sound id="drum.igihumurizo"/>- <sound id="drum.inyahura"/>- <sound id="drum.ishakwe"/>- <sound id="drum.jang-gu"/>- <sound id="drum.kagan"/>- <sound id="drum.kakko"/>- <sound id="drum.kanjira"/>- <sound id="drum.kendhang"/>- <sound id="drum.kendhang.ageng"/>- <sound id="drum.kendhang.ciblon"/>- <sound id="drum.kenkeni"/>- <sound id="drum.khol"/>- <sound id="drum.kick-drum"/>- <sound id="drum.kidi"/>- <sound id="drum.ko-daiko"/>- <sound id="drum.kpanlogo"/>- <sound id="drum.kudum"/>- <sound id="drum.lambeg"/>- <sound id="drum.lion-drum"/>- <sound id="drum.log-drum"/>- <sound id="drum.log-drum.african"/>- <sound id="drum.log-drum.native"/>- <sound id="drum.log-drum.nigerian"/>- <sound id="drum.madal"/>- <sound id="drum.maddale"/>- <sound id="drum.mridangam"/>- <sound id="drum.naal"/>- <sound id="drum.nagado-daiko"/>- <sound id="drum.nagara"/>- <sound id="drum.naqara"/>- <sound id="drum.o-daiko"/>- <sound id="drum.okawa"/>- <sound id="drum.okedo-daiko"/>- <sound id="drum.pahu-hula"/>- <sound id="drum.pakhawaj"/>- <sound id="drum.pandeiro"/>- <sound id="drum.pandero"/>- <sound id="drum.powwow"/>- <sound id="drum.pueblo"/>- <sound id="drum.repinique"/>- <sound id="drum.riq"/>- <sound id="drum.rototom"/>- <sound id="drum.sabar"/>- <sound id="drum.sakara"/>- <sound id="drum.sampho"/>- <sound id="drum.sangban"/>- <sound id="drum.shime-daiko"/>- <sound id="drum.slit-drum"/>- <sound id="drum.slit-drum.krin"/>- <sound id="drum.snare-drum"/>- <sound id="drum.snare-drum.electric"/>- <sound id="drum.sogo"/>- <sound id="drum.surdo"/>- <sound id="drum.tabla"/>- <sound id="drum.tabla.bayan"/>- <sound id="drum.tabla.dayan"/>- <sound id="drum.taiko"/>- <sound id="drum.talking"/>- <sound id="drum.tama"/>- <sound id="drum.tamborita"/>- <sound id="drum.tambourine"/>- <sound id="drum.tamte"/>- <sound id="drum.tangku"/>- <sound id="drum.tan-tan"/>- <sound id="drum.taphon"/>- <sound id="drum.tar"/>- <sound id="drum.tasha"/>- <sound id="drum.tenor-drum"/>- <sound id="drum.teponaxtli"/>- <sound id="drum.thavil"/>- <sound id="drum.the-box"/>- <sound id="drum.timbale"/>- <sound id="drum.timpani"/>- <sound id="drum.tinaja"/>- <sound id="drum.toere"/>- <sound id="drum.tombak"/>- <sound id="drum.tom-tom"/>- <sound id="drum.tom-tom.synth"/>- <sound id="drum.tsuzumi"/>- <sound id="drum.tumbak"/>- <sound id="drum.uchiwa-daiko"/>- <sound id="drum.udaku"/>- <sound id="drum.udu"/>- <sound id="drum.zarb"/>- <sound id="effect.aeolian-harp"/>- <sound id="effect.air-horn"/>- <sound id="effect.applause"/>- <sound id="effect.bass-string-slap"/>- <sound id="effect.bird"/>- <sound id="effect.bird.nightingale"/>- <sound id="effect.bird.tweet"/>- <sound id="effect.breath"/>- <sound id="effect.bubble"/>- <sound id="effect.bullroarer"/>- <sound id="effect.burst"/>- <sound id="effect.car"/>- <sound id="effect.car.crash"/>- <sound id="effect.car.engine"/>- <sound id="effect.car.pass"/>- <sound id="effect.car.stop"/>- <sound id="effect.crickets"/>- <sound id="effect.dog"/>- <sound id="effect.door.creak"/>- <sound id="effect.door.slam"/>- <sound id="effect.explosion"/>- <sound id="effect.flute-key-click"/>- <sound id="effect.footsteps"/>- <sound id="effect.frogs"/>- <sound id="effect.guitar-cutting"/>- <sound id="effect.guitar-fret"/>- <sound id="effect.gunshot"/>- <sound id="effect.hand-clap"/>- <sound id="effect.heartbeat"/>- <sound id="effect.helicopter"/>- <sound id="effect.high-q"/>- <sound id="effect.horse-gallop"/>- <sound id="effect.jet-plane"/>- <sound id="effect.laser-gun"/>- <sound id="effect.laugh"/>- <sound id="effect.lions-roar"/>- <sound id="effect.machine-gun"/>- <sound id="effect.marching-machine"/>- <sound id="effect.metronome-bell"/>- <sound id="effect.metronome-click"/>- <sound id="effect.pat"/>- <sound id="effect.punch"/>- <sound id="effect.rain"/>- <sound id="effect.scratch"/>- <sound id="effect.scream"/>- <sound id="effect.seashore"/>- <sound id="effect.siren"/>- <sound id="effect.slap"/>- <sound id="effect.snap"/>- <sound id="effect.stamp"/>- <sound id="effect.starship"/>- <sound id="effect.stream"/>- <sound id="effect.telephone-ring"/>- <sound id="effect.thunder"/>- <sound id="effect.train"/>- <sound id="effect.trash-can"/>- <sound id="effect.whip"/>- <sound id="effect.whistle"/>- <sound id="effect.whistle.mouth-siren"/>- <sound id="effect.whistle.police"/>- <sound id="effect.whistle.slide"/>- <sound id="effect.whistle.train"/>- <sound id="effect.wind"/>- <sound id="keyboard.accordion"/>- <sound id="keyboard.bandoneon"/>- <sound id="keyboard.celesta"/>- <sound id="keyboard.clavichord"/>- <sound id="keyboard.clavichord.synth"/>- <sound id="keyboard.concertina"/>- <sound id="keyboard.fortepiano"/>- <sound id="keyboard.harmonium"/>- <sound id="keyboard.harpsichord"/>- <sound id="keyboard.ondes-martenot"/>- <sound id="keyboard.organ"/>- <sound id="keyboard.organ.drawbar"/>- <sound id="keyboard.organ.percussive"/>- <sound id="keyboard.organ.pipe"/>- <sound id="keyboard.organ.reed"/>- <sound id="keyboard.organ.rotary"/>- <sound id="keyboard.piano"/>- <sound id="keyboard.piano.electric"/>- <sound id="keyboard.piano.grand"/>- <sound id="keyboard.piano.honky-tonk"/>- <sound id="keyboard.piano.prepared"/>- <sound id="keyboard.piano.toy"/>- <sound id="keyboard.piano.upright"/>- <sound id="keyboard.virginal"/>- <sound id="metal.adodo"/>- <sound id="metal.anvil"/>- <sound id="metal.babendil"/>- <sound id="metal.bells.agogo"/>- <sound id="metal.bells.almglocken"/>- <sound id="metal.bells.bell-plate"/>- <sound id="metal.bells.bell-tree"/>- <sound id="metal.bells.carillon"/>- <sound id="metal.bells.chimes"/>- <sound id="metal.bells.chimta"/>- <sound id="metal.bells.chippli"/>- <sound id="metal.bells.church"/>- <sound id="metal.bells.cowbell"/>- <sound id="metal.bells.dawuro"/>- <sound id="metal.bells.gankokwe"/>- <sound id="metal.bells.ghungroo"/>- <sound id="metal.bells.hatheli"/>- <sound id="metal.bells.jingle-bell"/>- <sound id="metal.bells.khartal"/>- <sound id="metal.bells.mark-tree"/>- <sound id="metal.bells.sistrum"/>- <sound id="metal.bells.sleigh-bells"/>- <sound id="metal.bells.temple"/>- <sound id="metal.bells.tibetan"/>- <sound id="metal.bells.tinklebell"/>- <sound id="metal.bells.trychel"/>- <sound id="metal.bells.wind-chimes"/>- <sound id="metal.bells.zills"/>- <sound id="metal.berimbau"/>- <sound id="metal.brake-drums"/>- <sound id="metal.crotales"/>- <sound id="metal.cymbal.bo"/>- <sound id="metal.cymbal.ceng-ceng"/>- <sound id="metal.cymbal.chabara"/>- <sound id="metal.cymbal.chinese"/>- <sound id="metal.cymbal.ching"/>- <sound id="metal.cymbal.clash"/>- <sound id="metal.cymbal.crash"/>- <sound id="metal.cymbal.finger"/>- <sound id="metal.cymbal.hand"/>- <sound id="metal.cymbal.kesi"/>- <sound id="metal.cymbal.manjeera"/>- <sound id="metal.cymbal.reverse"/>- <sound id="metal.cymbal.ride"/>- <sound id="metal.cymbal.sizzle"/>- <sound id="metal.cymbal.splash"/>- <sound id="metal.cymbal.suspended"/>- <sound id="metal.cymbal.tebyoshi"/>- <sound id="metal.cymbal.tibetan"/>- <sound id="metal.cymbal.tingsha"/>- <sound id="metal.flexatone"/>- <sound id="metal.gong"/>- <sound id="metal.gong.ageng"/>- <sound id="metal.gong.agung"/>- <sound id="metal.gong.chanchiki"/>- <sound id="metal.gong.chinese"/>- <sound id="metal.gong.gandingan"/>- <sound id="metal.gong.kempul"/>- <sound id="metal.gong.kempyang"/>- <sound id="metal.gong.ketuk"/>- <sound id="metal.gong.kkwenggwari"/>- <sound id="metal.gong.luo"/>- <sound id="metal.gong.singing"/>- <sound id="metal.gong.thai"/>- <sound id="metal.guira"/>- <sound id="metal.hang"/>- <sound id="metal.hi-hat"/>- <sound id="metal.jaw-harp"/>- <sound id="metal.kengong"/>- <sound id="metal.murchang"/>- <sound id="metal.musical-saw"/>- <sound id="metal.singing-bowl"/>- <sound id="metal.spoons"/>- <sound id="metal.steel-drums"/>- <sound id="metal.tamtam"/>- <sound id="metal.thundersheet"/>- <sound id="metal.triangle"/>- <sound id="metal.washboard"/>- <sound id="pitched-percussion.angklung"/>- <sound id="pitched-percussion.balafon"/>- <sound id="pitched-percussion.bell-lyre"/>- <sound id="pitched-percussion.bells"/>- <sound id="pitched-percussion.bianqing"/>- <sound id="pitched-percussion.bianzhong"/>- <sound id="pitched-percussion.bonang"/>- <sound id="pitched-percussion.cimbalom"/>- <sound id="pitched-percussion.crystal-glasses"/>- <sound id="pitched-percussion.dan-tam-thap-luc"/>- <sound id="pitched-percussion.fangxiang"/>- <sound id="pitched-percussion.gandingan-a-kayo"/>- <sound id="pitched-percussion.gangsa"/>- <sound id="pitched-percussion.gender"/>- <sound id="pitched-percussion.giying"/>- <sound id="pitched-percussion.glass-harmonica"/>- <sound id="pitched-percussion.glockenspiel"/>- <sound id="pitched-percussion.glockenspiel.alto"/>- <sound id="pitched-percussion.glockenspiel.soprano"/>- <sound id="pitched-percussion.gyil"/>- <sound id="pitched-percussion.hammer-dulcimer"/>- <sound id="pitched-percussion.handbells"/>- <sound id="pitched-percussion.kalimba"/>- <sound id="pitched-percussion.kantil"/>- <sound id="pitched-percussion.khim"/>- <sound id="pitched-percussion.kulintang"/>- <sound id="pitched-percussion.kulintang-a-kayo"/>- <sound id="pitched-percussion.kulintang-a-tiniok"/>- <sound id="pitched-percussion.likembe"/>- <sound id="pitched-percussion.luntang"/>- <sound id="pitched-percussion.marimba"/>- <sound id="pitched-percussion.marimba.bass"/>- <sound id="pitched-percussion.mbira"/>- <sound id="pitched-percussion.mbira.array"/>- <sound id="pitched-percussion.metallophone"/>- <sound id="pitched-percussion.metallophone.alto"/>- <sound id="pitched-percussion.metallophone.bass"/>- <sound id="pitched-percussion.metallophone.soprano"/>- <sound id="pitched-percussion.music-box"/>- <sound id="pitched-percussion.pelog-panerus"/>- <sound id="pitched-percussion.pemade"/>- <sound id="pitched-percussion.penyacah"/>- <sound id="pitched-percussion.ranat.ek"/>- <sound id="pitched-percussion.ranat.ek-lek"/>- <sound id="pitched-percussion.ranat.thum"/>- <sound id="pitched-percussion.ranat.thum-lek"/>- <sound id="pitched-percussion.reyong"/>- <sound id="pitched-percussion.sanza"/>- <sound id="pitched-percussion.saron-barung"/>- <sound id="pitched-percussion.saron-demong"/>- <sound id="pitched-percussion.saron-panerus"/>- <sound id="pitched-percussion.slendro-panerus"/>- <sound id="pitched-percussion.slentem"/>- <sound id="pitched-percussion.tsymbaly"/>- <sound id="pitched-percussion.tubes"/>- <sound id="pitched-percussion.tubular-bells"/>- <sound id="pitched-percussion.vibraphone"/>- <sound id="pitched-percussion.xylophone"/>- <sound id="pitched-percussion.xylophone.alto"/>- <sound id="pitched-percussion.xylophone.bass"/>- <sound id="pitched-percussion.xylophone.soprano"/>- <sound id="pitched-percussion.xylorimba"/>- <sound id="pitched-percussion.yangqin"/>- <sound id="pluck.archlute"/>- <sound id="pluck.autoharp"/>- <sound id="pluck.baglama"/>- <sound id="pluck.bajo"/>- <sound id="pluck.balalaika"/>- <sound id="pluck.balalaika.alto"/>- <sound id="pluck.balalaika.bass"/>- <sound id="pluck.balalaika.contrabass"/>- <sound id="pluck.balalaika.piccolo"/>- <sound id="pluck.balalaika.prima"/>- <sound id="pluck.balalaika.secunda"/>- <sound id="pluck.bandola"/>- <sound id="pluck.bandura"/>- <sound id="pluck.bandurria"/>- <sound id="pluck.banjo"/>- <sound id="pluck.banjo.tenor"/>- <sound id="pluck.banjolele"/>- <sound id="pluck.barbat"/>- <sound id="pluck.bass"/>- <sound id="pluck.bass.acoustic"/>- <sound id="pluck.bass.bolon"/>- <sound id="pluck.bass.electric"/>- <sound id="pluck.bass.fretless"/>- <sound id="pluck.bass.guitarron"/>- <sound id="pluck.bass.synth"/>- <sound id="pluck.bass.synth.lead"/>- <sound id="pluck.bass.washtub"/>- <sound id="pluck.bass.whamola"/>- <sound id="pluck.begena"/>- <sound id="pluck.biwa"/>- <sound id="pluck.bordonua"/>- <sound id="pluck.bouzouki"/>- <sound id="pluck.bouzouki.irish"/>- <sound id="pluck.celtic-harp"/>- <sound id="pluck.charango"/>- <sound id="pluck.chitarra-battente"/>- <sound id="pluck.cithara"/>- <sound id="pluck.cittern"/>- <sound id="pluck.cuatro"/>- <sound id="pluck.dan-bau"/>- <sound id="pluck.dan-nguyet"/>- <sound id="pluck.dan-tranh"/>- <sound id="pluck.dan-ty-ba"/>- <sound id="pluck.diddley-bow"/>- <sound id="pluck.domra"/>- <sound id="pluck.domu"/>- <sound id="pluck.dulcimer"/>- <sound id="pluck.dutar"/>- <sound id="pluck.duxianqin"/>- <sound id="pluck.ektara"/>- <sound id="pluck.geomungo"/>- <sound id="pluck.gottuvadhyam"/>- <sound id="pluck.guitar"/>- <sound id="pluck.guitar.acoustic"/>- <sound id="pluck.guitar.electric"/>- <sound id="pluck.guitar.nylon-string"/>- <sound id="pluck.guitar.pedal-steel"/>- <sound id="pluck.guitar.portuguese"/>- <sound id="pluck.guitar.requinto"/>- <sound id="pluck.guitar.resonator"/>- <sound id="pluck.guitar.steel-string"/>- <sound id="pluck.guitjo"/>- <sound id="pluck.guitjo.double-neck"/>- <sound id="pluck.guqin"/>- <sound id="pluck.guzheng"/>- <sound id="pluck.guzheng.choazhou"/>- <sound id="pluck.harp"/>- <sound id="pluck.harp-guitar"/>- <sound id="pluck.huapanguera"/>- <sound id="pluck.jarana-huasteca"/>- <sound id="pluck.jarana-jarocha"/>- <sound id="pluck.jarana-jarocha.mosquito"/>- <sound id="pluck.jarana-jarocha.primera"/>- <sound id="pluck.jarana-jarocha.segunda"/>- <sound id="pluck.jarana-jarocha.tercera"/>- <sound id="pluck.kabosy"/>- <sound id="pluck.kantele"/>- <sound id="pluck.kanun"/>- <sound id="pluck.kayagum"/>- <sound id="pluck.kobza"/>- <sound id="pluck.komuz"/>- <sound id="pluck.kora"/>- <sound id="pluck.koto"/>- <sound id="pluck.kutiyapi"/>- <sound id="pluck.langeleik"/>- <sound id="pluck.laud"/>- <sound id="pluck.lute"/>- <sound id="pluck.lyre"/>- <sound id="pluck.mandobass"/>- <sound id="pluck.mandocello"/>- <sound id="pluck.mandola"/>- <sound id="pluck.mandolin"/>- <sound id="pluck.mandolin.octave"/>- <sound id="pluck.mandora"/>- <sound id="pluck.mandore"/>- <sound id="pluck.marovany"/>- <sound id="pluck.musical-bow"/>- <sound id="pluck.ngoni"/>- <sound id="pluck.oud"/>- <sound id="pluck.pipa"/>- <sound id="pluck.psaltery"/>- <sound id="pluck.ruan"/>- <sound id="pluck.sallaneh"/>- <sound id="pluck.sanshin"/>- <sound id="pluck.santoor"/>- <sound id="pluck.sanxian"/>- <sound id="pluck.sarod"/>- <sound id="pluck.saung"/>- <sound id="pluck.saz"/>- <sound id="pluck.se"/>- <sound id="pluck.setar"/>- <sound id="pluck.shamisen"/>- <sound id="pluck.sitar"/>- <sound id="pluck.synth"/>- <sound id="pluck.synth.charang"/>- <sound id="pluck.synth.chiff"/>- <sound id="pluck.synth.stick"/>- <sound id="pluck.tambura"/>- <sound id="pluck.tambura.bulgarian"/>- <sound id="pluck.tambura.female"/>- <sound id="pluck.tambura.male"/>- <sound id="pluck.tar"/>- <sound id="pluck.theorbo"/>- <sound id="pluck.timple"/>- <sound id="pluck.tiple"/>- <sound id="pluck.tres"/>- <sound id="pluck.ukulele"/>- <sound id="pluck.ukulele.tenor"/>- <sound id="pluck.valiha"/>- <sound id="pluck.veena"/>- <sound id="pluck.veena.mohan"/>- <sound id="pluck.veena.rudra"/>- <sound id="pluck.veena.vichitra"/>- <sound id="pluck.vihuela"/>- <sound id="pluck.vihuela.mexican"/>- <sound id="pluck.xalam"/>- <sound id="pluck.yueqin"/>- <sound id="pluck.zither"/>- <sound id="pluck.zither.overtone"/>- <sound id="rattle.afoxe"/>- <sound id="rattle.birds"/>- <sound id="rattle.cabasa"/>- <sound id="rattle.caxixi"/>- <sound id="rattle.cog"/>- <sound id="rattle.ganza"/>- <sound id="rattle.hosho"/>- <sound id="rattle.jawbone"/>- <sound id="rattle.kayamba"/>- <sound id="rattle.kpoko-kpoko"/>- <sound id="rattle.lava-stones"/>- <sound id="rattle.maraca"/>- <sound id="rattle.rain-stick"/>- <sound id="rattle.ratchet"/>- <sound id="rattle.rattle"/>- <sound id="rattle.shaker"/>- <sound id="rattle.shaker.egg"/>- <sound id="rattle.shekere"/>- <sound id="rattle.sistre"/>- <sound id="rattle.televi"/>- <sound id="rattle.vibraslap"/>- <sound id="rattle.wasembe"/>- <sound id="strings.ajaeng"/>- <sound id="strings.arpeggione"/>- <sound id="strings.baryton"/>- <sound id="strings.cello"/>- <sound id="strings.cello.piccolo"/>- <sound id="strings.contrabass"/>- <sound id="strings.crwth"/>- <sound id="strings.dan-gao"/>- <sound id="strings.dihu"/>- <sound id="strings.erhu"/>- <sound id="strings.erxian"/>- <sound id="strings.esraj"/>- <sound id="strings.fiddle"/>- <sound id="strings.fiddle.hardanger"/>- <sound id="strings.gadulka"/>- <sound id="strings.gaohu"/>- <sound id="strings.gehu"/>- <sound id="strings.group"/>- <sound id="strings.group.synth"/>- <sound id="strings.haegeum"/>- <sound id="strings.hurdy-gurdy"/>- <sound id="strings.igil"/>- <sound id="strings.kamancha"/>- <sound id="strings.kokyu"/>- <sound id="strings.laruan"/>- <sound id="strings.leiqin"/>- <sound id="strings.lirone"/>- <sound id="strings.lyra.byzantine"/>- <sound id="strings.lyra.cretan"/>- <sound id="strings.morin-khuur"/>- <sound id="strings.nyckelharpa"/>- <sound id="strings.octobass"/>- <sound id="strings.rebab"/>- <sound id="strings.rebec"/>- <sound id="strings.sarangi"/>- <sound id="strings.stroh-violin"/>- <sound id="strings.tromba-marina"/>- <sound id="strings.vielle"/>- <sound id="strings.viol"/>- <sound id="strings.viol.alto"/>- <sound id="strings.viol.bass"/>- <sound id="strings.viol.tenor"/>- <sound id="strings.viol.treble"/>- <sound id="strings.viol.violone"/>- <sound id="strings.viola"/>- <sound id="strings.viola-damore"/>- <sound id="strings.violin"/>- <sound id="strings.violono.piccolo"/>- <sound id="strings.violotta"/>- <sound id="strings.yayli-tanbur"/>- <sound id="strings.yazheng"/>- <sound id="strings.zhonghu"/>- <sound id="synth.effects"/>- <sound id="synth.effects.atmosphere"/>- <sound id="synth.effects.brightness"/>- <sound id="synth.effects.crystal"/>- <sound id="synth.effects.echoes"/>- <sound id="synth.effects.goblins"/>- <sound id="synth.effects.rain"/>- <sound id="synth.effects.sci-fi"/>- <sound id="synth.effects.soundtrack"/>- <sound id="synth.group"/>- <sound id="synth.group.fifths"/>- <sound id="synth.group.orchestra"/>- <sound id="synth.pad"/>- <sound id="synth.pad.bowed"/>- <sound id="synth.pad.choir"/>- <sound id="synth.pad.halo"/>- <sound id="synth.pad.metallic"/>- <sound id="synth.pad.polysynth"/>- <sound id="synth.pad.sweep"/>- <sound id="synth.pad.warm"/>- <sound id="synth.theremin"/>- <sound id="synth.tone.sawtooth"/>- <sound id="synth.tone.sine"/>- <sound id="synth.tone.square"/>- <sound id="voice.aa"/>- <sound id="voice.alto"/>- <sound id="voice.aw"/>- <sound id="voice.baritone"/>- <sound id="voice.bass"/>- <sound id="voice.child"/>- <sound id="voice.countertenor"/>- <sound id="voice.doo"/>- <sound id="voice.ee"/>- <sound id="voice.female"/>- <sound id="voice.kazoo"/>- <sound id="voice.male"/>- <sound id="voice.mezzo-soprano"/>- <sound id="voice.mm"/>- <sound id="voice.oo"/>- <sound id="voice.percussion"/>- <sound id="voice.percussion.beatbox"/>- <sound id="voice.soprano"/>- <sound id="voice.synth"/>- <sound id="voice.talk-box"/>- <sound id="voice.tenor"/>- <sound id="voice.vocals"/>- <sound id="wind.flutes.bansuri"/>- <sound id="wind.flutes.blown-bottle"/>- <sound id="wind.flutes.calliope"/>- <sound id="wind.flutes.danso"/>- <sound id="wind.flutes.di-zi"/>- <sound id="wind.flutes.dvojnice"/>- <sound id="wind.flutes.fife"/>- <sound id="wind.flutes.flageolet"/>- <sound id="wind.flutes.flute"/>- <sound id="wind.flutes.flute.alto"/>- <sound id="wind.flutes.flute.bass"/>- <sound id="wind.flutes.flute.contra-alto"/>- <sound id="wind.flutes.flute.contrabass"/>- <sound id="wind.flutes.flute.double-contrabass"/>- <sound id="wind.flutes.flute.irish"/>- <sound id="wind.flutes.flute.piccolo"/>- <sound id="wind.flutes.flute.subcontrabass"/>- <sound id="wind.flutes.fujara"/>- <sound id="wind.flutes.gemshorn"/>- <sound id="wind.flutes.hocchiku"/>- <sound id="wind.flutes.hun"/>- <sound id="wind.flutes.kaval"/>- <sound id="wind.flutes.kawala"/>- <sound id="wind.flutes.khlui"/>- <sound id="wind.flutes.knotweed"/>- <sound id="wind.flutes.koncovka.alto"/>- <sound id="wind.flutes.koudi"/>- <sound id="wind.flutes.ney"/>- <sound id="wind.flutes.nohkan"/>- <sound id="wind.flutes.nose"/>- <sound id="wind.flutes.ocarina"/>- <sound id="wind.flutes.overtone.tenor"/>- <sound id="wind.flutes.palendag"/>- <sound id="wind.flutes.panpipes"/>- <sound id="wind.flutes.quena"/>- <sound id="wind.flutes.recorder"/>- <sound id="wind.flutes.recorder.alto"/>- <sound id="wind.flutes.recorder.bass"/>- <sound id="wind.flutes.recorder.contrabass"/>- <sound id="wind.flutes.recorder.descant"/>- <sound id="wind.flutes.recorder.garklein"/>- <sound id="wind.flutes.recorder.great-bass"/>- <sound id="wind.flutes.recorder.sopranino"/>- <sound id="wind.flutes.recorder.soprano"/>- <sound id="wind.flutes.recorder.tenor"/>- <sound id="wind.flutes.ryuteki"/>- <sound id="wind.flutes.shakuhachi"/>- <sound id="wind.flutes.shepherds-pipe"/>- <sound id="wind.flutes.shinobue"/>- <sound id="wind.flutes.shvi"/>- <sound id="wind.flutes.suling"/>- <sound id="wind.flutes.tarka"/>- <sound id="wind.flutes.tumpong"/>- <sound id="wind.flutes.venu"/>- <sound id="wind.flutes.whistle"/>- <sound id="wind.flutes.whistle.alto"/>- <sound id="wind.flutes.whistle.low-irish"/>- <sound id="wind.flutes.whistle.shiva"/>- <sound id="wind.flutes.whistle.slide"/>- <sound id="wind.flutes.whistle.tin"/>- <sound id="wind.flutes.whistle.tin.bflat"/>- <sound id="wind.flutes.whistle.tin.d"/>- <sound id="wind.flutes.xiao"/>- <sound id="wind.flutes.xun"/>- <sound id="wind.group"/>- <sound id="wind.jug"/>- <sound id="wind.pipes.bagpipes"/>- <sound id="wind.pipes.gaida"/>- <sound id="wind.pipes.highland"/>- <sound id="wind.pipes.uilleann"/>- <sound id="wind.pungi"/>- <sound id="wind.reed.albogue"/>- <sound id="wind.reed.alboka"/>- <sound id="wind.reed.algaita"/>- <sound id="wind.reed.arghul"/>- <sound id="wind.reed.basset-horn"/>- <sound id="wind.reed.bassoon"/>- <sound id="wind.reed.bawu"/>- <sound id="wind.reed.bifora"/>- <sound id="wind.reed.bombarde"/>- <sound id="wind.reed.chalumeau"/>- <sound id="wind.reed.clarinet"/>- <sound id="wind.reed.clarinet.a"/>- <sound id="wind.reed.clarinet.alto"/>- <sound id="wind.reed.clarinet.bass"/>- <sound id="wind.reed.clarinet.basset"/>- <sound id="wind.reed.clarinet.bflat"/>- <sound id="wind.reed.clarinet.contra-alto"/>- <sound id="wind.reed.clarinet.contrabass"/>- <sound id="wind.reed.clarinet.eflat"/>- <sound id="wind.reed.clarinet.piccolo.aflat"/>- <sound id="wind.reed.clarinette-damour"/>- <sound id="wind.reed.contrabass"/>- <sound id="wind.reed.contrabassoon"/>- <sound id="wind.reed.cornamuse"/>- <sound id="wind.reed.cromorne"/>- <sound id="wind.reed.crumhorn"/>- <sound id="wind.reed.crumhorn.alto"/>- <sound id="wind.reed.crumhorn.bass"/>- <sound id="wind.reed.crumhorn.great-bass"/>- <sound id="wind.reed.crumhorn.soprano"/>- <sound id="wind.reed.crumhorn.tenor"/>- <sound id="wind.reed.diple"/>- <sound id="wind.reed.diplica"/>- <sound id="wind.reed.duduk"/>- <sound id="wind.reed.dulcian"/>- <sound id="wind.reed.dulzaina"/>- <sound id="wind.reed.english-horn"/>- <sound id="wind.reed.guanzi"/>- <sound id="wind.reed.harmonica"/>- <sound id="wind.reed.harmonica.bass"/>- <sound id="wind.reed.heckel-clarina"/>- <sound id="wind.reed.heckelphone"/>- <sound id="wind.reed.heckelphone.piccolo"/>- <sound id="wind.reed.heckelphone-clarinet"/>- <sound id="wind.reed.hichiriki"/>- <sound id="wind.reed.hirtenschalmei"/>- <sound id="wind.reed.hne"/>- <sound id="wind.reed.hornpipe"/>- <sound id="wind.reed.houguan"/>- <sound id="wind.reed.hulusi"/>- <sound id="wind.reed.jogi-baja"/>- <sound id="wind.reed.ken-bau"/>- <sound id="wind.reed.khaen-mouth-organ"/>- <sound id="wind.reed.launeddas"/>- <sound id="wind.reed.maqrunah"/>- <sound id="wind.reed.melodica"/>- <sound id="wind.reed.mijwiz"/>- <sound id="wind.reed.mizmar"/>- <sound id="wind.reed.nadaswaram"/>- <sound id="wind.reed.oboe"/>- <sound id="wind.reed.oboe.bass"/>- <sound id="wind.reed.oboe.piccolo"/>- <sound id="wind.reed.oboe-da-caccia"/>- <sound id="wind.reed.oboe-damore"/>- <sound id="wind.reed.octavin"/>- <sound id="wind.reed.pi"/>- <sound id="wind.reed.pibgorn"/>- <sound id="wind.reed.piri"/>- <sound id="wind.reed.rackett"/>- <sound id="wind.reed.rauschpfeife"/>- <sound id="wind.reed.rhaita"/>- <sound id="wind.reed.rothphone"/>- <sound id="wind.reed.sarrusaphone"/>- <sound id="wind.reed.saxonette"/>- <sound id="wind.reed.saxophone"/>- <sound id="wind.reed.saxophone.alto"/>- <sound id="wind.reed.saxophone.aulochrome"/>- <sound id="wind.reed.saxophone.baritone"/>- <sound id="wind.reed.saxophone.bass"/>- <sound id="wind.reed.saxophone.contrabass"/>- <sound id="wind.reed.saxophone.melody"/>- <sound id="wind.reed.saxophone.mezzo-soprano"/>- <sound id="wind.reed.saxophone.sopranino"/>- <sound id="wind.reed.saxophone.sopranissimo"/>- <sound id="wind.reed.saxophone.soprano"/>- <sound id="wind.reed.saxophone.subcontrabass"/>- <sound id="wind.reed.saxophone.tenor"/>- <sound id="wind.reed.shawm"/>- <sound id="wind.reed.shenai"/>- <sound id="wind.reed.sheng"/>- <sound id="wind.reed.sipsi"/>- <sound id="wind.reed.sopila"/>- <sound id="wind.reed.sorna"/>- <sound id="wind.reed.sralai"/>- <sound id="wind.reed.suona"/>- <sound id="wind.reed.surnai"/>- <sound id="wind.reed.taepyeongso"/>- <sound id="wind.reed.tarogato"/>- <sound id="wind.reed.tarogato.ancient"/>- <sound id="wind.reed.trompeta-china"/>- <sound id="wind.reed.tubax"/>- <sound id="wind.reed.xaphoon"/>- <sound id="wind.reed.zhaleika"/>- <sound id="wind.reed.zurla"/>- <sound id="wind.reed.zurna"/>- <sound id="wood.agogo-block"/>- <sound id="wood.agung-a-tamlang"/>- <sound id="wood.ahoko"/>- <sound id="wood.bones"/>- <sound id="wood.castanets"/>- <sound id="wood.claves"/>- <sound id="wood.drum-sticks"/>- <sound id="wood.gourd"/>- <sound id="wood.granite-block"/>- <sound id="wood.guban"/>- <sound id="wood.guiro"/>- <sound id="wood.hyoushigi"/>- <sound id="wood.ipu"/>- <sound id="wood.jam-block"/>- <sound id="wood.kaekeeke"/>- <sound id="wood.kagul"/>- <sound id="wood.kalaau"/>- <sound id="wood.kashiklar"/>- <sound id="wood.kubing"/>- <sound id="wood.pan-clappers"/>- <sound id="wood.sand-block"/>- <sound id="wood.slapstick"/>- <sound id="wood.stir-drum"/>- <sound id="wood.temple-block"/>- <sound id="wood.tic-toc-block"/>- <sound id="wood.tonetang"/>- <sound id="wood.wood-block"/>--}+-- | Representation of musical instruments, parts and playing techniques.+module Music.Parts (+ -- * Terminology+ -- $terminology+++ -- * Subparts+ module Music.Parts.Division,+ module Music.Parts.Subpart,++ -- * Solo vs. tutti+ module Music.Parts.Solo,+ + -- * Instruments+ module Music.Parts.Instrument,++ -- * Parts+ Part(..),+ _solo,+ _subpart,+ _instrument,+ divide,+ containsPart,+ smallestPart,+ smallestSubpart,+ largestPart,+ largestSubpart,+ distinctFrom,+ allDistinct,+ solo,+ tutti,++ -- ** Instruments etc+ piccoloFlute,+ flute,+ altoFlute,+ bassFlute,++ oboe,+ corAnglais,+ heckelphone,++ ebClarinet,+ clarinet,+ aClarinet,+ bassClarinet,++ sopranoSax,+ altoSax,+ tenorSax,+ baritoneSax,++ bassoon,+ contraBassoon,++ horn,+ piccoloTrumpet,+ trumpet,+ bassTrumpet,+ altoTrombone,+ tenorTrombone,+ trombone,+ bassTrombone,+ tuba,++ timpani,+ piano,++ celesta,+ glockenspiel,+ vibraphone,+ marimba,+ xylophone,+ xylorimba,+ tubularBells,+ dulcimer,++ accordion,+ harmonica,++ violin,+ viola,+ cello,+ doubleBass,++ -- ** Ensembles+ piccoloFlutes,+ flutes,+ oboes,+ clarinets,+ bassoons,++ flutes1,+ flutes2,+ oboes1,+ oboes2,+ clarinets1,+ clarinets2,++ horns,+ highHorns,+ lowHorns,+ trumpets,+ trombones,+ trumpets1,+ trumpets2,+ trombones1,+ trombones2,+ tubas,++ violins,+ violins1,+ violins2,+ violas,+ cellos,+ doubleBasses,++ harp,++ -- ** Default values+ defaultClef,+ defaultMidiProgram,+ defaultMidiChannel,+ defaultMidiNote,++ -- -- * Orchestration+ -- doubleParts,+ -- doublePartsInOctave,++ -- * Basic+ module Music.Parts.Basic++ ) where++import Control.Applicative+import Control.Lens (toListOf, Lens, Lens')+import Data.Default+-- import Data.Monoid+-- import Control.Lens (set)+import Data.Functor.Adjunction (unzipR)+import qualified Data.List+import Data.Maybe+import Data.Semigroup+import Data.Semigroup.Option.Instances+import Data.Traversable (traverse)+import Data.Typeable+import Text.Numeral.Roman (toRoman)++import Music.Parts.Basic+import Music.Parts.Subpart+import Music.Parts.Division+import Music.Parts.Solo+import Music.Parts.Instrument++{- $terminology++Parts represent a subset of a group of performers. It is mainly used for instrumental and+vocal music, but some concetps may be useful in electronic music as well.++- 'Section' refers to a set of instrumentfamilies related by sound production method (i.e. woodwind).++- 'Family' refers to a set of instrument or voice types, which typically differ in size (i.e. saxophones).++- 'Instrument' refers to a set of instruments or voice types of a given type (i.e. soprano saxophones).+ Perhaps confusingly, this includes vocal types such as alto, tenor etc as well. However, there is+ no good general term that incorporate both /instrument/ and /voice type/.++- A 'Part' is made up of an 'Instrument' and a 'Division' (i.e. Violin I). Solo parts are treated+ separately, so i.e. /Violin solo II/ (as in a double concerto) is distinct from /Violin II/.++-}++-- | A part is a subdivided group of instruments of a given type.+data Part = Part Solo Instrument Subpart+ deriving (Eq, Ord)++instance Show Part where+ show (Part Solo instr subp) = "Solo " ++ show instr ++ addS (show subp)+ where+ addS "" = ""+ addS x = " " ++ x+ show (Part _ instr subp) = show instr ++ addS (show subp)+ where+ addS "" = ""+ addS x = " " ++ x++-- Bad instance (?)+instance Enum Part where+ toEnum x = Part Tutti (toEnum x) def+ fromEnum (Part solo instr subp) = fromEnum instr++-- Semantics: Monoid (Option . First)+instance Monoid Part where+ mempty = def+ mappend x y+ | x == mempty = y+ | otherwise = x ++instance Semigroup Part where+ (<>) = mappend++instance Default Part where+ def = Part def def def++-- |+-- @a \`containsPart\` b@ holds if the set of players represented by a is an improper subset of the+-- set of players represented by b.+containsPart :: Part -> Part -> Bool+Part solo1 instr1 subp1 `containsPart` Part solo2 instr2 subp2 =+ solo1 == solo2+ && instr1 == instr2+ && subp1 `containsSubpart` subp2++smallestPart :: Part -> Part -> Part+smallestPart p1@(Part _ _ sp1) p2@(Part _ _ sp2)+ | sp1 `smallestSubpart` sp2 == sp1 = p1+ | sp1 `smallestSubpart` sp2 == sp2 = p2++smallestSubpart :: Subpart -> Subpart -> Subpart+smallestSubpart x y+ | x `isProperSubpartOf` y = x+ | y `isProperSubpartOf` x = y+ -- arbitrarily:+ | otherwise = x++largestPart :: Part -> Part -> Part+largestPart p1@(Part _ _ sp1) p2@(Part _ _ sp2)+ | sp1 `largestSubpart` sp2 == sp1 = p1+ | sp1 `largestSubpart` sp2 == sp2 = p2++largestSubpart :: Subpart -> Subpart -> Subpart+largestSubpart x y+ | x `isProperSubpartOf` y = y+ | y `isProperSubpartOf` x = x+ -- arbitrarily:+ | otherwise = x+++-- | Returns 'True' iff all given parts are distinct (as per 'distinctFrom').+allDistinct :: [Part] -> Bool+allDistinct [] = True+allDistinct (x:xs) = all (distinctFrom x) xs && allDistinct xs++-- | Returns 'True' iff x and y are completely distinct, i.e. neither contains the other.+-- +-- >>> violins `distinctFrom` trumpets+-- True+-- >>> violins `distinctFrom` violins+-- False+-- >>> violins `distinctFrom` violins1+-- False+-- >>> violins1 `distinctFrom` violins+-- False+-- >>> violins1 `distinctFrom` violins2+-- True+--+distinctFrom :: Part -> Part -> Bool+distinctFrom (Part s1 i1 sp1) (Part s2 i2 sp2) = s1 /= s2 || i1 /= i2 || noneSubpart+ where+ -- Is this needed?+ noneSubpart = not (sp1 `isSubpartOf` sp2) && not (sp2 `isSubpartOf` sp1)+++ + -- if equal+ -- [pa',pb'] = divide 2 pa++_solo :: Lens' Part Solo+_solo f (Part s i u) = fmap (\s -> Part s i u) $ f s++_subpart :: Lens' Part Subpart+_subpart f (Part s i u) = fmap (\u -> Part s i u) $ f u++_instrument :: Lens' Part Instrument+_instrument f (Part s i u) = fmap (\i -> Part s i u) $ f i++-- | Divide a part into @n@ subparts.+divide :: Int -> Part -> [Part]+divide n (Part solo instr subp) = fmap (\x -> Part solo instr (subp <> Subpart [x])) $ divisions n++solo instr = Part Solo instr def+tutti instr = Part Tutti instr def+++piccoloFlute = fromMidiProgram 72+flute = fromMidiProgram 73+altoFlute = fromMusicXmlSoundId "wind.flutes.flute.alto"+bassFlute = fromMusicXmlSoundId "wind.flutes.flute.bass"++oboe = fromMidiProgram 68+corAnglais = fromMidiProgram 69+heckelphone = fromMusicXmlSoundId "wind.reed.oboes.heckelphone"++ebClarinet = fromMusicXmlSoundId "wind.reed.clarinet.eflat"+clarinet = fromMidiProgram 71+aClarinet = fromMusicXmlSoundId "wind.reed.clarinet.a"+bassClarinet = fromMusicXmlSoundId "wind.reed.clarinet.bass"++sopranoSax = fromMidiProgram 64+altoSax = fromMidiProgram 65+tenorSax = fromMidiProgram 66+baritoneSax = fromMidiProgram 67++bassoon = fromMidiProgram 70+contraBassoon = fromMusicXmlSoundId "wind.reed.contrabassoon"++horn = fromMidiProgram 60+piccoloTrumpet = fromMusicXmlSoundId "brass.trumpet.piccolo"+trumpet = fromMidiProgram 56+bassTrumpet = fromMusicXmlSoundId "brass.trumpet.bass"+altoTrombone = fromMusicXmlSoundId "brass.trombone.alto"+trombone = tenorTrombone+tenorTrombone = fromMidiProgram 57+bassTrombone = fromMusicXmlSoundId "brass.trombone.bass"+tuba = fromMidiProgram 58++timpani = fromMidiProgram 47+piano = fromMidiProgram 0++celesta = fromMidiProgram 8+glockenspiel = fromMidiProgram 9+vibraphone = fromMidiProgram 11+marimba = fromMidiProgram 12+xylophone = fromMidiProgram 13+xylorimba = fromMusicXmlSoundId "pitched-percussion.xylorimba"+tubularBells = fromMidiProgram 14+dulcimer = fromMidiProgram 15++accordion = fromMidiProgram 21+harmonica = fromMidiProgram 22++violin = fromMidiProgram 40+viola = fromMidiProgram 41+cello = fromMidiProgram 42+doubleBass = fromMidiProgram 43++++defaultMidiProgram :: Part -> Int+defaultMidiProgram (Part _ instr _) = fromMaybe 0 $ toMidiProgram instr++defaultMidiNote :: Part -> Int+defaultMidiNote _ = 0++defaultMidiChannel :: Part -> Int+defaultMidiChannel = gmMidiChannel . defaultMidiProgram++defaultScoreOrder :: Part -> Double+defaultScoreOrder = gmScoreOrder . defaultMidiProgram++defaultClef :: Part -> Int+defaultClef = gmClef . defaultMidiProgram+{-+ ## Terminology: Voice vs Part++ A voice is a container of notes (non-overlapping)++ A part is an identifier for a set of singers/musicians AND all the notes in a score+ designated for this set of performers. Part extraction has the type++ extractParts :: HasPart a => Score a -> [Score a]++ I.e. in a score for piano and ensemble, certain notes may be *in the piano part*, i.e.+ designated for the piano. Typically, a part is monophonic or polyphonic. A monophonic+ part is a voice, i.e.++ -- | Are there overlapping notes?+ isMonophonic :: Score a -> Bool++ -- | Fails for polyphonic scores.+ s_oreToVoice :: Score a -> Voice (Maybe a)++ A polyphonic score contains several voices, i.e.++ s_oreToVoices :: Score a -> [Voice (Maybe a)]+++ A part is any type a that satisfies (Ord a, Show a).+ Optionally, we may add a contraint (HasPartName a), i.e.++ class HasPartName a where+ partName :: a -> String+ partAbbr :: a -> String+++ These contraints are used when printing scores (to get the order of the parts and their name).++ Vln1, Vln2 etc.++ Often we want to group parts, i.e.++ Chorus {+ Sop { Sop1 Sop2 }+ Alto { Alto1 Alto2 }+ Ten { Ten1 Ten 2 }+ Bass { Bass1 Bass2 }+ }+ Orchestra {+ Woodwinds { ... }+ Brass { ... }+ Perc { ... }+ Strings { ... }+ }+++ isInGroup :: Group -> Part -> Bool+ partGroups :: Part -> [Group]+++ partGroup :: (Part -> [Group] -> a) -> Group -> a+ tree :: (a -> [Tree a] -> b) -> Tree a -> b+++ data MyPart+ = Fl+ | Sop+ | Vl1+ | Vl2+ | Pno++-}++piccoloFlutes = tutti piccoloFlute+flutes = tutti flute+oboes = tutti oboe+clarinets = tutti clarinet+bassoons = tutti bassoon++[flutes1, flutes2] = divide 2 flutes+[oboes1, oboes2] = divide 2 oboes+[clarinets1, clarinets2] = divide 2 clarinets+++horns = tutti horn+highHorns = zipWith (!!) (repeat $ divide 4 horns) [0,2]+lowHorns = zipWith (!!) (repeat $ divide 4 horns) [1,3]+trumpets = tutti trumpet+trombones = tutti trombone+[trumpets1, trumpets2] = divide 2 trumpets+[trombones1, trombones2] = divide 2 trombones+tubas = tutti tuba++violins = tutti violin+[violins1, violins2] = divide 2 violins+violas = tutti viola+cellos = tutti cello+doubleBasses = tutti doubleBass++harp' = fromMidiProgram 46+harp = tutti harp'
src/Music/Parts/Basic.hs view
@@ -1,22 +1,5 @@ -{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeFamilies #-}----------------------------------------------------------------------------------------- |--- Copyright : (c) Hans Hoglund 2012-2015------ License : BSD-style------ Maintainer : hans@hanshoglund.se--- Stability : experimental--- Portability : non-portable (TF,GNTD)------ Provides various representaitons of musical instruments, subdivisions and parts.------------------------------------------------------------------------------------------+-- | Basic part representation. module Music.Parts.Basic ( BasicPart ) where@@ -25,13 +8,10 @@ import Control.Lens (toListOf) import Data.Default import Data.Functor.Adjunction (unzipR)-import qualified Data.List-import Data.Maybe import Data.Semigroup+import Data.Semigroup.Option.Instances import Data.Traversable (traverse) import Data.Typeable-import Text.Numeral.Roman (toRoman)-import Data.Semigroup.Option.Instances newtype BasicPart = BasicPart { getBasicPart :: Option (First Integer) } deriving (Eq, Ord, Num, Integral, Real, Enum, Typeable, Semigroup, Monoid)
src/Music/Parts/Division.hs view
@@ -1,20 +1,5 @@ -{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeFamilies #-}----------------------------------------------------------------------------------------- |--- Copyright : (c) Hans Hoglund 2012-2015------ License : BSD-style------ Maintainer : hans@hanshoglund.se--- Stability : experimental--- Portability : non-portable (TF,GNTD)------------------------------------------------------------------------------------------+-- | A type to represent (flat) subdivisions of a part. module Music.Parts.Division ( Division, division,@@ -25,11 +10,9 @@ ) where import Control.Applicative-import Control.Lens (toListOf)+import Control.Lens (toListOf) import Data.Default-import Data.Functor.Adjunction (unzipR)-import qualified Data.List-import Data.Maybe+import Data.Functor.Adjunction (unzipR) import Data.Semigroup import Data.Semigroup.Option.Instances import Data.Traversable (traverse)@@ -76,7 +59,7 @@ -- | Create a division out of a ratio. Dual of getDivision. division :: Int -> Int -> Division division n m- | n <= 0 || m <= 0 = error "Invalid division"+ | n < 0 || m <= 0 = error "Invalid division" | n < m = Division (n, m) | otherwise = error "Invalid division"
src/Music/Parts/Instrument.hs view
@@ -1,343 +1,215 @@ -{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeFamilies #-}----------------------------------------------------------------------------------------- |--- Copyright : (c) Hans Hoglund 2012-2015------ License : BSD-style------ Maintainer : hans@hanshoglund.se--- Stability : experimental--- Portability : non-portable (TF,GNTD)-----------------------------------------------------------------------------------------+{-| Representation of musical instruments. +The 'Instrument' type represent any instrument in the MusicXML Standard Sounds 3.0 set,+with some extensions. See <http://www.musicxml.com/for-developers/standard-sounds>.+-} module Music.Parts.Instrument (- Instrument(..),- -- TODO hide impl- allowedClefs,- playableRange,- comfortableRange,- playableDynamics,+ Instrument, - -- * Name etc- instrumentName,+ -- * Name+ -- instrumentName, fullName, shortName,+ fromMidiProgram,+ toMidiProgram,+ fromMusicXmlSoundId,+ toMusicXmlSoundId,++ -- * Clefs and transposition transposition,- transpositionString+ transpositionString,+ standardClef,+ allowedClefs,++ -- * Playing range+ playableRange,+ comfortableRange,+ -- playableDynamics,++ -- * Legacy+ gmClef,+ gmMidiChannel,+ gmScoreOrder,+ -- gmInstrName, ) where import Control.Applicative import Control.Lens (toListOf)+import Data.Aeson (ToJSON (..))+import qualified Data.Aeson import Data.Default import Data.Functor.Adjunction (unzipR) import qualified Data.List-import Data.Maybe+import Data.Map (Map)+import qualified Data.Maybe import Data.Semigroup import Data.Semigroup.Option.Instances import Data.Set (Set)+import qualified Data.Set import Data.Traversable (traverse) import Data.Typeable-import Music.Dynamics (Dynamics)-import Music.Pitch (Ambitus, Clef, trebleClef, bassClef)-import Music.Pitch.Common (Interval, Pitch) import Text.Numeral.Roman (toRoman) +import Music.Dynamics (Dynamics)+import Music.Parts.Internal.Data (InstrumentDef)+import qualified Music.Parts.Internal.Data as Data+import Music.Pitch++{-+Instrument is represented either by instrument ID or (more concisely) as GM program number.+The first GM program match in the data table is used.++Instruments not in the MusicXML 3 standard has has ".x." as part of their ID.+-}+ -- | An 'Instrument' represents the set of all instruments of a given type. data Instrument = StdInstrument Int | OtherInstrument String- deriving (Eq) instance Show Instrument where- show (StdInstrument x) = fromMaybe "(unknown)" $ gmInstrName x- show (OtherInstrument str) = str+ show x = Data.Maybe.fromMaybe "(unknown)" $ fullName x++-- TODO remove this instrance instance Enum Instrument where toEnum = StdInstrument fromEnum (StdInstrument x) = x fromEnum (OtherInstrument _) = error "Instrument.fromEnum used on unknown instrument" +instance Eq Instrument where+ x == y = soundId x == soundId y+ instance Ord Instrument where- StdInstrument x `compare` StdInstrument y = gmScoreOrder x `compare` gmScoreOrder y+ compare x y = compare (scoreOrder x) (scoreOrder y) -- | This instance is quite arbitrary but very handy. instance Default Instrument where def = StdInstrument 0 +instance ToJSON Instrument where+ toJSON (StdInstrument x) = Data.Aeson.object [("midi-instrument", toJSON x)]+ toJSON (OtherInstrument x) = Data.Aeson.object [("instrument-id", toJSON x)] --- TODO consolidate -gmClef :: Int -> Int-gmMidiChannel :: Int -> Int-gmScoreOrder :: Int -> Double+-- | Create an instrument from a MIDI program number.+-- Given number should be in the range 0 - 127.+fromMidiProgram :: Int -> Instrument+fromMidiProgram = StdInstrument -gmMidiChannel = fromMaybe 0 . fmap get . (`lookup` gmInstrs)- where get (x,_,_,_) = x+-- | Convert an instrument to a MIDI program number.+-- If the given instrument is not representable as a MIDI program, return @Nothing@.+toMidiProgram :: Instrument -> Maybe Int+toMidiProgram = fmap pred . Data.Maybe.listToMaybe . Data._generalMidiProgram . fetchInstrumentDef -gmScoreOrder = fromMaybe 0 . fmap get . (`lookup` gmInstrs)- where get (_,x,_,_) = x+-- | Create an instrument from a MusicXML Standard Sound ID.+fromMusicXmlSoundId :: String -> Instrument+fromMusicXmlSoundId = OtherInstrument -gmClef = fromMaybe 0 . fmap get . (`lookup` gmInstrs)- where get (_,_,x,_) = x+-- | Convert an instrument to a MusicXML Standard Sound ID.+-- If the given instrument is not in the MusicXMl standard, return @Nothing@.+toMusicXmlSoundId :: Instrument -> Maybe String+toMusicXmlSoundId = Just . soundId+-- TODO filter everything with .x. in them +soundId :: Instrument -> String+soundId = Data._soundId . fetchInstrumentDef -gmInstrName :: Int -> Maybe String-gmInstrName = fmap get . (`lookup` gmInstrs)- where get (_,_,_,x) = x+-- | Clefs allowed for this instrument.+allowedClefs :: Instrument -> Set Clef+allowedClefs = Data.Set.fromList . Data._allowedClefs . fetchInstrumentDef --- (midi program, (def midi ch, score order, def clef 0=g/1=c/2=f, name))-{-- Score order:- Woodwinds: 1- Brass: 2- Timpani: 3- Percussion: 4- Keyboard/Harp 5- Singers 6- Strings: 7- Bass: 8--}-gmInstrs :: [(Int, (Int, Double, Int, String))]-gmInstrs = [- -- (0, (0, 5.0, 0, "Acoustic Grand Piano")),- (0, (0, 5.0, 0, "Piano")),- (1, (0, 5.0, 0, "Bright Acoustic Piano")),- (2, (0, 5.0, 0, "Electric Grand Piano")),- (3, (0, 5.0, 0, "Honky-tonk Piano")),- (4, (0, 5.0, 0, "Electric Piano 1")),- (5, (0, 5.0, 0, "Electric Piano 2")),- (6, (0, 5.0, 0, "Harpsichord")),- (7, (0, 5.0, 0, "Clavinet")),+-- | Standard clef used for this instrument.+standardClef :: Instrument -> Maybe Clef+standardClef = Data.Maybe.listToMaybe . Data._standardClef . fetchInstrumentDef+-- TODO what about multi-staves? - (8, (0, 5.0, 0, "Celesta")),- (9, (0, 5.0, 0, "Glockenspiel")),- (9, (0, 5.0, 0, "Music Box")),- (11, (0, 4.0, 0, "Vibraphone")),- (12, (0, 4.0, 0, "Marimba")),- (13, (0, 4.0, 0, "Xylophone")),- (14, (0, 4.0, 0, "Tubular Bells")),- (15, (0, 4.0, 0, "Dulcimer")),+data BracketType = Bracket | Brace | SubBracket+data StaffLayout = Staff Clef | Staves BracketType [StaffLayout] - (16, (0, 5.0, 0, "Drawbar Organ")),- (17, (0, 5.0, 0, "Percussive Organ")),- (18, (0, 5.0, 0, "Rock Organ")),- (19, (0, 5.0, 0, "Church Organ")),- (20, (0, 5.0, 0, "Reed Organ")),- (21, (0, 5.0, 0, "Accordion")),- (22, (0, 5.0, 0, "Harmonica")),- (23, (0, 5.0, 0, "Tango Accordion")),+pianoStaff :: StaffLayout+pianoStaff = Staves Brace [Staff trebleClef, Staff bassClef] - (24, (0, 5.0, 0, "Acoustic Guitar (nylon)")),- (25, (0, 5.0, 0, "Acoustic Guitar (steel)")),- (26, (0, 5.0, 0, "Electric Guitar (jazz)")),- (27, (0, 5.0, 0, "Electric Guitar (clean)")),- (28, (0, 5.0, 0, "Electric Guitar (muted)")),- (29, (0, 5.0, 0, "Overdriven Guitar")),- (30, (0, 5.0, 0, "Distortion Guitar")),- (31, (0, 5.0, 0, "Guitar Harmonics")),+-- | Playable range for this instrument.+playableRange :: Instrument -> Ambitus Pitch+playableRange = Data.Maybe.fromMaybe (error "Missing comfortableRange for instrument") . Data._playableRange . fetchInstrumentDef - (32, (0, 8.0, 2, "Acoustic Bass")),- (33, (0, 8.0, 2, "Electric Bass (finger)")),- (34, (0, 8.0, 2, "Electric Bass (pick)")),- (35, (0, 8.0, 2, "Fretless Bass")),- (36, (0, 8.0, 2, "Slap Bass 1")),- (37, (0, 8.0, 2, "Slap Bass 2")),- (38, (0, 8.0, 2, "Synth Bass 1")),- (39, (0, 8.0, 2, "Synth Bass 2")),+-- | Comfortable range for this instrument.+comfortableRange :: Instrument -> Ambitus Pitch+comfortableRange = Data.Maybe.fromMaybe (error "Missing comfortableRange for instrument") . Data._comfortableRange . fetchInstrumentDef - (40, (12, 7.1, 0, "Violin")),- (41, (13, 7.2, 1, "Viola")),- -- (42, (0, 1.0, 0, "Cello")),- (42, (14, 7.3, 2, "Violoncello")),- (43, (15, 7.4, 2, "Contrabass")),- (44, (0, 7.0, 0, "Tremolo Strings")),- (45, (0, 7.0, 0, "Pizzicato Strings")),- (46, (11, 5.9, 0, "Orchestral Harp")),+-- playableDynamics :: Instrument -> Pitch -> Dynamics+-- playableDynamics = error "No playableDynamics" - (47, (8, 2.5, 2, "Timpani")),+-- instrumentName :: Instrument -> String+-- instrumentName = error "No name" - (48, (0, 7.0, 0, "String Ensemble 1")),- (49, (0, 7.0, 0, "String Ensemble 2")),- (50, (0, 7.0, 0, "Synth Strings 1")),- (51, (0, 7.0, 0, "Synth Strings 2")),+-- | Full instrument name.+fullName :: Instrument -> Maybe String+-- for now use _sibeliusName if present+fullName x = Data._sibeliusName (fetchInstrumentDef x) `first` Data._longName (fetchInstrumentDef x)+ where+ first (Just x) _ = Just x+ first _ (Just x) = Just x+ first Nothing Nothing = Nothing - (52, (0, 1.0, 0, "Choir Aahs")),- (53, (0, 1.0, 0, "Voice Oohs")),- (54, (0, 1.0, 0, "Synth Choir")),- (55, (0, 1.0, 0, "Orchestra Hit")),+-- | Instrument name abbrevation.+shortName :: Instrument -> Maybe String+shortName = Data._shortName . fetchInstrumentDef - (56, (5, 2.2, 0, "Trumpet in Bb")),- (57, (6, 2.3, 2, "Trombone")),- (58, (7, 2.4, 2, "Tuba")),- (59, (0, 2.2, 0, "Muted Trumpet")),- -- (60, (4, 2.1, 0, "French Horn")),- (60, (4, 2.1, 0, "Horn in F")),- (61, (0, 2.0, 0, "Brass Section")),- (62, (0, 2.0, 0, "Synth Brass 1")),- (63, (0, 2.0, 0, "Synth Brass 2")),+-- sounding .-. written, i.e. -P5 for horn+-- | Transposition interval.+transposition :: Instrument -> Interval+transposition = Data._transposition . fetchInstrumentDef+ where - (64, (0, 1.51, 0, "Soprano Sax")),- (65, (0, 1.52, 0, "Alto Sax")),- (66, (0, 1.53, 0, "Tenor Sax")),- (67, (0, 1.54, 0, "Baritone Sax")),- (68, (1, 1.3, 0, "Oboe")),- (69, (1, 1.4, 0, "English Horn")),- (70, (3, 1.7, 2, "Bassoon")),- (71, (2, 1.6, 0, "Clarinet in Bb")),+-- | A string representing transposition such as "Bb" or "F".+transpositionString :: Instrument -> String+transpositionString x = pitchToPCString (c .+^ transposition x)+-- pitch class sounding when c is notated (i.e. F for Horn in F) - (72, (0, 1.1, 0, "Piccolo")),- (73, (0, 1.2, 0, "Flute")),- (74, (0, 1.0, 0, "Recorder")),- (75, (0, 1.0, 0, "Pan Flute")),- (76, (0, 1.0, 0, "Blown bottle")),- (77, (0, 1.0, 0, "Shakuhachi")),- (78, (0, 1.0, 0, "Whistle")),- (79, (0, 1.0, 0, "Ocarina")), - (80, (0, 1.0, 0, "Lead 1 (square)")),- (81, (0, 1.0, 0, "Lead 2 (sawtooth)")),- (82, (0, 1.0, 0, "Lead 3 (calliope)")),- (83, (0, 1.0, 0, "Lead 4 (chiff)")),- (84, (0, 1.0, 0, "Lead 5 (charang)")),- (85, (0, 1.0, 0, "Lead 6 (voice)")),- (86, (0, 1.0, 0, "Lead 7 (fifths)")),- (87, (0, 1.0, 0, "Lead 8 (bass + lead)")), - (88, (0, 1.0, 0, "Pad 1 (new age)")),- (89, (0, 1.0, 0, "Pad 2 (warm)")),- (90, (0, 1.0, 0, "Pad 3 (polysynth)")),- (91, (0, 1.0, 0, "Pad 4 (choir)")),- (92, (0, 1.0, 0, "Pad 5 (bowed)")),- (93, (0, 1.0, 0, "Pad 6 (metallic)")),- (94, (0, 1.0, 0, "Pad 7 (halo)")),- (95, (0, 1.0, 0, "Pad 8 (sweep)")), - (96, (0, 1.0, 0, "FX 1 (rain)")),- (97, (0, 1.0, 0, "FX 2 (soundtrack)")),- (98, (0, 1.0, 0, "FX 3 (crystal)")),- (99, (0, 1.0, 0, "FX 4 (atmosphere)")),- (100, (0, 1.0, 0, "FX 5 (brightness)")),- (101, (0, 1.0, 0, "FX 6 (goblins)")),- (102, (0, 1.0, 0, "FX 7 (echoes)")),- (103, (0, 1.0, 0, "FX 8 (sci-fi)")),+-- TODO move+pitchToPCString :: Pitch -> String+pitchToPCString x = show (name x) ++ showA (accidental x)+ where+ showA 1 = "#"+ showA 0 = ""+ showA (-1) = "b" - (104, (0, 1.0, 0, "Sitar")),- (105, (0, 1.0, 0, "Banjo")),- (106, (0, 1.0, 0, "Shamisen")),- (107, (0, 1.0, 0, "Koto")),- (108, (0, 1.0, 0, "Kalimba")),- (109, (0, 1.0, 0, "Bagpipe")),- (110, (0, 1.0, 0, "Fiddle")),- (111, (0, 1.0, 0, "Shanai")), - (112, (0, 1.0, 0, "Tinkle Bell")),- (113, (0, 1.0, 0, "Agogo")),- (114, (0, 1.0, 0, "Steel Drums")),- (115, (0, 1.0, 0, "Woodblock")),- (116, (0, 1.0, 0, "Taiko Drum")),- (117, (0, 1.0, 0, "Melodic Tom")),- (118, (0, 1.0, 0, "Synth Drum")),- (119, (0, 1.0, 0, "Reverse Cymbal")),+scoreOrder :: Instrument -> Double+scoreOrder = Data._scoreOrder . fetchInstrumentDef - (120, (0, 1.0, 0, "Guitar Fret Noise")),- (121, (0, 1.0, 0, "Breath Noise")),- (122, (0, 1.0, 0, "Seashore")),- (123, (0, 1.0, 0, "Bird Tweet")),- (124, (0, 1.0, 0, "Telephone Ring")),- (125, (0, 1.0, 0, "Helicopter")),- (126, (0, 1.0, 0, "Applause")),- (127, (0, 1.0, 0, "Gunshot"))- ]+-- internal+fetchInstrumentDef :: Instrument -> InstrumentDef+fetchInstrumentDef (StdInstrument x) = Data.Maybe.fromMaybe (error "Bad instr") $ Data.getInstrumentDefByGeneralMidiProgram (x + 1)+fetchInstrumentDef (OtherInstrument x) = Data.Maybe.fromMaybe (error "Bad instr") $ Data.getInstrumentDefById x -gmPerc :: [(Int, String)]-gmPerc = [- (35, "Bass Drum 2"),- (36, "Bass Drum 1"),- (37, "Side Stick/Rimshot"),- (38, "Snare Drum 1"),- (39, "Hand Clap"),- (40, "Snare Drum 2"),- (41, "Low Tom 2"),- (42, "Closed Hi-hat"),- (43, "Low Tom 1"),- (44, "Pedal Hi-hat"),- (45, "Mid Tom 2"),- (46, "Open Hi-hat"),- (47, "Mid Tom 1"),- (48, "High Tom 2"),- (49, "Crash Cymbal 1"),- (50, "High Tom 1"),- (51, "Ride Cymbal 1"),- (52, "Chinese Cymbal"),- (53, "Ride Bell"),- (54, "Tambourine"),- (55, "Splash Cymbal"),- (56, "Cowbell"),- (57, "Crash Cymbal 2"),- (58, "Vibra Slap"),- (59, "Ride Cymbal 2"),- (60, "High Bongo"),- (61, "Low Bongo"),- (62, "Mute High Conga"),- (63, "Open High Conga"),- (64, "Low Conga"),- (65, "High Timbale"),- (66, "Low Timbale"),- (67, "High Agogô"),- (68, "Low Agogô"),- (69, "Cabasa"),- (70, "Maracas"),- (71, "Short Whistle"),- (72, "Long Whistle"),- (73, "Short Güiro"),- (74, "Long Güiro"),- (75, "Claves"),- (76, "High Wood Block"),- (77, "Low Wood Block"),- (78, "Mute Cuíca"),- (79, "Open Cuíca"),- (80, "Mute Triangle"),- (81, "Open Triangle")- ] -allowedClefs :: Instrument -> Set Clef-allowedClefs = error "No allowedClefs" -data BracketType = Bracket | Brace | SubBracket-data StaffLayout = Staff Clef | Staves BracketType [StaffLayout]+-- Legacy+-- TODO remove -pianoStaff :: StaffLayout-pianoStaff = Staves Brace [Staff trebleClef, Staff bassClef]+gmClef :: Int -> Int+gmMidiChannel :: Int -> Int+gmScoreOrder :: Int -> Double+gmInstrName :: Int -> Maybe String -playableRange :: Instrument -> Ambitus Pitch-playableRange = error "No playableRange"--comfortableRange :: Instrument -> Ambitus Pitch-comfortableRange = error "No comfortableRange"--playableDynamics :: Instrument -> Pitch -> Dynamics-playableDynamics = error "No playableDynamics"--instrumentName :: Instrument -> String-instrumentName = error "No name"--fullName :: Instrument -> String-fullName = error "No fullName"--shortName :: Instrument -> String-shortName = error "No shortName"+gmClef x = Data.Maybe.fromMaybe 0 $ fmap (go . Data._standardClef) $ Data.getInstrumentDefByGeneralMidiProgram (x + 1)+ where+ go cs | head cs == trebleClef = 0+ | head cs == altoClef = 1+ | head cs == bassClef = 2+ | otherwise = error "gmClef: Unknown clef" --- sounding .-. written, i.e. -P5 for clarinet-transposition :: Instrument -> Interval-transposition = error "No transposition"+gmScoreOrder x = Data.Maybe.fromMaybe 0 $ fmap (Data._scoreOrder) $ Data.getInstrumentDefByGeneralMidiProgram (x + 1)+gmMidiChannel x = Data.Maybe.fromMaybe 0 $ (=<<) (Data._defaultMidiChannel) $ Data.getInstrumentDefByGeneralMidiProgram (x + 1)+gmInstrName x = (=<<) (Data._longName) $ Data.getInstrumentDefByGeneralMidiProgram (x + 1) -transpositionString :: Instrument -> String-transpositionString = error "No transpositionString"
src/Music/Parts/Internal/Data.hs view
@@ -1,1114 +1,221 @@ -{-# LANGUAGE TypeSynonymInstances #-} -- because clef-{-# LANGUAGE FlexibleInstances #-} -- because clef-{-# LANGUAGE CPP #-}--module Music.Parts.Internal.Data where--import Music.Pitch.Clef-import Music.Pitch.Ambitus-import Music.Pitch--- type Clef = Int-type StandardSoundId = String--#ifndef GHCI-instance Num Clef where- fromInteger 0 = trebleClef- fromInteger 1 = altoClef- fromInteger 2 = bassClef-#endif--data InstrumentTopCategory- = Woodwind- | Brass- | Keyboard- | Fretted- | Percussion- | Vocal- | Strings- | Other- deriving (Show)---data InstrumentDef = InstrumentDef {- _midiProgram :: Int,- _defaultMidiChannel :: Int,- _soundId :: StandardSoundId,- _scoreOrder :: Double,- _defaultClef :: Clef,- _allowedClefs :: [Clef],- _topCategory :: InstrumentTopCategory,-- _midiName :: String,- _longName :: String,- _shortName :: String,-- -- Map from range -> dynamic- -- _comfortableRange :: Ambitus Pitch,- _allowedRange :: Ambitus Pitch- }- deriving (Show)--{--Sanity:-- >>> fmap _midiProgram defs == [0..127]---}--defs = [- InstrumentDef {- _soundId = "keyboard.piano",- _midiProgram = 0,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Piano"- },- InstrumentDef {- _soundId = "keyboard.piano",- _midiProgram = 1,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Bright Acoustic Piano"- },- InstrumentDef {- _soundId = "keyboard.piano.electric",- _midiProgram = 2,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Electric Grand Piano" - },- InstrumentDef {- _soundId = "keyboard.piano.honky-tonk",- _midiProgram = 3,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Honky-tonk Piano"- },- InstrumentDef {- _soundId = "keyboard.piano.electric",- _midiProgram = 4,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _defaultClef = trebleClef,- _longName = "Electric Piano 1"- },- InstrumentDef {- _soundId = "keyboard.piano.electric",- _midiProgram = 5,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Electric Piano 2"- },- InstrumentDef {- _soundId = "keyboard.harpsichord",- _midiProgram = 6,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Harpsichord"- },- InstrumentDef {- _soundId = "keyboard.electric",- _midiProgram = 7,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Clavinet"- },- InstrumentDef {- _soundId = "keyboard.celesta",- _midiProgram = 8,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Celesta"- },- InstrumentDef {- _midiProgram = 9,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Percussion,- _defaultClef = trebleClef,- _longName = "Glockenspiel"- },- InstrumentDef {- _midiProgram = 10,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Percussion,- _defaultClef = trebleClef,- _longName = "Music Box"- },- InstrumentDef {- _soundId = "pitched-percussion.vibraphone",- _midiProgram = 11,- _defaultMidiChannel = 0,- _scoreOrder = 4.0,- _topCategory = Percussion,- _defaultClef = trebleClef,- _longName = "Vibraphone"- },- InstrumentDef {- _soundId = "pitched-percussion.marimba",- _midiProgram = 12,- _defaultMidiChannel = 0,- _scoreOrder = 4.0,- _topCategory = Percussion,- _defaultClef = trebleClef,- _longName = "Marimba"- },- InstrumentDef {- _soundId = "pitched-percussion.xylophone",- _midiProgram = 13,- _defaultMidiChannel = 0,- _scoreOrder = 4.0,- _topCategory = Percussion,- _defaultClef = trebleClef,- _longName = "Xylophone"- },- InstrumentDef {- _soundId = "pitched-percussion.tubular-bells",- _midiProgram = 14,- _defaultMidiChannel = 0,- _scoreOrder = 4.0,- _topCategory = Percussion,- _defaultClef = trebleClef,- _longName = "Tubular Bells"- },- InstrumentDef {- _midiProgram = 15,- _defaultMidiChannel = 0,- _scoreOrder = 4.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Dulcimer"- },- InstrumentDef {- _midiProgram = 16,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Drawbar Organ"- },- InstrumentDef {- _midiProgram = 17,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Percussive Organ"- },- InstrumentDef {- _midiProgram = 18,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Rock Organ"- },- InstrumentDef {- _midiProgram = 19,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _defaultClef = trebleClef,- _longName = "Church Organ"- },- InstrumentDef {- _midiProgram = 20,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Reed Organ"- },- InstrumentDef {- _midiProgram = 21,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Accordion"- },- InstrumentDef {- _midiProgram = 22,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Harmonica"- },- InstrumentDef {- _midiProgram = 23,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Keyboard,- _defaultClef = trebleClef,- _longName = "Tango Accordion"- },- InstrumentDef {- _midiProgram = 24,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Acoustic Guitar (nylon)" - },- InstrumentDef {- _midiProgram = 25,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Acoustic Guitar (steel)"- },- InstrumentDef {- _midiProgram = 26,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Electric Guitar (jazz)"- },- InstrumentDef {- _midiProgram = 27,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Electric Guitar (clean)"- },- InstrumentDef {- _midiProgram = 28,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Electric Guitar (muted)"- },- InstrumentDef {- _midiProgram = 29,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Overdriven Guitar"- },- InstrumentDef {- _midiProgram = 30,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Distortion Guitar"- },- InstrumentDef {- _midiProgram = 31,- _defaultMidiChannel = 0,- _scoreOrder = 5.0,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Guitar Harmonics"- },- InstrumentDef {- _midiProgram = 32,- _defaultMidiChannel = 0,- _scoreOrder = 8.0,- _topCategory = Fretted,- _defaultClef = bassClef,- _longName = "Acoustic Bass"- },- InstrumentDef {- _midiProgram = 33,- _defaultMidiChannel = 0,- _scoreOrder = 8.0,- _topCategory = Fretted,- _defaultClef = bassClef,- _longName = "Electric Bass (finger)"- },- InstrumentDef {- _midiProgram = 34,- _defaultMidiChannel = 0,- _scoreOrder = 8.0,- _topCategory = Fretted,- _defaultClef = bassClef,- _longName = "Electric Bass (pick)"- },- InstrumentDef {- _midiProgram = 35,- _defaultMidiChannel = 0,- _scoreOrder = 8.0,- _topCategory = Fretted,- _defaultClef = bassClef,- _longName = "Fretless Bass"- },- InstrumentDef {- _midiProgram = 36,- _defaultMidiChannel = 0,- _scoreOrder = 8.0,- _topCategory = Fretted,- _defaultClef = bassClef,- _longName = "Slap Bass 1"- },- InstrumentDef {- _midiProgram = 37,- _defaultMidiChannel = 0,- _scoreOrder = 8.0,- _topCategory = Fretted,- _defaultClef = bassClef,- _longName = "Slap Bass 2"- },- InstrumentDef {- _midiProgram = 38,- _defaultMidiChannel = 0,- _scoreOrder = 8.0,- _topCategory = Fretted,- _defaultClef = bassClef,- _longName = "Synth Bass 1"- },- InstrumentDef {- _midiProgram = 39,- _defaultMidiChannel = 0,- _scoreOrder = 8.0,- _topCategory = Fretted,- _defaultClef = bassClef,- _longName = "Synth Bass 2"- },- InstrumentDef {- _midiProgram = 40,- _defaultMidiChannel = 12,- _scoreOrder = 7.1,- _topCategory = Strings,- _defaultClef = trebleClef,- _longName = "Violin"- },- InstrumentDef {- _midiProgram = 41,- _defaultMidiChannel = 13,- _scoreOrder = 7.2,- _topCategory = Strings,- _defaultClef = altoClef,- _longName = "Viola"- },- InstrumentDef {- _midiProgram = 42,- _defaultMidiChannel = 14,- _scoreOrder = 7.3,- _topCategory = Strings,- _defaultClef = bassClef,- _longName = "Violoncello"- },- InstrumentDef {- _midiProgram = 43,- _defaultMidiChannel = 15,- _scoreOrder = 7.4,- _topCategory = Strings,- _defaultClef = bassClef,- _longName = "Contrabass"- },- --- InstrumentDef {- _midiProgram = 44,- _defaultMidiChannel = 0,- _scoreOrder = 7.0,- _topCategory = Strings,- _defaultClef = trebleClef,- _longName = "Tremolo Strings"- },- InstrumentDef {- _midiProgram = 45,- _defaultMidiChannel = 0,- _scoreOrder = 7.0,- _topCategory = Strings,- _defaultClef = trebleClef,- _longName = "Pizzicato Strings"- },- InstrumentDef {- _midiProgram = 46,- _defaultMidiChannel = 11,- _scoreOrder = 5.9,- _topCategory = Fretted,- _defaultClef = trebleClef,- _longName = "Orchestral Harp"- },- -- - InstrumentDef {- _midiProgram = 47,- _defaultMidiChannel = 8,- _scoreOrder = 2.5,- _topCategory = Percussion,- _defaultClef = bassClef,- _longName = "Timpani"- },- -- - InstrumentDef {- _midiProgram = 48,- _defaultMidiChannel = 0,- _scoreOrder = 7.0,- _topCategory = Strings,- _defaultClef = trebleClef,- _longName = "String Ensemble 1"- },- InstrumentDef {- _midiProgram = 49,- _defaultMidiChannel = 0,- _scoreOrder = 7.0,- _topCategory = Strings,- _defaultClef = trebleClef,- _longName = "String Ensemble 2"- },- InstrumentDef {- _midiProgram = 50,- _defaultMidiChannel = 0,- _scoreOrder = 7.0,- _topCategory = Strings,- _defaultClef = trebleClef,- _longName = "Synth Strings 1"- },- InstrumentDef {- _midiProgram = 51,- _defaultMidiChannel = 0,- _scoreOrder = 7.0,- _topCategory = Strings,- _defaultClef = trebleClef,- _longName = "Synth Strings 2"- },- -- - InstrumentDef {- _midiProgram = 52,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Vocal,- _defaultClef = trebleClef,- _longName = "Choir Aahs"- },- InstrumentDef {- _midiProgram = 53,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Vocal,- _defaultClef = trebleClef,- _longName = "Voice Oohs"- },- InstrumentDef {- _midiProgram = 54,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Vocal,- _defaultClef = trebleClef,- _longName = "Synth Choir"- },- InstrumentDef {- _midiProgram = 55,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Vocal,- _defaultClef = trebleClef,- _longName = "Orchestra Hit"- },- -- - InstrumentDef {- _midiProgram = 56,- _defaultMidiChannel = 5,- _scoreOrder = 2.2,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Trumpet in Bb"- },- InstrumentDef {- _midiProgram = 57,- _defaultMidiChannel = 6,- _scoreOrder = 2.3,- _topCategory = Brass,- _defaultClef = bassClef,- _longName = "Trombone"- },- InstrumentDef {- _midiProgram = 58,- _defaultMidiChannel = 7,- _scoreOrder = 2.4,- _topCategory = Brass,- _defaultClef = bassClef,- _longName = "Tuba"- },- InstrumentDef {- _midiProgram = 59,- _defaultMidiChannel = 0,- _scoreOrder = 2.2,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Muted Trumpet"- },- InstrumentDef {- _midiProgram = 60,- _defaultMidiChannel = 4,- _scoreOrder = 2.1,- _topCategory = Brass,- _defaultClef = trebleClef,- _midiName = "French Horn",- _longName = "Horn in F"- },- InstrumentDef {- _midiProgram = 61,- _defaultMidiChannel = 0,- _scoreOrder = 2.0,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Brass Section"- },- InstrumentDef {- _midiProgram = 62,- _defaultMidiChannel = 0,- _scoreOrder = 2.0,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Synth Brass 1"- },- InstrumentDef {- _midiProgram = 63,- _defaultMidiChannel = 0,- _scoreOrder = 2.0,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Synth Brass 2"- },- -- - InstrumentDef {- _midiProgram = 64,- _defaultMidiChannel = 0,- _scoreOrder = 1.51,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Soprano Sax"- },- InstrumentDef {- _midiProgram = 65,- _defaultMidiChannel = 0,- _scoreOrder = 1.52,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Alto Sax"- },- InstrumentDef {- _midiProgram = 66,- _defaultMidiChannel = 0,- _scoreOrder = 1.53,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Tenor Sax"- },- InstrumentDef {- _midiProgram = 67,- _defaultMidiChannel = 0,- _scoreOrder = 1.54,- _topCategory = Brass,- _defaultClef = trebleClef,- _longName = "Baritone Sax"- },- InstrumentDef {- _midiProgram = 68,- _defaultMidiChannel = 1,- _scoreOrder = 1.3,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "Oboe"- },- InstrumentDef {- _midiProgram = 69,- _defaultMidiChannel = 1,- _scoreOrder = 1.4,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "English Horn"- },- InstrumentDef {- _midiProgram = 70,- _defaultMidiChannel = 3,- _scoreOrder = 1.7,- _topCategory = Woodwind,- _defaultClef = bassClef,- _longName = "Bassoon"- },- InstrumentDef {- _midiProgram = 71,- _defaultMidiChannel = 2,- _scoreOrder = 1.6,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "Clarinet in Bb"- },- -- - InstrumentDef {- _midiProgram = 72,- _defaultMidiChannel = 0,- _scoreOrder = 1.1,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "Piccolo"- },- InstrumentDef {- _midiProgram = 73,- _defaultMidiChannel = 0,- _scoreOrder = 1.2,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "Flute"- },- InstrumentDef {- _midiProgram = 74,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "Recorder"- },- InstrumentDef {- _midiProgram = 75,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "Pan Flute"- },- InstrumentDef {- _midiProgram = 76,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "Blown bottle"- },- InstrumentDef {- _midiProgram = 77,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Woodwind,- _defaultClef = trebleClef,- _longName = "Shakuhachi"- },- InstrumentDef {- _midiProgram = 78,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _topCategory = Vocal,- _defaultClef = trebleClef,- _longName = "Whistle"- },- InstrumentDef {- _midiProgram = 79,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Ocarina"- },- -- - InstrumentDef {- _midiProgram = 80,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Lead 1 (square)"- },- InstrumentDef {- _midiProgram = 81,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Lead 2 (sawtooth)"- },- InstrumentDef {- _midiProgram = 82,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Lead 3 (calliope)"- },- InstrumentDef {- _midiProgram = 83,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Lead 4 (chiff)"- },- InstrumentDef {- _midiProgram = 84,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Lead 5 (charang)"- },- InstrumentDef {- _midiProgram = 85,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Lead 6 (voice)"- },- InstrumentDef {- _midiProgram = 86,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Lead 7 (fifths)"- },- InstrumentDef {- _midiProgram = 87,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Lead 8 (bass + lead)"- },- -- - InstrumentDef {- _midiProgram = 88,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Pad 1 (new age)"- },- InstrumentDef {- _midiProgram = 89,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Pad 2 (warm)"- },- InstrumentDef {- _midiProgram = 90,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Pad 3 (polysynth)"- },- InstrumentDef {- _midiProgram = 91,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Pad 4 (choir)"- },- InstrumentDef {- _midiProgram = 92,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Pad 5 (bowed)"- },- InstrumentDef {- _midiProgram = 93,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Pad 6 (metallic)"- },- InstrumentDef {- _midiProgram = 94,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Pad 7 (halo)"- },- InstrumentDef {- _midiProgram = 95,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Pad 8 (sweep)"- },- -- - InstrumentDef {- _midiProgram = 96,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "FX 1 (rain)"- },- InstrumentDef {- _midiProgram = 97,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "FX 2 (soundtrack)"- },- InstrumentDef {- _midiProgram = 98,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "FX 3 (crystal)"- },- InstrumentDef {- _midiProgram = 99,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "FX 4 (atmosphere)"- },- InstrumentDef {- _midiProgram = 100,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "FX 5 (brightness)"- },- InstrumentDef {- _midiProgram = 101,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "FX 6 (goblins)"- },- InstrumentDef {- _midiProgram = 102,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "FX 7 (echoes)"- },- InstrumentDef {- _midiProgram = 103,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "FX 8 (sci-fi)"- },- InstrumentDef {- _midiProgram = 104,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Sitar"- },- InstrumentDef {- _midiProgram = 105,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Banjo"- },- InstrumentDef {- _midiProgram = 106,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Shamisen"- },- InstrumentDef {- _midiProgram = 107,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Koto"- },- InstrumentDef {- _midiProgram = 108,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Kalimba"- },- InstrumentDef {- _midiProgram = 109,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Bagpipe"- },- InstrumentDef {- _midiProgram = 110,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Fiddle"- },- InstrumentDef {- _midiProgram = 111,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Shanai"- },- InstrumentDef {- _midiProgram = 112,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Tinkle Bell"- },- InstrumentDef {- _midiProgram = 113,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Agogo"- },- InstrumentDef {- _midiProgram = 114,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Steel Drums"- },- InstrumentDef {- _midiProgram = 115,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Woodblock"- },- InstrumentDef {- _midiProgram = 116,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Taiko Drum"- },- InstrumentDef {- _midiProgram = 117,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Melodic Tom"- },- InstrumentDef {- _midiProgram = 118,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Synth Drum"- },- InstrumentDef {- _midiProgram = 119,- _defaultClef = trebleClef,- _scoreOrder = 1.0,- _defaultMidiChannel = 0,- _longName = "Reverse Cymbal"- },- InstrumentDef {- _midiProgram = 120,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Guitar Fret Noise"- },- InstrumentDef {- _midiProgram = 121,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Breath Noise"- },- InstrumentDef {- _midiProgram = 122,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Seashore"- },- InstrumentDef {- _midiProgram = 123,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Bird Tweet"- },- InstrumentDef {- _midiProgram = 124,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Telephone Ring"- },- InstrumentDef {- _midiProgram = 125,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Helicopter"- },- InstrumentDef {- _midiProgram = 126,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Applause"- },- InstrumentDef {- _midiProgram = 127,- _defaultMidiChannel = 0,- _scoreOrder = 1.0,- _defaultClef = trebleClef,- _longName = "Gunshot"- }- ]------{--gmPerc :: [(Int, String)]-gmPerc = [- (35, "Bass Drum 2"),- (36, "Bass Drum 1"),- (37, "Side Stick/Rimshot"),- (38, "Snare Drum 1"),- (39, "Hand Clap"),- (40, "Snare Drum 2"),- (41, "Low Tom 2"),- (42, "Closed Hi-hat"),- (43, "Low Tom 1"),- (44, "Pedal Hi-hat"),- (45, "Mid Tom 2"),- (46, "Open Hi-hat"),- (47, "Mid Tom 1"),- (48, "High Tom 2"),- (49, "Crash Cymbal 1"),- (50, "High Tom 1"),- (51, "Ride Cymbal 1"),- (52, "Chinese Cymbal"),- (53, "Ride Bell"),- (54, "Tambourine"),- (55, "Splash Cymbal"),- (56, "Cowbell"),- (57, "Crash Cymbal 2"),- (58, "Vibra Slap"),- (59, "Ride Cymbal 2"),- (60, "High Bongo"),- (61, "Low Bongo"),- (62, "Mute High Conga"),- (63, "Open High Conga"),- (64, "Low Conga"),- (65, "High Timbale"),- (66, "Low Timbale"),- (67, "High Agogô"),- (68, "Low Agogô"),- (69, "Cabasa"),- (70, "Maracas"),- (71, "Short Whistle"),- (72, "Long Whistle"),- (73, "Short Güiro"),- (74, "Long Güiro"),- (75, "Claves"),- (76, "High Wood Block"),- (77, "Low Wood Block"),- (78, "Mute Cuíca"),- (79, "Open Cuíca"),- (80, "Mute Triangle"),- (81, "Open Triangle")- ]--}+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE TypeSynonymInstances #-}++module Music.Parts.Internal.Data (+ SoundId,+ -- InstrumentTopCategory(..),+ InstrumentDef(..),+ getInstrumentDefById,+ getInstrumentDefByGeneralMidiProgram,+ getInstrumentDefByGeneralMidiPercussionNote,+) where++import Control.Monad.Plus+import Data.Map (Map)++import Control.Applicative+import Control.Lens (toListOf, (^.))+import Data.AffineSpace+import qualified Data.ByteString.Lazy+import qualified Data.ByteString.Lazy.Char8+import Data.Csv (FromField (..), FromRecord (..),+ (.!))+import qualified Data.Csv+import qualified Data.List+import Data.Traversable (traverse)+import Data.VectorSpace+import qualified System.IO.Unsafe++import Music.Pitch+import Music.Pitch.Ambitus+import Music.Pitch.Clef++#ifndef GHCI+#define GET_DATA_FILE Paths_music_parts.getDataFileName+import qualified Paths_music_parts+#else+#define GET_DATA_FILE (return . ("../music-parts/"++))+#endif+++type SoundId = String++#ifndef GHCI+instance Num Clef where+ fromInteger 0 = trebleClef+ fromInteger 1 = altoClef+ fromInteger 2 = bassClef+#endif++data InstrumentTopCategory+ = Woodwind+ | Brass+ | Keyboard+ | Fretted+ | Percussion+ | Vocal+ | Strings+ | Other+ deriving (Show)+++data InstrumentDef = InstrumentDef {++ _soundId :: SoundId, -- ID+ _generalMidiProgram :: [Int], -- GM Program+ _generalMidiPercussionNote :: [Int], -- GM Percussion Note+ _defaultMidiChannel :: Maybe Int, -- Default MIDI Channel+ _scoreOrder :: Double, -- Score Order+++ _allowedClefs :: [Clef], -- Allowed Clefs+ _standardClef :: [Clef], -- Standard Clef (1 elem for single staff, more otherwise, never empty)++ _transposition :: Interval, -- Transposition+ _playableRange :: Maybe (Ambitus Pitch), -- Playable Range+ _comfortableRange :: Maybe (Ambitus Pitch), -- Comfortable Range+ _longName :: Maybe String,+ _shortName :: Maybe String,+ _sibeliusName :: Maybe String+ }+ deriving (Show)+++getInstrumentDefById :: String -> Maybe InstrumentDef+getInstrumentDefById a = Data.List.find (\x -> _soundId x == a) defs+ where+ -- Safe as this file never change+ defs = System.IO.Unsafe.unsafePerformIO getInstrumentData+getInstrumentDefByGeneralMidiProgram :: Int -> Maybe InstrumentDef+getInstrumentDefByGeneralMidiProgram a = Data.List.find (\x -> a `elem` _generalMidiProgram x) defs+ where+ -- Safe as this file never change+ defs = System.IO.Unsafe.unsafePerformIO getInstrumentData+getInstrumentDefByGeneralMidiPercussionNote :: Int -> Maybe InstrumentDef+getInstrumentDefByGeneralMidiPercussionNote a = Data.List.find (\x -> a `elem` _generalMidiPercussionNote x) defs+ where+ -- Safe as this file never change+ defs = System.IO.Unsafe.unsafePerformIO getInstrumentData+++-- TODO move+pitchFromSPN :: String -> Maybe Pitch+pitchFromSPN x = fmap (\on -> (.+^ _P8^*(on-4))) (safeRead octS) <*> pc pcS+ where+ pc "C" = Just c+ pc "D" = Just d+ pc "E" = Just e+ pc "F" = Just f+ pc "G" = Just g+ pc "A" = Just a+ pc "B" = Just b++ pc "Cs" = Just cs+ pc "Ds" = Just ds+ pc "Es" = Just es+ pc "Fs" = Just fs+ pc "Gs" = Just gs+ pc "As" = Just as+ pc "Bs" = Just bs++ pc "Cb" = Just cb+ pc "Db" = Just db+ pc "Eb" = Just eb+ pc "Fb" = Just fb+ pc "Gb" = Just gb+ pc "Ab" = Just ab+ pc "Bb" = Just bb+ pc _ = Nothing+ pcS = init x+ octS = pure $ last x++safeRead x = Just (read x) -- TODO catch exception++readClef :: String -> Maybe Clef+readClef = go where+ -- go "french" = Just trebleClef+ go "treble" = Just trebleClef+ go "sop" = Just sopranoClef+ go "mez" = Just mezzoSopranoClef+ go "alto" = Just altoClef+ go "ten" = Just tenorClef+ go "bar" = Just baritoneClef+ go "bass" = Just bassClef+ go "perc" = Just percClef+ go _ = Nothing++ percClef = Clef (PercClef, 0, 0) -- TODO move++{-+Can't stop these instances from being reexported (https://www.haskell.org/onlinereport/modules.html)+so they are transitively exported by all modules depending on the Suite!++Drats!+-}+instance FromField [Int] where+ parseField v = fmap (mcatMaybes . map safeRead) $ fmap (splitBy ',') $ parseField v++instance FromField Pitch where+ parseField v = mcatMaybes $ fmap pitchFromSPN $ parseField v++instance FromField (Maybe (Ambitus Pitch)) where+ parseField v = fmap (listToAmbitus . mcatMaybes . map pitchFromSPN) $ fmap (splitBy '-') $ parseField v+ where+ listToAmbitus [a,b] = Just $ (a,b)^.ambitus+ listToAmbitus _ = Nothing++instance FromField Clef where+ parseField v = mcatMaybes $ fmap readClef $ parseField v++instance FromField [Clef] where+ parseField v = fmap (mcatMaybes . map readClef) $ fmap (splitBy ',') $ parseField v++instance FromRecord InstrumentDef where+ parseRecord v = InstrumentDef+ <$> v .! 0+ <*> v .! 1+ <*> v .! 2+ <*> v .! 3+ <*> v .! 4++ <*> v .! 5+ <*> v .! 6++ <*> fmap (.-.(c::Pitch)) (v .! 7) -- sounding - written, i.e. -P8 for double bass+ <*> v .! 8+ <*> v .! 9+ <*> v .! 10+ <*> v .! 11+ <*> v .! 12++{-+Don't edit data files!+Original here+ https://docs.google.com/spreadsheets/d/1I7lCGd8u4ggqqa_ATMVb87V10Vc8J8TP9w-vXu0M18o/edit#gid=0+-}+getInstrumentData' :: IO [Map String String]+getInstrumentData' = do+ fp <- GET_DATA_FILE "data/instruments.csv"+ d <- Data.ByteString.Lazy.readFile fp+ return $ case Data.Csv.decodeByName d of+ Left e -> error $ "Could not read data/instruments.csv "++show e+ Right (_header, x) -> toListOf traverse x++getInstrumentData :: IO [InstrumentDef]+getInstrumentData = do+ fp <- GET_DATA_FILE "data/instruments.csv"+ d <- Data.ByteString.Lazy.readFile fp+ return $ case Data.Csv.decode Data.Csv.HasHeader d of+ Left e -> error $ "Could not read data/instruments.csv "++show e+ Right (x) -> toListOf traverse x++splitBy :: Eq a => a -> [a] -> [[a]]+splitBy _ [] = []+splitBy x xs = splitBy1 x xs+ where+ splitBy1 delimiter = foldr f [[]]+ where f c l@(x:xs) | c == delimiter = []:l+ | otherwise = (c:x):xs+
src/Music/Parts/Solo.hs view
@@ -1,20 +1,5 @@ -{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeFamilies #-}----------------------------------------------------------------------------------------- |--- Copyright : (c) Hans Hoglund 2012-2015------ License : BSD-style------ Maintainer : hans@hanshoglund.se--- Stability : experimental--- Portability : non-portable (TF,GNTD)------------------------------------------------------------------------------------------+-- | Representation of solo vs. tutti. module Music.Parts.Solo ( Solo(..), ) where
src/Music/Parts/Subpart.hs view
@@ -1,20 +1,5 @@ -{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeFamilies #-}----------------------------------------------------------------------------------------- |--- Copyright : (c) Hans Hoglund 2012-2015------ License : BSD-style------ Maintainer : hans@hanshoglund.se--- Stability : experimental--- Portability : non-portable (TF,GNTD)------------------------------------------------------------------------------------------+-- | A type to represent (recursive) subdivisions of a part. module Music.Parts.Subpart ( Subpart(..), containsSubpart,@@ -47,11 +32,21 @@ newtype Subpart = Subpart [Division] deriving (Eq, Ord, Default, Semigroup, Monoid) +{-+TODO hide internals++Expose++_divisions :: Traversal' Subpart Division++or similar +-}+ instance Show Subpart where- show (Subpart ps) = Data.List.intercalate "." $ mapFR showDivisionR showDivision $ ps- where- mapFR f g [] = []- mapFR f g (x:xs) = f x : fmap g xs+ show (Subpart ps) = Data.List.intercalate "." $ mapFR showDivisionR showDivision $ ps+ where+ mapFR f g [] = []+ mapFR f g (x:xs) = f x : fmap g xs containsSubpart :: Subpart -> Subpart -> Bool containsSubpart = flip isSubpartOf@@ -62,8 +57,8 @@ isSubpartOf :: Subpart -> Subpart -> Bool Subpart x `isSubpartOf` Subpart y = y `Data.List.isPrefixOf` x -x `isProperSubpartOf` y =- x `isSubpartOf` y && x /= y+isProperSubpartOf :: Subpart -> Subpart -> Bool+x `isProperSubpartOf` y = x `isSubpartOf` y && x /= y
src/Music/Parts/Voices.hs view
@@ -1,23 +1,6 @@ -{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeFamilies #-}----------------------------------------------------------------------------------------- |--- Copyright : (c) Hans Hoglund 2012-2015------ License : BSD-style------ Maintainer : hans@hanshoglund.se--- Stability : experimental--- Portability : non-portable (TF,GNTD)------ Provides basic voice types. Useful for vocal music but also for abstract--- voice leading etc.------------------------------------------------------------------------------------------+-- | Provides basic voice types. Useful for vocal music but also for abstract+-- voice leading problems etc. module Music.Parts.Voices ( ) where