## SwamiControlMidi SwamiControlMidi |

## Synopsis

                        SwamiControlMidi;
    SwamiControlMidi *  swami_control_midi_new              (void);
    void                swami_control_midi_set_callback     (SwamiControlMidi *midi,
                                                             SwamiControlSetValueFunc callback,
                                                             gpointer data);
    void                swami_control_midi_send             (SwamiControlMidi *midi,
                                                             SwamiMidiEventType type,
                                                             int channel,
                                                             int param1,
                                                             int param2);
    void                swami_control_midi_transmit         (SwamiControlMidi *midi,
                                                             SwamiMidiEventType type,
                                                             int channel,
                                                             int param1,
                                                             int param2);

## Object Hierarchy

      GObject
       +----SwamiLock
             +----SwamiControl
                   +----SwamiControlFunc
                         +----SwamiControlMidi

## Description

## Details

### SwamiControlMidi

    typedef struct _SwamiControlMidi SwamiControlMidi;

### swami_control_midi_new ()

    SwamiControlMidi *  swami_control_midi_new              (void);

Create a new MIDI control.

Returns : | New MIDI control with a refcount of 1 which the caller owns.

### swami_control_midi_set_callback ()

    void                swami_control_midi_set_callback     (SwamiControlMidi *midi,
                                                             SwamiControlSetValueFunc callback,
                                                             gpointer data);

Set a callback function for received events on a MIDI control.

`midi` : | MIDI control
`callback` : | Function to callback when a new event is received or `NULL`
`data` : | User defined data to pass to the callback

### swami_control_midi_send ()

    void                swami_control_midi_send             (SwamiControlMidi *midi,
                                                             SwamiMidiEventType type,
                                                             int channel,
                                                             int param1,
                                                             int param2);

A convenience function to send an event TO a MIDI control. One could do the same by creating a SwamiMidiEvent, calling `swami_midi_event_set()` on it and then setting the control with `swami_control_set_value()`.

`midi` : | MIDI control
`type` : | MIDI event type
`channel` : | MIDI channel to send on
`param1` : | First parameter
`param2` : | Second parameter (only used with certain event types)

### swami_control_midi_transmit ()

    void                swami_control_midi_transmit         (SwamiControlMidi *midi,
                                                             SwamiMidiEventType type,
                                                             int channel,
                                                             int param1,
                                                             int param2);

A convenience function to send an event FROM a MIDI control. One could do the same by creating a SwamiMidiEvent, calling `swami_midi_event_set()` on it and then transmitting it from the control with `swami_control_transmit_value()`.

`midi` : | MIDI control
`type` : | MIDI event type
`channel` : | MIDI channel to send on
`param1` : | First parameter
`param2` : | Second parameter (only used with certain event types)