MIDIPlayer.Event (MIDIPlayer v0.2.0) View Source

Several musical events which can be converted to MIDI commands.

All timings are in milliseconds.

Link to this section Summary

Types

t()

A musical event.

Link to this section Types

Specs

t() ::
  %MIDIPlayer.Event.Note{
    channel: term(),
    end_time: term(),
    start_time: term(),
    tone: term(),
    velocity: term()
  }
  | %MIDIPlayer.Event.ChangeProgram{
      channel: term(),
      program: term(),
      time: term()
    }

A musical event.

Link to this section Functions

Link to this function

change_program(channel, time, program)

View Source

Specs

change_program(
  MIDISynth.Command.channel(),
  non_neg_integer(),
  non_neg_integer()
) :: %MIDIPlayer.Event.ChangeProgram{
  channel: term(),
  program: term(),
  time: term()
}

Specs

convert(t()) :: [{non_neg_integer(), binary()}]

Converts the event to a list of MIDI commands.

Link to this function

note(channel, tone, start_time, end_time, velocity)

View Source

Specs

note(
  MIDISynth.Command.channel(),
  non_neg_integer(),
  non_neg_integer(),
  non_neg_integer(),
  MIDISynth.Command.velocity()
) :: %MIDIPlayer.Event.Note{
  channel: term(),
  end_time: term(),
  start_time: term(),
  tone: term(),
  velocity: term()
}