seq.h File Reference

MIDI event sequencer. More...

Typedefs

typedef void(* fluid_event_callback_t )(unsigned int time, fluid_event_t *event, fluid_sequencer_t *seq, void *data)
 Event callback prototype for destination clients.

Functions

FLUIDSYNTH_API fluid_sequencer_tnew_fluid_sequencer (void)
 Create a new sequencer object which uses the system timer.
FLUIDSYNTH_API fluid_sequencer_tnew_fluid_sequencer2 (int use_system_timer)
 Create a new sequencer object.
FLUIDSYNTH_API void delete_fluid_sequencer (fluid_sequencer_t *seq)
 Free a sequencer object.
FLUIDSYNTH_API int fluid_sequencer_get_use_system_timer (fluid_sequencer_t *seq)
 Check if a sequencer is using the system timer or not.
FLUIDSYNTH_API short fluid_sequencer_register_client (fluid_sequencer_t *seq, const char *name, fluid_event_callback_t callback, void *data)
 Register a sequencer client.
FLUIDSYNTH_API void fluid_sequencer_unregister_client (fluid_sequencer_t *seq, short id)
 Unregister a previously registered client.
FLUIDSYNTH_API int fluid_sequencer_count_clients (fluid_sequencer_t *seq)
 Count a sequencers registered clients.
FLUIDSYNTH_API short fluid_sequencer_get_client_id (fluid_sequencer_t *seq, int index)
 Get a client ID from its index (order in which it was registered).
FLUIDSYNTH_API char * fluid_sequencer_get_client_name (fluid_sequencer_t *seq, int id)
 Get the name of a registered client.
FLUIDSYNTH_API int fluid_sequencer_client_is_dest (fluid_sequencer_t *seq, int id)
 Check if a client is a destination client.
FLUIDSYNTH_API void fluid_sequencer_process (fluid_sequencer_t *seq, unsigned int msec)
 Advance a sequencer that isn't using the system timer.
FLUIDSYNTH_API void fluid_sequencer_send_now (fluid_sequencer_t *seq, fluid_event_t *evt)
 Send an event immediately.
FLUIDSYNTH_API int fluid_sequencer_send_at (fluid_sequencer_t *seq, fluid_event_t *evt, unsigned int time, int absolute)
 Schedule an event for sending at a later time.
FLUIDSYNTH_API void fluid_sequencer_remove_events (fluid_sequencer_t *seq, short source, short dest, int type)
 Remove events from the event queue.
FLUIDSYNTH_API unsigned int fluid_sequencer_get_tick (fluid_sequencer_t *seq)
 Get the current tick of a sequencer.
FLUIDSYNTH_API void fluid_sequencer_set_time_scale (fluid_sequencer_t *seq, double scale)
 Set the time scale of a sequencer.
FLUIDSYNTH_API double fluid_sequencer_get_time_scale (fluid_sequencer_t *seq)
 Get a sequencer's time scale.

Detailed Description

MIDI event sequencer.


Typedef Documentation

typedef void(* fluid_event_callback_t)(unsigned int time, fluid_event_t *event, fluid_sequencer_t *seq, void *data)

Event callback prototype for destination clients.

Parameters:
time Current sequencer tick value (see fluid_sequencer_get_tick()).
Parameters:
event The event being received
Parameters:
seq The sequencer instance
Parameters:
data User defined data registered with the client

Function Documentation

FLUIDSYNTH_API fluid_sequencer_t* new_fluid_sequencer ( void   ) 

Create a new sequencer object which uses the system timer.

Use new_fluid_sequencer2() to specify whether the system timer or fluid_sequencer_process() is used to advance the sequencer.

Returns:
New sequencer instance
Examples:
fluidsynth_arpeggio.c, and fluidsynth_metronome.c.
FLUIDSYNTH_API fluid_sequencer_t* new_fluid_sequencer2 ( int  use_system_timer  ) 

Create a new sequencer object.

Parameters:
use_system_timer If TRUE, sequencer will advance at the rate of the system clock. If FALSE, call fluid_sequencer_process() to advance the sequencer.
Returns:
New sequencer instance
Since:
1.1.0
FLUIDSYNTH_API void delete_fluid_sequencer ( fluid_sequencer_t seq  ) 

Free a sequencer object.

Parameters:
seq Sequencer to delete
Examples:
fluidsynth_arpeggio.c, and fluidsynth_metronome.c.
FLUIDSYNTH_API int fluid_sequencer_get_use_system_timer ( fluid_sequencer_t seq  ) 

Check if a sequencer is using the system timer or not.

Parameters:
seq Sequencer object
Returns:
TRUE if system timer is being used, FALSE otherwise.
Since:
1.1.0
FLUIDSYNTH_API short fluid_sequencer_register_client ( fluid_sequencer_t seq,
const char *  name,
fluid_event_callback_t  callback,
void *  data 
)

Register a sequencer client.

Parameters:
seq Sequencer object
Parameters:
name Name of sequencer client
Parameters:
callback Sequencer client callback or NULL for a source client.
Parameters:
data User data to pass to the callback
Returns:
Unique sequencer ID or FLUID_FAILED on error
Clients can be sources or destinations of events. Sources don't need to register a callback.
Examples:
fluidsynth_arpeggio.c, and fluidsynth_metronome.c.
FLUIDSYNTH_API void fluid_sequencer_unregister_client ( fluid_sequencer_t seq,
short  id 
)

Unregister a previously registered client.

Parameters:
seq Sequencer object
Parameters:
id Client ID as returned by fluid_sequencer_register_client().
FLUIDSYNTH_API int fluid_sequencer_count_clients ( fluid_sequencer_t seq  ) 

Count a sequencers registered clients.

Parameters:
seq Sequencer object
Returns:
Count of sequencer clients.
FLUIDSYNTH_API short fluid_sequencer_get_client_id ( fluid_sequencer_t seq,
int  index 
)

Get a client ID from its index (order in which it was registered).

Parameters:
seq Sequencer object
Parameters:
index Index of register client
Returns:
Client ID or FLUID_FAILED if not found
FLUIDSYNTH_API char* fluid_sequencer_get_client_name ( fluid_sequencer_t seq,
int  id 
)

Get the name of a registered client.

Parameters:
seq Sequencer object
Parameters:
id Client ID
Returns:
Client name or NULL if not found. String is internal and should not be modified or freed.
FLUIDSYNTH_API int fluid_sequencer_client_is_dest ( fluid_sequencer_t seq,
int  id 
)

Check if a client is a destination client.

Parameters:
seq Sequencer object
Parameters:
id Client ID
Returns:
TRUE if client is a destination client, FALSE otherwise or if not found
FLUIDSYNTH_API void fluid_sequencer_process ( fluid_sequencer_t seq,
unsigned int  msec 
)

Advance a sequencer that isn't using the system timer.

Parameters:
seq Sequencer object
Parameters:
msec Time to advance sequencer to (absolute time since sequencer start).
Since:
1.1.0
FLUIDSYNTH_API void fluid_sequencer_send_now ( fluid_sequencer_t seq,
fluid_event_t evt 
)

Send an event immediately.

Parameters:
seq Sequencer object
Parameters:
evt Event to send (copied)
FLUIDSYNTH_API int fluid_sequencer_send_at ( fluid_sequencer_t seq,
fluid_event_t evt,
unsigned int  time,
int  absolute 
)

Schedule an event for sending at a later time.

Parameters:
seq Sequencer object
Parameters:
evt Event to send
Parameters:
time Time value in ticks (in milliseconds with the default time scale of 1000).
Parameters:
absolute TRUE if time is absolute sequencer time (time since sequencer creation), FALSE if relative to current time.
Returns:
FLUID_OK on success, FLUID_FAILED otherwise
Examples:
fluidsynth_arpeggio.c, and fluidsynth_metronome.c.
FLUIDSYNTH_API void fluid_sequencer_remove_events ( fluid_sequencer_t seq,
short  source,
short  dest,
int  type 
)

Remove events from the event queue.

Parameters:
seq Sequencer object
Parameters:
source Source client ID to match or -1 for wildcard
Parameters:
dest Destination client ID to match or -1 for wildcard
Parameters:
type Event type to match or -1 for wildcard (fluid_seq_event_type)
FLUIDSYNTH_API unsigned int fluid_sequencer_get_tick ( fluid_sequencer_t seq  ) 

Get the current tick of a sequencer.

Parameters:
seq Sequencer object
Returns:
Current tick value
Examples:
fluidsynth_arpeggio.c, and fluidsynth_metronome.c.
FLUIDSYNTH_API void fluid_sequencer_set_time_scale ( fluid_sequencer_t seq,
double  scale 
)

Set the time scale of a sequencer.

Parameters:
seq Sequencer object
Parameters:
scale Sequencer scale value in ticks per second (default is 1000 for 1 tick per millisecond, max is 1000.0)
If there are already scheduled events in the sequencer and the scale is changed the events are adjusted accordingly.
FLUIDSYNTH_API double fluid_sequencer_get_time_scale ( fluid_sequencer_t seq  ) 

Get a sequencer's time scale.

Parameters:
seq Sequencer object.
Returns:
Time scale value in ticks per second.
Generated on Tue Sep 27 17:10:33 2011 for libfluidsynth by  doxygen 1.6.3