summaryrefslogtreecommitdiffstats
path: root/arts/modules/synth/artsmodulessynth.idl
blob: b9ac3d4692829a9a6434d1f933b3947fc16f667e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/*

    Copyright (C) 2000-2001 Stefan Westerfeld
                                stefan@space.twc.de
                  2001-2003 Matthias Kretz
                            kretz@kde.org
                  2002-2003 Arnold Krille
                            arnold@arnoldarts.de

     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
     License as published by the Free Software Foundation; either
     version 2 of the License, or (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     Library General Public License for more details.

     You should have received a copy of the GNU Library General Public License
     along with this library; see the file COPYING.LIB.  If not, write to
     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     Boston, MA 02110-1301, USA.

*/

/*
* DISCLAIMER: The interfaces in artsmodules.idl (and the derived .cc/.h files)
*             DO NOT GUARANTEE BINARY COMPATIBILITY YET.
*
* They are intended for developers. You shouldn't expect that applications in
* binary form will be fully compatibile with further releases of these
* interfaces.
*/

#include <artsflow.idl>
#include <artsmidi.idl>

module Arts {

// Arithmetic & Mixing

/**
 * Divides two audio streams
 */
interface Synth_DIV : SynthModule {
	in audio stream invalue1,invalue2;
	out audio stream outvalue;
	default invalue1, invalue2;
};

interface Synth_XFADE : SynthModule {
	in audio stream invalue1,invalue2,percentage;
	out audio stream outvalue;
};

interface Synth_AUTOPANNER : SynthModule {
	in audio stream invalue, inlfo;
	out audio stream outvalue1, outvalue2;
};

// Delays

interface Synth_DELAY : SynthModule {
	attribute float maxdelay;
	in audio stream invalue, time;
	out audio stream outvalue;
};

interface Synth_CDELAY : SynthModule {
	attribute float time;
	in audio stream invalue;
	out audio stream outvalue;
};

// Envelopes

interface Synth_ENVELOPE_ADSR : SynthModule {
	in audio stream active,invalue,attack,decay,sustain,release;
	out audio stream outvalue,done;
};

interface Synth_PSCALE : SynthModule {
	attribute float top;
	in audio stream invalue, pos;
	out audio stream outvalue;
};

// Effects

interface Synth_TREMOLO : SynthModule {
	in audio stream invalue, inlfo;
	out audio stream outvalue;
};

interface Synth_FX_CFLANGER : SynthModule {
	attribute float mintime, maxtime;
	in audio stream invalue, lfo;
	out audio stream outvalue;
};

interface Synth_COMPRESSOR : SynthModule {
	attribute float attack, release, threshold, ratio, output;
	in audio stream invalue;
	out audio stream outvalue;
};

// Filters

interface Synth_PITCH_SHIFT : SynthModule {
	attribute float speed, frequency;
	in audio stream invalue;
	out audio stream outvalue;
};

interface Synth_PITCH_SHIFT_FFT : SynthModule {
	attribute float speed, scaleFactor;
	attribute long frameSize, oversample;
	in audio stream inStream;
	out audio stream outStream;
};

interface Synth_SHELVE_CUTOFF : SynthModule {
	in audio stream invalue,frequency;
	out audio stream outvalue;
};

interface Synth_BRICKWALL_LIMITER : SynthModule {
	in audio stream invalue;
	out audio stream outvalue;
};

interface Synth_STD_EQUALIZER : SynthModule {
	attribute float low, mid, high, frequency, q;
	in audio stream invalue;
	out audio stream outvalue;
};

interface Synth_RC : SynthModule {
	attribute float b, f;
	in audio stream invalue;
	out audio stream outvalue;
};

interface Synth_MOOG_VCF : SynthModule {
	attribute float frequency, resonance;
	in audio stream invalue;
	out audio stream outvalue;
};

interface Synth_ATAN_SATURATE : SynthModule {
	attribute float inscale;
	in audio stream invalue;
	out audio stream outvalue;
};

// Midi + Sequencing

interface Synth_MIDI_TEST : SynthModule, MidiPort {
	attribute string filename;
	attribute string busname;
};

interface Synth_SEQUENCE : SynthModule {
	attribute float speed;
	attribute string seq;
	out audio stream frequency, pos;
};

interface Synth_SEQUENCE_FREQ : SynthModule {
	attribute float speed;
	attribute string seq;
	out audio stream frequency, pos;
};

// Oscillation & Modulation

interface Synth_FM_SOURCE : SynthModule {
	in audio stream frequency, modulator, modlevel;
	out audio stream pos;
};

// Waveforms

interface Synth_WAVE_TRI : SynthModule {
	in audio stream pos;
	out audio stream outvalue;
};

interface Synth_NOISE : SynthModule {
	out audio stream outvalue;
};

interface Synth_WAVE_SQUARE : SynthModule {
	in audio stream pos;
	out audio stream outvalue;
};

interface Synth_WAVE_SOFTSAW : SynthModule {
	in audio stream pos;
	out audio stream outvalue;
};

interface Synth_WAVE_PULSE : SynthModule {
	attribute float dutycycle;
	in audio stream pos;
	out audio stream outvalue;
};

enum SynthOscWaveForm {
	soWaveSine,
	soWaveTriangle,
	soWaveSawRise,
	soWaveSawFall,
	soWavePeakRise,
	soWavePeakFall,
	soWaveMoogSaw,
	soWaveSquare,
	soWavePulseSaw
};

interface Synth_OSC : SynthModule {
	/* streams */
	in audio stream infrequency, modulation, inpwm, insync;
	out audio stream outvalue, outsync;

	attribute SynthOscWaveForm waveForm;

	/* FM */
	attribute boolean fmExponential;
	attribute float fmStrength;
	attribute float fmSelfStrength;

	/* phase, frequency, fineTune */
	attribute float phase;
	attribute float frequency;
	attribute long fineTune;

	/* pulse width */
	attribute float pulseWidth;
	attribute float pulseModStrength;
};

interface Synth_PLAY_PAT : SynthModule {
	attribute string filename;
	in audio stream frequency;
	out audio stream outvalue;
};

// Others

/**
 * this interface currently has probably a problem - usually, if you are
 * using such a module, you would expect that you can specify the filename
 * with it - BUT, if you allow this, then any instrument definition file
 * (.arts) and similar might overwrite every file the user can access, which
 * might not be what you want, so I currently save it to a file in
 * /tmp/mcop-<username>/<filename>.wav (which might be unlucky since the user
 * might not have too much space there)
 */
interface Synth_CAPTURE_WAV : SynthModule {
	attribute string filename;
	default in audio stream left, right;
};

// Tests

interface Synth_NIL : SynthModule {
};

interface Synth_DEBUG : SynthModule {
	attribute string comment;
	in audio stream invalue;
};

interface Synth_DATA : SynthModule {
	attribute float value;
	out audio stream outvalue;
};

interface Synth_MIDI_DEBUG : SynthModule, MidiPort {
};

// EXPERIMENTAL MIDI
interface ObjectCache {
	void put(object obj, string name);
	object get(string name);
};

interface MidiReleaseHelper : SynthModule {
	attribute SynthModule voice;
	attribute string name;
	attribute ObjectCache cache;

	boolean terminate();
	in audio stream done;
};
// END EXPERIMENTAL MIDI

};