ALSA project - the C library reference

Loading...
Searching...
No Matches
Macros | Functions
Sequencer Middle Level Interface
MIDI Sequencer

## Macros
#define | snd_seq_ev_set_tag(ev, t)
| set the tag for given event
#define | snd_seq_ev_set_dest(ev, c, p)
| set the explicit destination
#define | snd_seq_ev_set_subs(ev)
| set broadcasting to subscribers
#define | snd_seq_ev_set_broadcast(ev)
| set broadcasting to all clients/ports
#define | snd_seq_ev_set_source(ev, p)
| set the source port
#define | snd_seq_ev_set_direct(ev)
| set direct passing mode (without queued)
#define | snd_seq_ev_schedule_tick(ev, q, relative, ttick)
| set tick-scheduling mode on queue
#define | snd_seq_ev_schedule_real(ev, q, relative, rtime)
| set real-time-scheduling mode on queue
#define | snd_seq_ev_set_priority(ev, high_prior)
| set event priority
#define | snd_seq_ev_set_fixed(ev)
| set fixed data
#define | snd_seq_ev_set_variable(ev, datalen, dataptr)
| set variable data
#define | snd_seq_ev_set_varusr(ev, datalen, dataptr)
| set varusr data
#define | snd_seq_ev_set_queue_control(ev, typ, q, val)
| set queue controls
#define | snd_seq_ev_set_queue_start(ev, q)
| set the start queue event
#define | snd_seq_ev_set_queue_stop(ev, q)
| set the stop queue event
#define | snd_seq_ev_set_queue_continue(ev, q)
| set the stop queue event
#define | snd_seq_ev_set_queue_tempo(ev, q, val)
| set the stop queue event
#define | snd_seq_ev_set_queue_pos_real(ev, q, rtime)
| set the real-time position of a queue
#define | snd_seq_ev_set_queue_pos_tick(ev, q, ttime)
| set the tick-time position of a queue
#define | snd_seq_start_queue(seq, q, ev)
| start the specified queue
#define | snd_seq_stop_queue(seq, q, ev)
| stop the specified queue
#define | snd_seq_continue_queue(seq, q, ev)
| continue the specified queue
#define | snd_seq_change_queue_tempo(seq, q, tempo, ev)
| change the tempo of the specified queue
#define | snd_seq_ev_set_note(ev, ch, key, vel, dur)
| set note event
#define | snd_seq_ev_set_noteon(ev, ch, key, vel)
| set note-on event
#define | snd_seq_ev_set_noteoff(ev, ch, key, vel)
| set note-off event
#define | snd_seq_ev_set_keypress(ev, ch, key, vel)
| set key-pressure event
#define | snd_seq_ev_set_controller(ev, ch, cc, val)
| set MIDI controller event
#define | snd_seq_ev_set_pgmchange(ev, ch, val)
| set program change event
#define | snd_seq_ev_set_pitchbend(ev, ch, val)
| set pitch-bend event
#define | snd_seq_ev_set_chanpress(ev, ch, val)
| set channel pressure event
#define | snd_seq_ev_set_sysex(ev, datalen, dataptr)
| set sysex event

## Functions
int | snd_seq_control_queue (snd_seq_t *seq, int q, int type, int value, snd_seq_event_t *ev)
| queue controls - start/stop/continue
int | snd_seq_create_simple_port (snd_seq_t *seq, const char *name, unsigned int caps, unsigned int type)
| create a port - simple version
int | snd_seq_delete_simple_port (snd_seq_t *seq, int port)
| delete the port
int | snd_seq_connect_from (snd_seq_t *seq, int my_port, int src_client, int src_port)
| simple subscription (w/o exclusive & time conversion)
int | snd_seq_connect_to (snd_seq_t *seq, int my_port, int dest_client, int dest_port)
| simple subscription (w/o exclusive & time conversion)
int | snd_seq_disconnect_from (snd_seq_t *seq, int my_port, int src_client, int src_port)
| simple disconnection
int | snd_seq_disconnect_to (snd_seq_t *seq, int my_port, int dest_client, int dest_port)
| simple disconnection
int | snd_seq_set_client_name (snd_seq_t *seq, const char *name)
| set client name
int | snd_seq_set_client_event_filter (snd_seq_t *seq, int event_type)
| add client event filter
int | snd_seq_set_client_midi_version (snd_seq_t *seq, int midi_version)
| set client MIDI protocol version
int | snd_seq_set_client_ump_conversion (snd_seq_t *seq, int enable)
| enable/disable client's automatic conversion of UMP/legacy events
int | snd_seq_set_client_pool_output (snd_seq_t *seq, size_t size)
| change the output pool size of the given client
int | snd_seq_set_client_pool_output_room (snd_seq_t *seq, size_t size)
| change the output room size of the given client
int | snd_seq_set_client_pool_input (snd_seq_t *seq, size_t size)
| change the input pool size of the given client
int | snd_seq_sync_output_queue (snd_seq_t *seq)
| wait until all events are processed
int | snd_seq_parse_address (snd_seq_t *seq, snd_seq_addr_t *addr, const char *str)
| parse the given string and get the sequencer address
int | snd_seq_reset_pool_output (snd_seq_t *seq)
| reset client output pool
int | snd_seq_reset_pool_input (snd_seq_t *seq)
| reset client input pool
int | snd_seq_create_ump_endpoint (snd_seq_t *seq, const snd_ump_endpoint_info_t *info, unsigned int num_groups)
| create a UMP Endpoint for the given sequencer client
int | snd_seq_create_ump_block (snd_seq_t *seq, int blkid, const snd_ump_block_info_t *info)
| create a UMP block for the given sequencer client

## Detailed Description

Sequencer Middle Level Interface

## Macro Definition Documentation

## ◆ snd_seq_change_queue_tempo

#define snd_seq_change_queue_tempo | ( |  | seq,
|  |  | q,
|  |  | tempo,
|  |  | ev )

Value:
snd_seq_control_queue(seq, q, SND_SEQ_EVENT_TEMPO, tempo, ev)
SND_SEQ_EVENT_TEMPO
@ SND_SEQ_EVENT_TEMPO
Definition seq_event.h:102
snd_seq_control_queue
int snd_seq_control_queue(snd_seq_t *seq, int q, int type, int value, snd_seq_event_t *ev)
queue controls - start/stop/continue
Definition seqmid.c:46
tempo
uint32_t tempo
Definition ump_msg.h:9

change the tempo of the specified queue

Parameters

  seq | sequencer handle
  q | queue id
  tempo | the new tempo value
  ev | optional event record (see snd_seq_control_queue)

## ◆ snd_seq_continue_queue

#define snd_seq_continue_queue | ( |  | seq,
|  |  | q,
|  |  | ev )

Value:
snd_seq_control_queue(seq, q, SND_SEQ_EVENT_CONTINUE, 0, ev)
SND_SEQ_EVENT_CONTINUE
@ SND_SEQ_EVENT_CONTINUE
Definition seq_event.h:94

continue the specified queue

Parameters

  seq | sequencer handle
  q | queue id to continue
  ev | optional event record (see snd_seq_control_queue)

## ◆ snd_seq_ev_schedule_real

#define snd_seq_ev_schedule_real | ( |  | ev,
|  |  | q,
|  |  | relative,
|  |  | rtime )

Value:
((ev)->flags &= ~(SND_SEQ_TIME_STAMP_MASK | SND_SEQ_TIME_MODE_MASK),\
(ev)->flags |= SND_SEQ_TIME_STAMP_REAL,\
(ev)->flags |= (relative) ? SND_SEQ_TIME_MODE_REL : SND_SEQ_TIME_MODE_ABS,\
(ev)->time.time = *(rtime),\
(ev)->queue = (q))
SND_SEQ_TIME_STAMP_REAL
#define SND_SEQ_TIME_STAMP_REAL
Definition seq_event.h:223
SND_SEQ_TIME_MODE_REL
#define SND_SEQ_TIME_MODE_REL
Definition seq_event.h:227
SND_SEQ_TIME_MODE_ABS
#define SND_SEQ_TIME_MODE_ABS
Definition seq_event.h:226
SND_SEQ_TIME_MODE_MASK
#define SND_SEQ_TIME_MODE_MASK
Definition seq_event.h:228
SND_SEQ_TIME_STAMP_MASK
#define SND_SEQ_TIME_STAMP_MASK
Definition seq_event.h:224

set real-time-scheduling mode on queue

Parameters

  ev | event instance
  q | queue id to schedule
  relative | relative time-stamp if non-zero
  rtime | time-stamp to be delivered

This macro sets the scheduling of the event in the realtime mode.

See also
  snd_seq_ev_schedule_tick(), snd_seq_ev_set_direct()

## ◆ snd_seq_ev_schedule_tick

#define snd_seq_ev_schedule_tick | ( |  | ev,
|  |  | q,
|  |  | relative,
|  |  | ttick )

Value:
((ev)->flags &= ~(SND_SEQ_TIME_STAMP_MASK | SND_SEQ_TIME_MODE_MASK),\
(ev)->flags |= SND_SEQ_TIME_STAMP_TICK,\
(ev)->flags |= (relative) ? SND_SEQ_TIME_MODE_REL : SND_SEQ_TIME_MODE_ABS,\
(ev)->time.tick = (ttick),\
(ev)->queue = (q))
SND_SEQ_TIME_STAMP_TICK
#define SND_SEQ_TIME_STAMP_TICK
Definition seq_event.h:222

set tick-scheduling mode on queue

Parameters

  ev | event instance
  q | queue id to schedule
  relative | relative time-stamp if non-zero
  ttick | tick time-stamp to be delivered

This macro sets the scheduling of the event in the MIDI tick mode.

See also
  snd_seq_ev_schedule_real(), snd_seq_ev_set_direct()

## ◆ snd_seq_ev_set_broadcast

#define snd_seq_ev_set_broadcast | ( |  | ev | ) |

Value:
((ev)->dest.client = SND_SEQ_ADDRESS_BROADCAST,\
(ev)->dest.port = SND_SEQ_ADDRESS_BROADCAST)
SND_SEQ_ADDRESS_BROADCAST
#define SND_SEQ_ADDRESS_BROADCAST
Definition seq.h:77

set broadcasting to all clients/ports

Parameters

  ev | event record

This macro sets the destination as the broadcasting.

See also
  snd_seq_ev_set_dest()

## ◆ snd_seq_ev_set_chanpress

#define snd_seq_ev_set_chanpress | ( |  | ev,
|  |  | ch,
|  |  | val )

Value:
((ev)->type = SND_SEQ_EVENT_CHANPRESS,\
snd_seq_ev_set_fixed(ev),\
(ev)->data.control.channel = (ch),\
(ev)->data.control.value = (val))
SND_SEQ_EVENT_CHANPRESS
@ SND_SEQ_EVENT_CHANPRESS
Definition seq_event.h:70
data
uint8_t data
Definition ump_msg.h:6

set channel pressure event

Parameters

  ev | event record
  ch | channel number
  val | channel pressure value

## ◆ snd_seq_ev_set_controller

#define snd_seq_ev_set_controller | ( |  | ev,
|  |  | ch,
|  |  | cc,
|  |  | val )

Value:
((ev)->type = SND_SEQ_EVENT_CONTROLLER,\
snd_seq_ev_set_fixed(ev),\
(ev)->data.control.channel = (ch),\
(ev)->data.control.param = (cc),\
(ev)->data.control.value = (val))
SND_SEQ_EVENT_CONTROLLER
@ SND_SEQ_EVENT_CONTROLLER
Definition seq_event.h:66

set MIDI controller event

Parameters

  ev | event record
  ch | channel number
  cc | controller number
  val | control value

## ◆ snd_seq_ev_set_dest

#define snd_seq_ev_set_dest | ( |  | ev,
|  |  | c,
|  |  | p )

Value:
((ev)->dest.client = (c), (ev)->dest.port = (p))

set the explicit destination

Parameters

  ev | event record
  c | destination client id
  p | destination port id

This macro sets the client and port id numbers to the given event record.

See also
  snd_seq_ev_set_subs()

## ◆ snd_seq_ev_set_direct

#define snd_seq_ev_set_direct | ( |  | ev | ) |

Value:
((ev)->queue = SND_SEQ_QUEUE_DIRECT)
SND_SEQ_QUEUE_DIRECT
#define SND_SEQ_QUEUE_DIRECT
Definition seq.h:452

set direct passing mode (without queued)

Parameters

  ev | event instance

This macro sets the event to the direct passing mode to be delivered immediately without queueing.

See also
  snd_seq_ev_schedule_tick(), snd_seq_ev_schedule_real()

## ◆ snd_seq_ev_set_fixed

#define snd_seq_ev_set_fixed | ( |  | ev | ) |

Value:
((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\
(ev)->flags |= SND_SEQ_EVENT_LENGTH_FIXED)
SND_SEQ_EVENT_LENGTH_FIXED
#define SND_SEQ_EVENT_LENGTH_FIXED
Definition seq_event.h:230

set fixed data

Parameters

  ev | event instance

Sets the event length mode as fixed size.

See also
  snd_seq_ev_set_variable(), snd_seq_ev_set_varusr()

## ◆ snd_seq_ev_set_keypress

#define snd_seq_ev_set_keypress | ( |  | ev,
|  |  | ch,
|  |  | key,
|  |  | vel )

Value:
((ev)->type = SND_SEQ_EVENT_KEYPRESS,\
snd_seq_ev_set_fixed(ev),\
(ev)->data.note.channel = (ch),\
(ev)->data.note.note = (key),\
(ev)->data.note.velocity = (vel))
SND_SEQ_EVENT_KEYPRESS
@ SND_SEQ_EVENT_KEYPRESS
Definition seq_event.h:63

set key-pressure event

Parameters

  ev | event record
  ch | channel number
  key | note key
  vel | velocity

## ◆ snd_seq_ev_set_note

#define snd_seq_ev_set_note | ( |  | ev,
|  |  | ch,
|  |  | key,
|  |  | vel,
|  |  | dur )

Value:
((ev)->type = SND_SEQ_EVENT_NOTE,\
snd_seq_ev_set_fixed(ev),\
(ev)->data.note.channel = (ch),\
(ev)->data.note.note = (key),\
(ev)->data.note.velocity = (vel),\
(ev)->data.note.duration = (dur))
SND_SEQ_EVENT_NOTE
@ SND_SEQ_EVENT_NOTE
Definition seq_event.h:57

set note event

Parameters

  ev | event record
  ch | channel number
  key | note key
  vel | velocity
  dur | duration (in tick or msec)

## ◆ snd_seq_ev_set_noteoff

#define snd_seq_ev_set_noteoff | ( |  | ev,
|  |  | ch,
|  |  | key,
|  |  | vel )

Value:
((ev)->type = SND_SEQ_EVENT_NOTEOFF,\
snd_seq_ev_set_fixed(ev),\
(ev)->data.note.channel = (ch),\
(ev)->data.note.note = (key),\
(ev)->data.note.velocity = (vel))
SND_SEQ_EVENT_NOTEOFF
@ SND_SEQ_EVENT_NOTEOFF
Definition seq_event.h:61

set note-off event

Parameters

  ev | event record
  ch | channel number
  key | note key
  vel | velocity

## ◆ snd_seq_ev_set_noteon

#define snd_seq_ev_set_noteon | ( |  | ev,
|  |  | ch,
|  |  | key,
|  |  | vel )

Value:
((ev)->type = SND_SEQ_EVENT_NOTEON,\
snd_seq_ev_set_fixed(ev),\
(ev)->data.note.channel = (ch),\
(ev)->data.note.note = (key),\
(ev)->data.note.velocity = (vel))
SND_SEQ_EVENT_NOTEON
@ SND_SEQ_EVENT_NOTEON
Definition seq_event.h:59

set note-on event

Parameters

  ev | event record
  ch | channel number
  key | note key
  vel | velocity

## ◆ snd_seq_ev_set_pgmchange

#define snd_seq_ev_set_pgmchange | ( |  | ev,
|  |  | ch,
|  |  | val )

Value:
((ev)->type = SND_SEQ_EVENT_PGMCHANGE,\
snd_seq_ev_set_fixed(ev),\
(ev)->data.control.channel = (ch),\
(ev)->data.control.value = (val))
SND_SEQ_EVENT_PGMCHANGE
@ SND_SEQ_EVENT_PGMCHANGE
Definition seq_event.h:68

set program change event

Parameters

  ev | event record
  ch | channel number
  val | program number

## ◆ snd_seq_ev_set_pitchbend

#define snd_seq_ev_set_pitchbend | ( |  | ev,
|  |  | ch,
|  |  | val )

Value:
((ev)->type = SND_SEQ_EVENT_PITCHBEND,\
snd_seq_ev_set_fixed(ev),\
(ev)->data.control.channel = (ch),\
(ev)->data.control.value = (val))
SND_SEQ_EVENT_PITCHBEND
@ SND_SEQ_EVENT_PITCHBEND
Definition seq_event.h:72

set pitch-bend event

Parameters

  ev | event record
  ch | channel number
  val | pitch bend; zero centered from -8192 to 8191

## ◆ snd_seq_ev_set_priority

#define snd_seq_ev_set_priority | ( |  | ev,
|  |  | high_prior )

Value:
((ev)->flags &= ~SND_SEQ_PRIORITY_MASK,\
(ev)->flags |= (high_prior) ? SND_SEQ_PRIORITY_HIGH : SND_SEQ_PRIORITY_NORMAL)
SND_SEQ_PRIORITY_HIGH
#define SND_SEQ_PRIORITY_HIGH
Definition seq_event.h:236
SND_SEQ_PRIORITY_NORMAL
#define SND_SEQ_PRIORITY_NORMAL
Definition seq_event.h:235

set event priority

Parameters

  ev | event instance
  high_prior | 1 for high priority mode

## ◆ snd_seq_ev_set_queue_continue

#define snd_seq_ev_set_queue_continue | ( |  | ev,
|  |  | q )

Value:
snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_CONTINUE, q, 0)
snd_seq_ev_set_queue_control
#define snd_seq_ev_set_queue_control(ev, typ, q, val)
set queue controls
Definition seqmid.h:237

set the stop queue event

Parameters

  ev | event record
  q | queue id to continue

See also
  snd_seq_ev_set_queue_start(), snd_seq_ev_set_queue_stop()

## ◆ snd_seq_ev_set_queue_control

#define snd_seq_ev_set_queue_control | ( |  | ev,
|  |  | typ,
|  |  | q,
|  |  | val )

Value:
((ev)->type = (typ),\
snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\
(ev)->data.queue.queue = (q),\
(ev)->data.queue.param.value = (val))
SND_SEQ_PORT_SYSTEM_TIMER
#define SND_SEQ_PORT_SYSTEM_TIMER
Definition seq.h:239
SND_SEQ_CLIENT_SYSTEM
#define SND_SEQ_CLIENT_SYSTEM
Definition seq.h:80

set queue controls

Parameters

  ev | event record
  typ | event type
  q | queue id
  val | control value

## ◆ snd_seq_ev_set_queue_pos_real

#define snd_seq_ev_set_queue_pos_real | ( |  | ev,
|  |  | q,
|  |  | rtime )

Value:
((ev)->type = SND_SEQ_EVENT_SETPOS_TIME,\
snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\
(ev)->data.queue.queue = (q),\
(ev)->data.queue.param.time.time = *(rtime))
SND_SEQ_EVENT_SETPOS_TIME
@ SND_SEQ_EVENT_SETPOS_TIME
Definition seq_event.h:100

set the real-time position of a queue

Parameters

  ev | event record
  q | queue id to change tempo
  rtime | the new real-time pointer

## ◆ snd_seq_ev_set_queue_pos_tick

#define snd_seq_ev_set_queue_pos_tick | ( |  | ev,
|  |  | q,
|  |  | ttime )

Value:
((ev)->type = SND_SEQ_EVENT_SETPOS_TICK,\
snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\
(ev)->data.queue.queue = (q),\
(ev)->data.queue.param.time.tick = (ttime))
SND_SEQ_EVENT_SETPOS_TICK
@ SND_SEQ_EVENT_SETPOS_TICK
Definition seq_event.h:98

set the tick-time position of a queue

Parameters

  ev | event record
  q | queue id to change tempo
  ttime | the new tick-time

## ◆ snd_seq_ev_set_queue_start

#define snd_seq_ev_set_queue_start | ( |  | ev,
|  |  | q )

Value:
snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_START, q, 0)
SND_SEQ_EVENT_START
@ SND_SEQ_EVENT_START
Definition seq_event.h:92

set the start queue event

Parameters

  ev | event record
  q | queue id to start

See also
  snd_seq_ev_set_queue_stop(), snd_seq_ev_set_queue_continue()

## ◆ snd_seq_ev_set_queue_stop

#define snd_seq_ev_set_queue_stop | ( |  | ev,
|  |  | q )

Value:
snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_STOP, q, 0)
SND_SEQ_EVENT_STOP
@ SND_SEQ_EVENT_STOP
Definition seq_event.h:96

set the stop queue event

Parameters

  ev | event record
  q | queue id to stop

See also
  snd_seq_ev_set_queue_start(), snd_seq_ev_set_queue_continue()

## ◆ snd_seq_ev_set_queue_tempo

#define snd_seq_ev_set_queue_tempo | ( |  | ev,
|  |  | q,
|  |  | val )

Value:
snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_TEMPO, q, val)

set the stop queue event

Parameters

  ev | event record
  q | queue id to change tempo
  val | the new tempo value

## ◆ snd_seq_ev_set_source

#define snd_seq_ev_set_source | ( |  | ev,
|  |  | p )

Value:
((ev)->source.port = (p))

set the source port

Parameters

  ev | event record
  p | source port id

This macro sets the source port id number.

## ◆ snd_seq_ev_set_subs

#define snd_seq_ev_set_subs | ( |  | ev | ) |

Value:
((ev)->dest.client = SND_SEQ_ADDRESS_SUBSCRIBERS,\
(ev)->dest.port = SND_SEQ_ADDRESS_UNKNOWN)
SND_SEQ_ADDRESS_SUBSCRIBERS
#define SND_SEQ_ADDRESS_SUBSCRIBERS
Definition seq.h:76
SND_SEQ_ADDRESS_UNKNOWN
#define SND_SEQ_ADDRESS_UNKNOWN
Definition seq.h:75

set broadcasting to subscribers

Parameters

  ev | event record

This macro sets the destination as the subscribers.

See also
  snd_seq_ev_set_dest()

## ◆ snd_seq_ev_set_sysex

#define snd_seq_ev_set_sysex | ( |  | ev,
|  |  | datalen,
|  |  | dataptr )

Value:
((ev)->type = SND_SEQ_EVENT_SYSEX,\
snd_seq_ev_set_variable(ev, datalen, dataptr))
SND_SEQ_EVENT_SYSEX
@ SND_SEQ_EVENT_SYSEX
Definition seq_event.h:169

set sysex event

Parameters

  ev | event record
  datalen | length of sysex data
  dataptr | sysex data pointer

the sysex data must contain the start byte 0xf0 and the end byte 0xf7.

## ◆ snd_seq_ev_set_tag

#define snd_seq_ev_set_tag | ( |  | ev,
|  |  | t )

Value:
((ev)->tag = (t))

set the tag for given event

Parameters

  ev | event record
  t | event tag

This macro sets the tag to the given event record.

## ◆ snd_seq_ev_set_variable

#define snd_seq_ev_set_variable | ( |  | ev,
|  |  | datalen,
|  |  | dataptr )

Value:
((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\
(ev)->flags |= SND_SEQ_EVENT_LENGTH_VARIABLE,\
(ev)->data.ext.len = (datalen),\
(ev)->data.ext.ptr = (dataptr))
SND_SEQ_EVENT_LENGTH_VARIABLE
#define SND_SEQ_EVENT_LENGTH_VARIABLE
Definition seq_event.h:231

set variable data

Parameters

  ev | event instance
  datalen | length of the external data
  dataptr | pointer of the external data

Sets the event length mode as variable length and stores the data.

See also
  snd_seq_ev_set_fixed(), snd_seq_ev_set_varusr()

## ◆ snd_seq_ev_set_varusr

#define snd_seq_ev_set_varusr | ( |  | ev,
|  |  | datalen,
|  |  | dataptr )

Value:
((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\
(ev)->flags |= SND_SEQ_EVENT_LENGTH_VARUSR,\
(ev)->data.ext.len = (datalen),\
(ev)->data.ext.ptr = (dataptr))
SND_SEQ_EVENT_LENGTH_VARUSR
#define SND_SEQ_EVENT_LENGTH_VARUSR
Definition seq_event.h:232

set varusr data

Parameters

  ev | event instance
  datalen | length of the external data
  dataptr | pointer of the external data

Sets the event length mode as variable user-space data and stores the data.

See also
  snd_seq_ev_set_fixed(), snd_seq_ev_set_variable()

## ◆ snd_seq_start_queue

#define snd_seq_start_queue | ( |  | seq,
|  |  | q,
|  |  | ev )

Value:
snd_seq_control_queue(seq, q, SND_SEQ_EVENT_START, 0, ev)

start the specified queue

Parameters

  seq | sequencer handle
  q | queue id to start
  ev | optional event record (see snd_seq_control_queue)

## ◆ snd_seq_stop_queue

#define snd_seq_stop_queue | ( |  | seq,
|  |  | q,
|  |  | ev )

Value:
snd_seq_control_queue(seq, q, SND_SEQ_EVENT_STOP, 0, ev)

stop the specified queue

Parameters

  seq | sequencer handle
  q | queue id to stop
  ev | optional event record (see snd_seq_control_queue)

## Function Documentation

## ◆ snd_seq_connect_from()

int snd_seq_connect_from | ( | snd_seq_t * | seq,
|  | int | myport,
|  | int | src_client,
|  | int | src_port )

simple subscription (w/o exclusive & time conversion)

Parameters

  seq | sequencer handle
  myport | the port id as receiver
  src_client | sender client id
  src_port | sender port id

Returns
  0 on success or negative error code

Connect from the given sender client:port to the given destination port in the current client.

See also
  snd_seq_subscribe_port(), snd_seq_disconnect_from()

## ◆ snd_seq_connect_to()

int snd_seq_connect_to | ( | snd_seq_t * | seq,
|  | int | myport,
|  | int | dest_client,
|  | int | dest_port )

simple subscription (w/o exclusive & time conversion)

Parameters

  seq | sequencer handle
  myport | the port id as sender
  dest_client | destination client id
  dest_port | destination port id

Returns
  0 on success or negative error code

Connect from the given receiver port in the current client to the given destination client:port.

See also
  snd_seq_subscribe_port(), snd_seq_disconnect_to()

## ◆ snd_seq_control_queue()

int snd_seq_control_queue | ( | snd_seq_t * | seq,
|  | int | q,
|  | int | type,
|  | int | value,
|  | snd_seq_event_t * | ev )

queue controls - start/stop/continue

Parameters

  seq | sequencer handle
  q | queue id to control
  type | event type
  value | event value
  ev | event instance

This function sets up general queue control event and sends it. To send at scheduled time, set the schedule in ev. If ev is NULL, the event is composed locally and sent immediately to the specified queue. In any cases, you need to call snd_seq_drain_output() appropriately to feed the event.

See also
  snd_seq_alloc_queue()

## ◆ snd_seq_create_simple_port()

int snd_seq_create_simple_port | ( | snd_seq_t * | seq,
|  | const char * | name,
|  | unsigned int | caps,
|  | unsigned int | type )

create a port - simple version

Parameters

  seq | sequencer handle
  name | the name of the port
  caps | capability bits
  type | type bits

Returns
  the created port number or negative error code

Creates a port with the given capability and type bits.

See also
  snd_seq_create_port(), snd_seq_delete_simple_port()

## ◆ snd_seq_create_ump_block()

int snd_seq_create_ump_block | ( | snd_seq_t * | seq,
|  | int | blkid,
|  | const snd_ump_block_info_t * | info )

create a UMP block for the given sequencer client

Parameters

  seq | sequencer handle
  blkid | 0-based block id
  info | UMP block info to initialize

Returns
  0 on success or negative error code

This function sets up the UMP block info of the given block id. The sequencer port name is updated accordingly with the associated block name automatically.

## ◆ snd_seq_create_ump_endpoint()

int snd_seq_create_ump_endpoint | ( | snd_seq_t * | seq,
|  | const snd_ump_endpoint_info_t * | info,
|  | unsigned int | num_groups )

create a UMP Endpoint for the given sequencer client

Parameters

  seq | sequencer handle
  info | UMP Endpoint information to initialize
  num_groups | max number of groups in the endpoint

Returns
  0 on success or negative error code

This function initializes the sequencer client to the corresponding MIDI 2.0 mode (either MIDI 1.0 or MIDI 2.0 protocol) depending on the given snd_ump_endpoint_info_t info.

This function should be called right after opening a sequencer client. The client name is updated from the UMP Endpoint name, and a primary MIDI 2.0 UMP port and each UMP Group port are created. The application should pass each UMP block info via succeeding snd_seq_create_ump_block() call.

## ◆ snd_seq_delete_simple_port()

int snd_seq_delete_simple_port | ( | snd_seq_t * | seq,
|  | int | port )

delete the port

Parameters

  seq | sequencer handle
  port | port id

Returns
  0 on success or negative error code

See also
  snd_seq_delete_port(), snd_seq_create_simple_port()

## ◆ snd_seq_disconnect_from()

int snd_seq_disconnect_from | ( | snd_seq_t * | seq,
|  | int | myport,
|  | int | src_client,
|  | int | src_port )

simple disconnection

Parameters

  seq | sequencer handle
  myport | the port id as receiver
  src_client | sender client id
  src_port | sender port id

Returns
  0 on success or negative error code

Remove connection from the given sender client:port to the given destination port in the current client.

See also
  snd_seq_unsubscribe_port(), snd_seq_connect_from()

## ◆ snd_seq_disconnect_to()

int snd_seq_disconnect_to | ( | snd_seq_t * | seq,
|  | int | myport,
|  | int | dest_client,
|  | int | dest_port )

simple disconnection

Parameters

  seq | sequencer handle
  myport | the port id as sender
  dest_client | destination client id
  dest_port | destination port id

Returns
  0 on success or negative error code

Remove connection from the given sender client:port to the given destination port in the current client.

See also
  snd_seq_unsubscribe_port(), snd_seq_connect_to()

## ◆ snd_seq_parse_address()

int snd_seq_parse_address | ( | snd_seq_t * | seq,
|  | snd_seq_addr_t * | addr,
|  | const char * | arg )

parse the given string and get the sequencer address

Parameters

  seq | sequencer handle
  addr | the address pointer to be returned
  arg | the string to be parsed

Returns
  0 on success or negative error code

This function parses the sequencer client and port numbers from the given string. The client and port tokens are separated by either colon or period, e.g. 128:1. When seq is not NULL, the function accepts also a client name not only digit numbers. Actually arg need to be only a prefix of the wanted client. That is, if a client named "Foobar XXL Master 2012" with number 128 is available, then parsing "Foobar" will return the address 128:0 if no other client is an exact match.

## ◆ snd_seq_reset_pool_input()

int snd_seq_reset_pool_input | ( | snd_seq_t * | seq | ) |

reset client input pool

Parameters

  seq | sequencer handle

Returns
  0 on success or negative error code

So far, this works identically like snd_seq_drop_input().

## ◆ snd_seq_reset_pool_output()

int snd_seq_reset_pool_output | ( | snd_seq_t * | seq | ) |

reset client output pool

Parameters

  seq | sequencer handle

Returns
  0 on success or negative error code

So far, this works identically like snd_seq_drop_output().

## ◆ snd_seq_set_client_event_filter()

int snd_seq_set_client_event_filter | ( | snd_seq_t * | seq,
|  | int | event_type )

add client event filter

Parameters

  seq | sequencer handle
  event_type | event type to be added

Returns
  0 on success or negative error code

See also
  snd_seq_set_client_info()

## ◆ snd_seq_set_client_midi_version()

int snd_seq_set_client_midi_version | ( | snd_seq_t * | seq,
|  | int | midi_version )

set client MIDI protocol version

Parameters

  seq | sequencer handle
  midi_version | MIDI protocol version to set

Returns
  0 on success or negative error code

See also
  snd_seq_set_client_info()

## ◆ snd_seq_set_client_name()

int snd_seq_set_client_name | ( | snd_seq_t * | seq,
|  | const char * | name )

set client name

Parameters

  seq | sequencer handle
  name | name string

Returns
  0 on success or negative error code

See also
  snd_seq_set_client_info()

## ◆ snd_seq_set_client_pool_input()

int snd_seq_set_client_pool_input | ( | snd_seq_t * | seq,
|  | size_t | size )

change the input pool size of the given client

Parameters

  seq | sequencer handle
  size | input pool size

Returns
  0 on success or negative error code

See also
  snd_seq_set_client_pool()

## ◆ snd_seq_set_client_pool_output()

int snd_seq_set_client_pool_output | ( | snd_seq_t * | seq,
|  | size_t | size )

change the output pool size of the given client

Parameters

  seq | sequencer handle
  size | output pool size

Returns
  0 on success or negative error code

See also
  snd_seq_set_client_pool()

## ◆ snd_seq_set_client_pool_output_room()

int snd_seq_set_client_pool_output_room | ( | snd_seq_t * | seq,
|  | size_t | size )

change the output room size of the given client

Parameters

  seq | sequencer handle
  size | output room size

Returns
  0 on success or negative error code

See also
  snd_seq_set_client_pool()

## ◆ snd_seq_set_client_ump_conversion()

int snd_seq_set_client_ump_conversion | ( | snd_seq_t * | seq,
|  | int | enable )

enable/disable client's automatic conversion of UMP/legacy events

Parameters

  seq | sequencer handle
  enable | 0 or 1 to disable/enable the conversion

Returns
  0 on success or negative error code

See also
  snd_seq_set_client_info()

## ◆ snd_seq_sync_output_queue()

int snd_seq_sync_output_queue | ( | snd_seq_t * | seq | ) |

wait until all events are processed

Parameters

  seq | sequencer handle

Returns
  0 on success or negative error code

This function waits until all events of this client are processed.

See also
  snd_seq_drain_output()