Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
- data Instrument
- fullName :: Instrument -> Maybe String
- shortName :: Instrument -> Maybe String
- fromMidiProgram :: Int -> Instrument
- toMidiProgram :: Instrument -> Maybe Int
- fromMusicXmlSoundId :: String -> Instrument
- toMusicXmlSoundId :: Instrument -> Maybe String
- transposition :: Instrument -> Interval
- transpositionString :: Instrument -> String
- standardClef :: Instrument -> Maybe Clef
- allowedClefs :: Instrument -> Set Clef
- playableRange :: Instrument -> Ambitus Pitch
- comfortableRange :: Instrument -> Ambitus Pitch
- gmClef :: Int -> Int
- gmMidiChannel :: Int -> Int
- gmScoreOrder :: Int -> Double
Documentation
data Instrument Source
An Instrument
represents the set of all instruments of a given type.
Enum Instrument | |
Eq Instrument | |
Ord Instrument | |
Show Instrument | |
ToJSON Instrument | |
FromJSON Instrument | |
Default Instrument | This instance is quite arbitrary but very handy. |
Name
fullName :: Instrument -> Maybe String Source
Full instrument name.
shortName :: Instrument -> Maybe String Source
Instrument name abbrevation.
fromMidiProgram :: Int -> Instrument Source
Create an instrument from a MIDI program number. Given number should be in the range 0 - 127.
toMidiProgram :: Instrument -> Maybe Int Source
Convert an instrument to a MIDI program number.
If the given instrument is not representable as a MIDI program, return Nothing
.
fromMusicXmlSoundId :: String -> Instrument Source
Create an instrument from a MusicXML Standard Sound ID.
toMusicXmlSoundId :: Instrument -> Maybe String Source
Convert an instrument to a MusicXML Standard Sound ID.
If the given instrument is not in the MusicXMl standard, return Nothing
.
Clefs and transposition
transposition :: Instrument -> Interval Source
Transposition interval.
standardClef :: Instrument -> Maybe Clef Source
Standard clef used for this instrument.
allowedClefs :: Instrument -> Set Clef Source
Clefs allowed for this instrument.
Playing range
playableRange :: Instrument -> Ambitus Pitch Source
Playable range for this instrument.
comfortableRange :: Instrument -> Ambitus Pitch Source
Comfortable range for this instrument.
Legacy
gmMidiChannel :: Int -> Int Source
gmScoreOrder :: Int -> Double Source