úÎcz^Ó=      !"#$%&'()*+,-./0123456789:;< Safe-Inferred 24<Low level stuff.%Type of the user callback function. pThe type representing a timestamped MIDI message. Time is measured in milisecs elapsed since the last call to . 'The type representing a MIDI message. 'clock is sent 24 times per quarter note(measured in "MIDI beats" (1/16th notes)."not including the bytes 0xf0, 0xf7*first argument is the MIDI channel (1..16)A "regular" MIDI message.ÿÙRemark: According to the MIDI standard, NoteOff also has a velocity. However, most keyboards do not use this feature (send the default value 64), and there are keyboards which do not send NoteOff messages at all, but send NoteOn messages with zero velocity instead (for example the EMU Xboard series). At the moment, the code auto-translates NoteOn messages with zero velocity to NoteOff messages with velocity 64. This behaviour can be inverted with the Cabal flag  noNoteOffL, which translates all NoteOff messages to NoteOn messages with velocity 0.&Pitch wheel (value, from -8192..+8191)Global aftertouch (pressure)Program Change (program)"Control Change (controller, value)'Polyphonic key pressure (key, pressure)Note On (key, velocity)Note Off (key, velocity)% => ?!"  !"   !   => ?! Safe-Inferred 24<@4The opaque data type representing a MIDI connection.A5The opaque data type representing a MIDI destination.B0The opaque data type representing a MIDI source.C2Enumerates the MIDI sources present in the system.D7Enumerates the MIDI destinations present in the system.EWThese functions return the name, model and manufacturer of a MIDI source / destination.Note: On Win32, only E4 returns a somewhat meaningful string at the moment.FßOpens a MIDI Source. There are two possibilites to receive MIDI messages. The user can either supply a callback function, or get the messages from an asynchronous buffer. However, mixing the two approaches is not allowed.GOpens a MIDI Destination.H9Gets the next event from a buffered connection (see also F)IYChecks the next event from a buffered connection, but does not remove it from the buffer.JKGets all the events with timestamp less than the specified from the buffer.K.Gets all the events from the buffer (see also F)L0Sends a short message. The connection must be a A.MdSends a system exclusive message. You shouldn't include the starting / trailing bytes 0xF0 and 0xF7.)Note: On Win32, the connection must be a ANcStarts a connection. This is required for receiving MIDI messages, and also for starting the clock.OStops a connection.PCloses a MIDI Connection.Q(Returns the time elapsed since the last N call, in milisecs."@ABRCDESTFGHIJKLMNOPQUV7  !"@ABCDESTFGHIJKLMNOPQ"@ABRCDESTFGHIJKLMNOPQUV Safe-Inferred 24<#4The opaque data type representing a MIDI connection.$5The opaque data type representing a MIDI destination.%0The opaque data type representing a MIDI source.&2Enumerates the MIDI sources present in the system.'7Enumerates the MIDI destinations present in the system.(WThese functions return the name, model and manufacturer of a MIDI source / destination.Note: On Win32, only (4 returns a somewhat meaningful string at the moment.+ßOpens a MIDI Source. There are two possibilites to receive MIDI messages. The user can either supply a callback function, or get the messages from an asynchronous buffer. However, mixing the two approaches is not allowed.,Opens a MIDI Destination.-9Gets the next event from a buffered connection (see also +).YChecks the next event from a buffered connection, but does not remove it from the buffer./KGets all the events with timestamp less than the specified from the buffer.0.Gets all the events from the buffer (see also +)10Sends a short message. The connection must be a $.2-Sends a system exclusive message. You should not5 include the starting / trailing bytes 0xF0 and 0xF7.)Note: On Win32, the connection must be a $3cStarts a connection. This is required for receiving MIDI messages, and also for starting the clock.4Stops a connection.5Closes a MIDI Connection.6(Returns the time elapsed since the last 3 call, in milisecs.#$%&'()*+,-./01234567  !"#$%&'()*+,-./0123456%$#&'"()*+,34512-.0/6#$%&'()*+,-./0123456 Safe-Inferred 24<7 Estimated BPM8‘Song position measured in beats (that is, quarter notes), starting from zero. So with 120 BPM, you will have song position 120 after one minute.98Opens a midi source with the possibility to sync to it. 0The user callback gets the the song position in beatsÚ, and also we return functions to query to song position and the estimated BPM. You may want to round the BPM to the nearest integer if that is appropriate. Song position is Nothing when the playback is stopped.ÿ Note that when first used, it may need some time to calibrate the bpm correctly, so start your MIDI host, press play, and wait a few second. Afterwards, it should be reasonably ok. Also if you do fast realtime BPM changes, it will be a tiny little bit behind.‡Note that we forward all messages (including clock messages) to the user, so you can implement your own handling of transport (startstop0continue) or send messages on clock if you want.78WX9 midi source user callback+(connection, song_position, estimated_bpm) Y78987978WX9Y Safe-Inferred 24<:ÇUtility function to help choosing a midi device. If there is only a single device, we select that. You can also set a default device (by its name), which will be automatically selected if present.;$Select a MIDI input device (source) <)Select a MIDI output device (destination)Z:promptdefault device namelist of devices;<:;<:;<Z:;<[       !"#$%&'()*+,-./0123456789:;<=>?@AB'()*+,/0123456789C-.DEFGHIJ hmidi-0.2.2.0System.MIDI.Base System.MIDISystem.MIDI.SyncSystem.MIDI.UtilitystartSystem.MIDI.Placeholder ShortMessage sm_channelsm_msgsm_byte1sm_byte2ClientCallback MidiEvent MidiMessage UndefinedReset ActiveSensingSRTStop SRTContinueSRTStartSRTClock TuneRequest SongSelect SongPositionSysEx MidiMessage' PitchWheel Aftertouch ProgramChangeCCPolyAftertouchNoteOnNoteOff TimeStamptranslateShortMessageuntranslateShortMessage shortMessage MIDIHasName Connection DestinationSourceenumerateSourcesenumerateDestinationsgetNamegetModelgetManufacturer openSourceopenDestination getNextEventcheckNextEventgetEventsUntil getEventssend sendSysExstopclose currentTimeBPMBeatsopenSourceWithSyncselectMidiDeviceselectInputDeviceselectOutputDevice translate' translate''sysShortMessagelinuxUndefined$fMIDIHasNameDestination$fMIDIHasNameSourceoneTwentyFourthlambda replaceMVar maybeRead