Home

Awesome

Fable.Import.WebMIDI

Fable bindings for Web MIDI

install with DotNet:

dotnet add package Fable.Import.WebMIDI

or with Paket:

paket add Fable.Import.WebMIDI

Usage

Example in Elmish:

open Fable.Import.WebMIDI

type Model = { MIDIAccess: IMIDIAccess option 
               ErrorMessage: string option }

type Msg = | MIDISuccess of IMIDIAccess
           | MIDIError of exn
           | MIDIStateChanged of IMIDIConnectionEvent

let init () : Model*Cmd<Msg> =
  { MIDIAccess = None 
    ErrorMessage = None }, Cmd.ofPromise MIDI.requestAccess [ Sysex true ] MIDISuccess MIDIError 

let update (msg: Msg) (model: Model) : Model*Cmd<Msg> = 
  match msg with
  | MIDISuccess of midiAccess ->
    let stateChangeSub dispatch =
      let onStateChange ev =
        dispatch (MIDIStateChanged ev)

      midiAccess.OnStateChange <- onStateChange

    { model with MIDIAccess = Some midiAccess }, Cmd.ofSub stateChangeSub
  | MIDIError of ex ->
    { model with ErrorMessage = Some ex.Message }, Cmd.none
  | MIDIStateChanged ev ->
    printfn "MIDI state changed"
    model, Cmd.none

...

Building

Make sure the following requirements are installed in your system:

Then you just need to type ./build.cmd or ./build.sh

Release

In order to push your package to [nuget.org][https://nuget.org] you need to add your API keys to NUGET_KEY environmental variable. You can create a key here.

#### 0.2.0 - 30.04.2017
* FEATURE: Does cool stuff!
* BUGFIX: Fixes that silly oversight

./build.sh Release

MacOS/LinuxWindows
Travis build statusAppVeyor Build status
Travis Build HistoryAppVeyor Build History

Nuget

StablePrerelease
NuGet BadgeNuGet Badge