MIDISynth (midi_synth v0.4.2)

Copy Markdown View Source

Play music in Elixir!

Summary

Functions

Returns a specification to start this module under a supervisor.

Send a raw MIDI command to the synthesizer

Start a MIDI synthesizer

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

midi(server, data)

@spec midi(GenServer.server(), binary()) :: :ok

Send a raw MIDI command to the synthesizer

See MIDISynth.Command for encoding MIDI commands and MIDISynth.Keyboard for playing simple songs.

Examples

iex> {:ok, synth} = MIDISynth.start_link([]) iex> MIDISynth.midi(synth, <<0x90, 60, 127>>) :ok

start_link(args, opts \\ [])

@spec start_link(
  keyword(),
  GenServer.options()
) :: GenServer.on_start()

Start a MIDI synthesizer

Synthesizer arguments:

  • :soundfont - the path to the sound font to use for synthesize. Uses FluidR2_GM.sf2 by default.