| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Fadno.Midi
Synopsis
- type MidiData = T
- type IPitch = Int
- type IDur = Int
- class MidiNotes a where
- toMidiNotes :: a -> [([IPitch], IDur)]
- newtype MidiTempo = MidiTempo Int
- newtype MidiChan = MidiChan Int
- newtype MidiVelocity = MidiVelocity Int
- newtype MidiProgram = MidiProgram Int
- newtype MidiTicks = MidiTicks Int
- toTicks :: MidiTicks -> Iso' Rational IDur
- data MidiEvent
- type MidiTrack = Track
- writeMidiFile :: FilePath -> MidiData -> IO ()
- showMidiFile :: FilePath -> IO ()
- midi :: MidiTicks -> [MidiTrack] -> MidiData
- makeTrackFull :: MidiNotes notes => MidiTempo -> MidiChan -> MidiProgram -> MidiVelocity -> notes -> MidiTrack
- fromBPM :: (Real a, Show a) => a -> MidiTempo
- fromInstrument :: Instrument -> MidiProgram
- makeTrack :: [MidiEvent] -> MidiTrack
- toNoteEvents :: MidiNotes notes => MidiChan -> MidiVelocity -> notes -> [MidiEvent]
- voiceEvent :: MidiChan -> T -> MidiEvent
- setTempo :: MidiTempo -> MidiEvent
- metaEvent :: T -> MidiEvent
- midiEvent :: MidiChan -> Body -> MidiEvent
- programChange :: MidiChan -> MidiProgram -> MidiEvent
- noteEvents :: MidiChan -> MidiVelocity -> ([IPitch], IDur) -> [MidiEvent]
- noteEvent :: (Pitch -> Velocity -> T) -> MidiChan -> MidiVelocity -> IPitch -> MidiEvent
- noteOn :: MidiChan -> MidiVelocity -> IPitch -> MidiEvent
- noteOff :: MidiChan -> MidiVelocity -> IPitch -> MidiEvent
- test1 :: IO ()
- playMidi :: MidiNotes n => FilePath -> Int -> [(Instrument, n)] -> IO ()
Documentation
class MidiNotes a where Source #
Convert some note value to midi-ready values.
Methods
toMidiNotes :: a -> [([IPitch], IDur)] Source #
Tempo in microseconds per quarter. See fromBPM.
Constructors
| MidiTempo Int |
Instances
| Bounded MidiTempo Source # | |
Defined in Fadno.Midi | |
| Enum MidiTempo Source # | |
| Num MidiTempo Source # | |
| Integral MidiTempo Source # | |
Defined in Fadno.Midi | |
| Real MidiTempo Source # | |
Defined in Fadno.Midi Methods toRational :: MidiTempo -> Rational | |
| Show MidiTempo Source # | |
| Eq MidiTempo Source # | |
| Ord MidiTempo Source # | |
Defined in Fadno.Midi | |
Midi channel, 1-16 presumably.
Constructors
| MidiChan Int |
Instances
| Bounded MidiChan Source # | |
Defined in Fadno.Midi | |
| Enum MidiChan Source # | |
Defined in Fadno.Midi | |
| Num MidiChan Source # | |
| Integral MidiChan Source # | |
| Real MidiChan Source # | |
Defined in Fadno.Midi Methods toRational :: MidiChan -> Rational | |
| Show MidiChan Source # | |
| Eq MidiChan Source # | |
| Ord MidiChan Source # | |
newtype MidiVelocity Source #
note velocity, 0-127
Constructors
| MidiVelocity Int |
Instances
newtype MidiProgram Source #
Midi program. See fromInstrument.
Constructors
| MidiProgram Int |
Instances
Midi ticks per quarter.
Constructors
| MidiTicks Int |
Instances
| Bounded MidiTicks Source # | |
Defined in Fadno.Midi | |
| Enum MidiTicks Source # | |
| Num MidiTicks Source # | |
| Integral MidiTicks Source # | |
Defined in Fadno.Midi | |
| Real MidiTicks Source # | |
Defined in Fadno.Midi Methods toRational :: MidiTicks -> Rational | |
| Show MidiTicks Source # | |
| Eq MidiTicks Source # | |
| Ord MidiTicks Source # | |
Defined in Fadno.Midi | |
writeMidiFile :: FilePath -> MidiData -> IO () Source #
write to disk.
showMidiFile :: FilePath -> IO () Source #
debug midi file.
makeTrackFull :: MidiNotes notes => MidiTempo -> MidiChan -> MidiProgram -> MidiVelocity -> notes -> MidiTrack Source #
make a standard track which specifies tempo and program.
| see makeTrack for more control.
fromInstrument :: Instrument -> MidiProgram Source #
convert a General MIDI Instrument.
toNoteEvents :: MidiNotes notes => MidiChan -> MidiVelocity -> notes -> [MidiEvent] Source #
turn notes into track events.
programChange :: MidiChan -> MidiProgram -> MidiEvent Source #
program change MIDI Voice event.
noteEvents :: MidiChan -> MidiVelocity -> ([IPitch], IDur) -> [MidiEvent] Source #
note on + note off events, using Pad to carve out space.