@hackage PortMidi-simple0.1.0.1

Simplified PortMidi wrapper

  • Installation

  • Dependencies (2)

  • Dependents (0)

  • Package Flags

      executables
       (off by default)

PortMidi-simple 🚢🎶

Reading from MIDI controllers should not be too difficult.

{-# LANGUAGE BlockArguments #-}
import qualified Sound.PortMidi.Simple as Midi

main = Midi.withMidi do
  Just device <- Midi.findInputNamed "nanoKONTROL2"
  Midi.withInput device \stream ->
    Midi.withReadMessages stream 256 \readMessages ->
      forever do
        readMessages >>= mapM_ print
        threadDelay 1000