Debian Codegraph @

notes/realworld.org

raw
1 * JUCE host
2
3 1. create
4 1. contructEffect
5 1. calls =VSTPluginMain= to get a plugin
6 2. checks =effect->magic=
7 3. checks =effect->resvd2!=0=
8 2. set =effect->resvd2= to 0
9 3. calls =effIdentify(0,0,NULL,0.))= (ignores result)
10 4. calls =effSetSampleRate(0,0,NULL,sampleRate)=
11 5. calls =effSetBlockSize(0,blockSize,NULL, 0.f)=
12 6. calls =effOpen(0,0,NULL,0.))=
13 7. queryBusIO
14 1. calls =effSetSpeakerArrangement(0, ?, ?, 0.f)=
15 2. getSpeakerArrangementWrapper
16 1. ?
17 3. =effGetInputProperties(ch=0..n, 0, &pinProps, 0.0f)=
18 4. =effGetOutputProperties(ch=0..n, 0, &pinProps, 0.0f)=
19 8. VSTPluginInstance
20 1. =effCanBeAutomated(param=0..n, 0, 0, 0, 0)=
21
22
23 * REAPER host
24
25 #+BEGIN_SRC C
26 /* init */
27 effect->dispatcher(effOpen, 0, 0, (nil), 0.000000);
28 effect->dispatcher(effSetSampleRate, 0, 0, (nil), 44100.000000);
29 effect->dispatcher(effSetBlockSize, 0, 512, (nil), 0.000000);
30 effect->dispatcher(effGetEffectName, 0, 0, 0x7ffcf7237fc0, 0.000000);
31 effect->dispatcher(effGetVendorString, 0, 0, 0x7ffcf7237fc0, 0.000000);
32 effect->dispatcher(effCanDo, 0, 0, 0xab4617, 0.000000);
33 effect->dispatcher(effCanDo, 0, 0, 0xab4af0, 0.000000);
34 effect->dispatcher(effCanDo, 0, 0, 0xab4670, 0.000000);
35 effect->dispatcher(effGetVstVersion, 0, 0, (nil), 0.000000);
36 effect->dispatcher(effMainsChanged, 0, 1, (nil), 0.000000);
37 effect->dispatcher(effStartProcess, 0, 0, (nil), 0.000000);
38 effect->dispatcher(effCanDo, 0, 0, 0xab4684, 0.000000);
39 effect->dispatcher(effCanDo, 0, 0, 0xab4695, 0.000000);
40 effect->dispatcher(effGetPlugCategory, 0, 0, (nil), 0.000000);
41 effect->dispatcher(effCanDo, 0, 0, 0xab46a9, 0.000000);
42 effect->dispatcher(effCanDo, 0, 0, 0xab46b7, 0.000000);
43 effect->dispatcher(effGetProgram, 0, 0, (nil), 0.000000);
44 effect->dispatcher(effGetChunk, 0, 0, 0x7ffcf722fd10, 0.000000);
45 effect->dispatcher(effSetProgram, 0, 0, (nil), 0.000000);
46 effect->dispatcher(effGetProgramName, 0, 0, 0x7ffcf7237dc0, 0.000000);
47 effect->dispatcher(effGetProgram, 0, 0, (nil), 0.000000);
48
49 /* start playback */
50 effect->dispatcher(effMainsChanged, 0, 0, (nil), 0.000000);
51 effect->dispatcher(effMainsChanged, 0, 1, (nil), 0.000000);
52
53 /* de-init */
54 effect->dispatcher(effMainsChanged, 0, 0, (nil), 0.000000);
55 effect->dispatcher(effMainsChanged, 0, 1, (nil), 0.000000);
56 effect->dispatcher(effMainsChanged, 0, 0, (nil), 0.000000);
57 effect->dispatcher(effMainsChanged, 0, 1, (nil), 0.000000);
58 effect->dispatcher(StopProcess, 0, 0, (nil), 0.000000);
59 effect->dispatcher(effMainsChanged, 0, 0, (nil), 0.000000);
60 effect->dispatcher(effClose, 0, 0, (nil), 0.000000);
61 #+END_SRC
62
63
64 * REAPER plugins
65
66 plugins that come with REAPER fail to instantiate.
67 however, in the `VSTPluginMain` function they call the host
68 with two callbacks:
69 #+BEGIN_SRC C
70 hostDispatcher(0, 0xDEADBEEF, 0xDEADFOOD, 0, "DB2SLIDER", 0.f);
71 hostDispatcher(0, 0xDEADBEEF, 0xDEADFOOD, 0, "SLIDER2DB", 0.f);
72 #+END_SRC
73
74 I *think* that the plugin is asking for shared functions.
75 At least, if we return a function pointer, the `reacomp.vst` plugin loads!
76
77 we can then load the following plugins:
78 - REAPER/Plugins/FX/reacomp.vst.so
79 - REAPER/Plugins/FX/readelay.vst.so
80 - REAPER/Plugins/FX/reagate.vst.so
81 - REAPER/Plugins/FX/reasyndr.vst.so
82 - REAPER/Plugins/FX/reasynth.vst.so
83 - REAPER/Plugins/FX/reatune.vst.so
84 - REAPER/Plugins/FX/reaverbate.vst.so
85 - REAPER/Plugins/FX/reavocode.vst.so
86
87
88
89 * Categories as reported by REAPER
90
91 ** Delay
92 - ReaDelay
93 ** Dynamics
94 - ReaComp
95 - ReaXComp
96 ** EQ
97 - ReaEQ
98 ** External
99 - ReaCast
100 - ReaInsert
101 - ReaNINJAM
102 - ReaStream (8ch)
103 ** Gate
104 - ReaGate
105 ** MIDI
106 - ReaControlMIDI
107 ** Pitch Correction
108 - ReaPitch
109 ** Reverb
110 - ReaVerb
111 - ReaVerbate
112 ** Sampler
113 - ReaSamplOmatic5000
114 ** Surround
115 - ReaSurround
116 ** Synth
117 - Digits
118 - hypercyclic
119 - tonespace
120 - ReaSynDr
121 - ReaSynth
122
123 ** Tools
124 - ReaFir
125 - ReaVocode
126 - ReaVoice
127 ** Tuner
128 - ReaTune
129
130
131
132 * VstPinProperties
133
134 #+BEGIN_SRC C++
135 Vst2::VstPinProperties pinProps;
136 if (dispatch (Vst2::effGetOutputProperties, index, 0, &pinProps, 0.0f) != 0)
137 return String (pinProps.label, sizeof (pinProps.label));
138 #+END_SRC
139
140 ** VstPinProperties.flags
141
142 if (kVstPinUseSpeaker): layout=VstPinProperties.arrangementType
143 else if (kVstPinIsStereo): layout=stereo
144 else: layout=mono
145
146 ** VstPinProperties.arrangementType
147 -> SpeakerMappings::vstArrangementTypeToChannelSet
148
149 SpeakerMappings::vstArrangementTypeToChannelSet (pinProps.arrangementType, 0);
150 const Vst2::VstSpeakerArrangement* arr = (isInput ? inArr : outArr);
151 layout = SpeakerMappings::vstArrangementTypeToChannelSet (*arr);
152
153
154 #+BEGIN_SRC C
155 struct {
156 char label[64];
157 int flags;
158 int arrangmentType;
159 char shortLabel[8];
160 }
161 #+END_SRC
162
163 has =arrangementType=0; flags=3= for our "normal" test plugins
164 and =arrangementType=1; flags=2= for our the reaper plugins
165
166 this probably means:
167
168 kVstPinIsActive=1;
169 kVstPinUseSpeaker=2;
170 kSpeakerArrMono=0;
171
172
173 * Flags and Double
174
175 | plugin | process | replacing | replacing2 |
176 |--------------------+----------------+----------------+----------------|
177 | BowEcho | 0x7fa99438edc0 | 0x7fa99438edd0 | 0x7fa99438ede0 |
178 | Danaides | 0x7f69e5e5a940 | 0x7f69e5e5a950 | 0x7f69e5e5a960 |
179 | DigitsVST_64 | 0x7f549efad620 | 0x7f549efacc80 | 0x7f549efad650 |
180 | hypercyclic | 0x7f9217a2a9be | 0x7f9217a2a9ce | 0x7f9217a2a9dc |
181 | InstaLooperVST-x64 | 0x7f7504284660 | 0x7f7504284670 | 0x7f7504284680 |
182 | Protoverb.64 | 0x7f2c0ed37d70 | 0x7f2c0ed37d80 | 0x7f2c0ed37d90 |
183 | tonespace | 0x7f7f723159be | 0x7f7f723159ce | 0x7f7f723159dc |
184 |--------------------+----------------+----------------+----------------|
185 | reacomp | 0x7febc27162e0 | 0x7febc27162e0 | 0x7febc271cea0 |
186 | readelay | 0x7f3624b55820 | 0x7f3624b55820 | 0x7f3624b59940 |
187 | reagate | 0x7fa4303f2cf0 | 0x7fa4303f2cf0 | 0x7fa4303f7fd0 |
188 | reasyndr | 0x7f0de838a220 | 0x7f0de838a300 | (nil) |
189 | reasynth | 0x7f60ca2d1020 | 0x7f60ca2d3330 | (nil) |
190 | reaverbate | 0x7f7d1d15e5c0 | 0x7f7d1d15e5c0 | 0x7f7d1d15e640 |
191 | reavocode | 0x7fcc4ab2a130 | 0x7fcc4ab2a130 | 0x7fcc4ab2a1d0 |
192
193
194 | plugin | flags |
195 |--------------------+-------------------|
196 | Protoverb.64 | 00000000 00110001 |
197 | DigitsVST_64 | 00000001 00110000 |
198 | InstaLooperVST-x64 | 00000000 00010001 |
199 | BowEcho | 00000010 00110001 |
200 | Danaides | 00000010 00110001 |
201 | hypercyclic | 00000011 00110001 |
202 | tonespace | 00000011 00110001 |
203 |--------------------+-------------------|
204 | reacomp | 00010000 00010001 |
205 | readelay | 00010000 00110001 |
206 | reagate | 00010000 00010001 |
207 | reasyndr | 00000001 00010001 |
208 | reasynth | 00000001 00010001 |
209 | reaverbate | 00010000 00010001 |
210 | reavocode | 00010000 00110001 |
211 |--------------------+-------------------|
212 | FLAGS | ___C__98 __54___0 |
213
214
215 | flag | | value | notes |
216 |----------------------------+---+-------+------------------------------|
217 | effFlagsHasEditor | 0 | 1<< 0 | |
218 | effFlagsProgramChunks | 5 | 1<< 5 | |
219 | effFlagsIsSynth | 8 | 1<< 8 | |
220 |----------------------------+---+-------+------------------------------|
221 | effFlagsCanDoubleReplacing | C | 1<<12 | |
222 | effFlagsCanReplacing | 4 | 1<<4 | |
223 | effFlagsNoSoundInStop | 9 | 1<<9 | |
224 |----------------------------+---+-------+------------------------------|
225 | | 4 | | ALL |
226 | | 9 | | JUCE |
227 | | C | | only reaper (except reasyn*) |
228 | | | | |
229
230
231 * effCode:56
232
233 REAPER calls =opcode:56= with a =ptr= that points to a zeroed-out memory region.
234
235 ** size of zero-memory
236 first non-zero byte @
237 - 0x99, danach 4D D1 9B 99 06 CC 0C
238 - 0x99, danach 6A 7B 8C 9A 80 71 F8
239 - 0x99, danach FE 2A 66 F0 46 D2 02
240
241
242 * 64bit vs 32bit
243
244 FstClient::dispatcher(0x1ec2080, 42, 0, 32252624, 0x1ec2740, 0.000000)... 0x1ec22d0
245 FstClient::dispatcher(0x9e36510, 42, 0, 172519840, 0xa487610, 0.000000)... 0xa4871a0
246
247
248 dispatch4host(0x1ec2080, audioMasterGetTime, 0, 0, 0x7ffe4d90d2c0, 0.000000)
249 dispatch4host: 32248472 (0x1EC1298)
250
251 dispatch4host(0x9e36510, audioMasterGetTime, 0, 18443692774323650560, (nil), -nan)
252 dispatch4host: 740955491651839768 (0xFFF5285800000000)
253
254
255 ** VstEvents
256
257 - 32bit: =02000000 00 00 00 00 68F9F1ED 88F9F1ED=
258 - 64bit: =02000000 00 00 00 00 00 00 00 00 00 00 00 00 806E00146C7F0000 A06E00146C7F0000=
259
260
261 * Time/SMTP
262
263 ** 30/1 fps
264
265 #+BEGIN_SRC C
266 VstTimeInfo @ 0x18230c8
267 flags: 0
268 smpteFrameRate: 12034
269 smpteOffset: -1
270 currentBar: 2
271 magic: 0xDEADBEEF
272 #+END_SRC
273
274 #+BEGIN_SRC C
275 VstTimeInfo @ 0x16c50a8
276 flags: 0
277 smpteFrameRate: 12034
278 smpteOffset: -1
279 currentBar: 3
280 magic: 0xDEADBEEF
281 #+END_SRC
282
283
284 ** fps 30/1
285 #+BEGIN_SRC C
286 04 00 00 00 04 00 00 00 0B 00 00 00 EF BE AD DE
287 00 00 00 00 02 2F 00 00 FF FF FF FF 00 02 00 00
288 #+END_SRC
289
290 ** fps 24/1
291 #+BEGIN_SRC C
292 04 00 00 00 04 00 00 00 08 00 00 00 EF BE AD DE
293 00 00 00 00 02 2F 00 00 FF FF FF FF 00 02 00 00
294 #+END_SRC
295
296 ** fps 25/1
297 #+BEGIN_SRC C
298 04 00 00 00 04 00 00 00 02 00 00 00 EF BE AD DE
299 00 00 00 00 02 2F 00 00 FF FF FF FF 00 02 00 00
300 #+END_SRC
301
302 #+BEGIN_SRC C
303 #+END_SRC
304
305
306 ** flags
307
308 | flags | flags(bin) | description |
309 |-------------+----------------+---------------|
310 | 00 2f 00 00 | 10111100000000 | pause |
311 | 02 2f 00 00 | 10111100000010 | playing |
312 | 0a 2f 00 00 | 10111100001010 | recording |
313 | 06 3f 00 00 | 11111100000110 | looping |
314 | 01 2f 00 00 | 10111100000001 | stopping |
315 | 03 2f 00 00 | 10111100000011 | starting play |
316 | 07 3f 00 00 | 11111100000111 | starting loop |
317
318 | flags(bin) | description |
319 |-----------------+---------------|
320 | 101111 00000000 | pause |
321 | 101111 00000010 | playing |
322 | 111111 00000110 | looping |
323 | 101111 00000001 | stopping |
324 | 101111 00000011 | starting play |
325 | 111111 00000111 | starting loop |
326 | 101111 00001010 | recording |
327 | | |
328
329 | flags | value |
330 |----------------------------+-------|
331 | `kVstTransportChanged` | 1<<0 |
332 | `kVstTransportPlaying` | 1<<1 |
333 | `kVstTransportCycleActive` | 1<<2 |
334 | `kVstTransportRecording` | 1<<3 |
335 | | |
336
337 | flag | valid |
338 |-------------------+---------|
339 | kVstCyclePosValid | looping |
340 | kVstBarsValid | yes |
341 | kVstPpqPosValid | yes |
342 | kVstTempoValid | yes |
343 | kVstTimeSigValid | yes |
344 | kVstClockValid | ? |
345 | kVstNanosValid | ? |
346 | kVstSmpteValid | ?- |
347 | | |
348
349
350 * MrWatson
351
352 # plugin asked for time in nanoseconds
353 # Plugin requested position in bars, but not PPQ
354
355 | flag | binary | warning |
356 |--------+--------+----------------------------------------|
357 | 0x0100 | 1<< 8 | "plugin asked for time in nanoseconds" |
358 | 0x0200 | 1<< 9 | flags=0x0203; ppqPos |
359 | 0x0400 | 1<<10 | flags=0x0403; tempo |
360 | 0x0800 | 1<<11 | flags=0x0803; barStartPos |
361 | 0x2000 | 1<<13 | flags=0x2003; timeSig... |
362 | 0x4000 | 1<<14 | "Current time in SMPTE format" |
363 | 0x8000 | 1<<15 | "Sample frames until next clock" |
364
365 | flag | binary | @54-57 | set data |
366 |--------+--------+--------+-------------------------------------|
367 | 0x0200 | 1<< 9 | 0x0203 | ppqPos |
368 | 0x0400 | 1<<10 | 0x0403 | tempo |
369 | 0x0800 | 1<<11 | 0x0803 | barStartPos |
370 | 0x2000 | 1<<13 | 0x2003 | timeSigNumerator/timeSigDenominator |
371 | | | | |
372
373 | flag | value |
374 |----------------------------+-------|
375 | `kVstTransportChanged` | 1<< 0 |
376 | `kVstTransportPlaying` | 1<< 1 |
377 | `kVstTransportCycleActive` | 1<< 2 |
378 | `kVstTransportRecording` | 1<< 3 |
379 |----------------------------+-------|
380 | `kVstNanosValid` | 1<< 8 |
381 | `kVstPpqPosValid` | 1<< 9 |
382 | `kVstTempoValid` | 1<<10 |
383 | `kVstBarsValid` | 1<<11 |
384 | `kVstCyclePosValid` | 1<<12 |
385 | `kVstTimeSigValid` | 1<<13 |
386
387
388 ** Protoverb
389
390 #+BEGIN_BLOCK
391 Protoverb VST telling MrsWatson about 16 samples latency
392 UNSUPPORTED FEATURE: VST master opcode audioMasterIOChanged
393 This feature is not yet supported. Please help us out and submit a patch! :)
394 Project website: https://github.com/teragonaudio/mrswatson
395 Support email: [email protected]
396 - 00061952 000181 Finished processing input source
397 #+END_BLOCK
398
399 where FstHost tells us:
400
401 #+BEGIN_BLOCK
402 sending latency to host... 16
403 Protoverb VST telling FstProduct? about 16 samples latency
404 FstHost::dispatcher[0](13, 0, 0, (nil), 0.000000)
405 dyspatcher(0x5611057e4bf0, 13, 0, 0, (nil), 0.000000);
406 #+END_BLOCK
407
408 ** BowEcho/Danaides
409
410 #+BEGIN_BLOCK
411 UNSUPPORTED FEATURE: Current time in SMPTE format
412 This feature is not yet supported. Please help us out and submit a patch! :)
413 Project website: https://github.com/teragonaudio/mrswatson
414 Support email: [email protected]
415 #+END_BLOCK
416
417 ** tonespace
418
419 #+BEGIN_BLOCK
420 - 00000000 000000 Opening VST2.x plugin '/Net/iem/Benutzer/zmoelnig/src/iem/FST/tmp/vst64/hypercyclic/hypercyclic.so'
421 UNSUPPORTED FEATURE: Current time in SMPTE format
422 This feature is not yet supported. Please help us out and submit a patch! :)
423 Project website: https://github.com/teragonaudio/mrswatson
424 Support email: [email protected]
425 #+END_BLOCK
426
427 ** hypercyclic
428
429 #+BEGIN_BLOCK
430 - 00000000 000000 Opening VST2.x plugin '/Net/iem/Benutzer/zmoelnig/src/iem/FST/tmp/vst64/hypercyclic/hypercyclic.so'
431 unknown display value id=D
432 unknown display value id=B
433 UNSUPPORTED FEATURE: Current time in SMPTE format
434 This feature is not yet supported. Please help us out and submit a patch! :)
435 Project website: https://github.com/teragonaudio/mrswatson
436 Support email: [email protected]
437 #+END_BLOCK
438
439
440 * vstplugin~
441
442 ** TODO
443 | opcode | ? |
444 |-----------------------------+---|
445 | audioMasterIdle | |
446 |-----------------------------+---|
447 | effEditIdle | |
448 | effBeginSetProgram | |
449 | effEndSetProgram | |
450 | effGetNumMidiInputChannels | |
451 | effGetNumMidiOutputChannels | |
452 | effGetTailSize | |
453 | effSetBypass | |
454 | effString2Parameter | |
455 |-----------------------------+---|
456 | kVstAutomationReading | |
457 | kVstAutomationWriting | |
458
459 ** DONE
460 | opcode | |
461 |------------------------+----|
462 | | |
463 |------------------------+----|
464 | effSetProcessPrecision | 77 |
465 |------------------------+----|
466 | kVstProcessPrecision32 | 0 |
467 | kVstProcessPrecision64 | 1 |
468 | | |
469
470
471 * AudioPluginHost
472
473 ** TODO
474 | opcode | value | notes |
475 |-------------------+-------+---------|
476 | effCanBeAutomated | | |
477 | effConnectInput | | |
478 | effConnectOutput | | |
479 | effKeysRequired | | |
480 | effSetBypass | | BowEcho |
481 |-------------------+-------+---------|
482 | audioHost??? | 3 | |
483 | audioHost??? | 13 | |
484 | audioHost??? | 42 | |
485
486
487
488 * REAPER
489
490 ** TODO
491 | opcode | value | commen |
492 |--------+-------+--------------------------|
493 | eff??? | 19 | immer abwechselnd mit 53 |
494 | eff??? | 53 | |
495 |--------+-------+--------------------------|
496 | | 56 | |
497 | | 62 | |
498
499
500 * FstHost
501
502 | opcode | value | return | plugins |
503 |-----------------------------+-------+----------+---------|
504 | | 26 | 1 | * |
505 | | 44 | 1 | JUCE |
506 | effGetCurrentMidiProgram? | 63 | -1 | * |
507 | effSetTotalSampleToProcess? | 73 | <ivalue> | |
508 | | 78 | 1 | Digits |
509 | | | | |
510
511
512 * u-he
513
514 - 'u-he doesn't use key [...]'