LMMS
Loading...
Searching...
No Matches
dssi.h
Go to the documentation of this file.
1/* -*- c-basic-offset: 4 -*- */
2
3/* dssi.h
4
5 DSSI version 1.0
6 Copyright (c) 2004, 2009 Chris Cannam, Steve Harris and Sean Bolton
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public License
10 as published by the Free Software Foundation; either version 2.1 of
11 the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 MA 02110-1301 USA
22*/
23
24#ifndef DSSI_INCLUDED
25#define DSSI_INCLUDED
26
27#include "../ladspa/ladspa.h"
28#include "seq_event-compat.h"
29
30#define DSSI_VERSION "1.0"
31#define DSSI_VERSION_MAJOR 1
32#define DSSI_VERSION_MINOR 0
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38/*
39 There is a need for an API that supports hosted MIDI soft synths
40 with GUIs in Linux audio applications. In time the GMPI initiative
41 should comprehensively address this need, but the requirement for
42 Linux applications to be able to support simple hosted synths is
43 here now, and GMPI is not. This proposal (the "DSSI Soft Synth
44 Interface" or DSSI, pronounced "dizzy") aims to provide a simple
45 solution in a way that we hope will prove complete and compelling
46 enough to support now, yet not so compelling as to supplant GMPI or
47 any other comprehensive future proposal.
48
49 For simplicity and familiarity, this API is based as far as
50 possible on existing work -- the LADSPA plugin API for control
51 values and audio processing, and the ALSA sequencer event types for
52 MIDI event communication. The GUI part of the proposal is quite
53 new, but may also be applicable retroactively to LADSPA plugins
54 that do not otherwise support this synth interface.
55*/
56
58
63 unsigned long Bank;
64
69 unsigned long Program;
70
72 const char * Name;
73
75
76
77typedef struct _DSSI_Descriptor {
78
87
105
165 char *(*configure)(LADSPA_Handle Instance,
166 const char *Key,
167 const char *Value);
168
169 #define DSSI_RESERVED_CONFIGURE_PREFIX "DSSI:"
170 #define DSSI_GLOBAL_CONFIGURE_PREFIX "GLOBAL:"
171 #define DSSI_PROJECT_DIRECTORY_KEY \
172 DSSI_RESERVED_CONFIGURE_PREFIX "PROJECT_DIRECTORY"
173 #define DSSI_CUSTOMDATA_EXTENSION_KEY \
174 DSSI_RESERVED_CONFIGURE_PREFIX "SUPPORTS_CUSTOMDATA"
175
197 const DSSI_Program_Descriptor *(*get_program)(LADSPA_Handle Instance,
198 unsigned long Index);
199
228 unsigned long Bank,
229 unsigned long Program);
230
258 unsigned long Port);
259
307 void (*run_synth)(LADSPA_Handle Instance,
308 unsigned long SampleCount,
309 snd_seq_event_t *Events,
310 unsigned long EventCount);
311
322 unsigned long SampleCount,
323 snd_seq_event_t *Events,
324 unsigned long EventCount);
325
358 void (*run_multiple_synths)(unsigned long InstanceCount,
359 LADSPA_Handle *Instances,
360 unsigned long SampleCount,
361 snd_seq_event_t **Events,
362 unsigned long *EventCounts);
363
374 void (*run_multiple_synths_adding)(unsigned long InstanceCount,
375 LADSPA_Handle *Instances,
376 unsigned long SampleCount,
377 snd_seq_event_t **Events,
378 unsigned long *EventCounts);
379
384 void *Data,
385 unsigned long DataLength);
386
391 void **Data,
392 unsigned long *DataLength);
393
395
415
416const DSSI_Descriptor *dssi_descriptor(unsigned long Index);
417
418typedef const DSSI_Descriptor *(*DSSI_Descriptor_Function)(unsigned long Index);
419
420/*
421 * Macros to specify particular MIDI controllers in return values from
422 * get_midi_controller_for_port()
423 */
424
425#define DSSI_CC_BITS 0x20000000
426#define DSSI_NRPN_BITS 0x40000000
427
428#define DSSI_NONE -1
429#define DSSI_CONTROLLER_IS_SET(n) (DSSI_NONE != (n))
430
431#define DSSI_CC(n) (DSSI_CC_BITS | (n))
432#define DSSI_IS_CC(n) (DSSI_CC_BITS & (n))
433#define DSSI_CC_NUMBER(n) ((n) & 0x7f)
434
435#define DSSI_NRPN(n) (DSSI_NRPN_BITS | ((n) << 7))
436#define DSSI_IS_NRPN(n) (DSSI_NRPN_BITS & (n))
437#define DSSI_NRPN_NUMBER(n) (((n) >> 7) & 0x3fff)
438
439#ifdef __cplusplus
440}
441#endif
442
443#endif /* DSSI_INCLUDED */
Definition Bank.h:34
struct _DSSI_Descriptor DSSI_Descriptor
const DSSI_Descriptor * dssi_descriptor(unsigned long Index)
Definition DSSIaudiooutput.cpp:129
struct _DSSI_Program_Descriptor DSSI_Program_Descriptor
void * LADSPA_Handle
Definition ladspa.h:363
struct _LADSPA_Descriptor LADSPA_Descriptor
struct snd_seq_event snd_seq_event_t
Definition dssi.h:77
void(* select_program)(LADSPA_Handle Instance, unsigned long Bank, unsigned long Program)
Definition dssi.h:227
void(* run_multiple_synths_adding)(unsigned long InstanceCount, LADSPA_Handle *Instances, unsigned long SampleCount, snd_seq_event_t **Events, unsigned long *EventCounts)
Definition dssi.h:374
int DSSI_API_Version
Definition dssi.h:86
void(* run_multiple_synths)(unsigned long InstanceCount, LADSPA_Handle *Instances, unsigned long SampleCount, snd_seq_event_t **Events, unsigned long *EventCounts)
Definition dssi.h:358
int(* get_midi_controller_for_port)(LADSPA_Handle Instance, unsigned long Port)
Definition dssi.h:257
int(* set_custom_data)(LADSPA_Handle Instance, void *Data, unsigned long DataLength)
Definition dssi.h:383
void(* run_synth_adding)(LADSPA_Handle Instance, unsigned long SampleCount, snd_seq_event_t *Events, unsigned long EventCount)
Definition dssi.h:321
int(* get_custom_data)(LADSPA_Handle Instance, void **Data, unsigned long *DataLength)
Definition dssi.h:390
const LADSPA_Descriptor * LADSPA_Plugin
Definition dssi.h:104
Definition dssi.h:57
unsigned long Program
Definition dssi.h:69
unsigned long Bank
Definition dssi.h:63
const char * Name
Definition dssi.h:72
Definition lv2apply.c:40
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396