Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type MidiData = T
- type IPitch = Int
- type IDur = Int
- class MidiNotes a where
- 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.
toMidiNotes :: a -> [([IPitch], IDur)] Source #
Tempo in microseconds per quarter. See fromBPM
.
Midi channel, 1-16 presumably.
newtype MidiVelocity Source #
note velocity, 0-127
newtype MidiProgram Source #
Midi program. See fromInstrument
.
Midi ticks per quarter.
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.