Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb790214d5 | |||
| 4cc0976f81 | |||
| 80461d11c8 | |||
| 39180969bd | |||
| c8ad7fcd9e | |||
| 42d0eb6509 | |||
| ee34558c30 | |||
| 290c706d1a | |||
| ba3b030e41 | |||
| 85e12b86f3 | |||
| 9f9fae2822 | |||
| bea578104f | |||
| af7afaf8b2 | |||
| 9f67aa682a | |||
| dd4847399c |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -10,4 +10,5 @@ vstsdk2.4
|
|||||||
|
|
||||||
# files
|
# files
|
||||||
|
|
||||||
build/Release64/pdvstdebug.txt
|
build/Release64/pdvstdebug.txt
|
||||||
|
build/Release32/pdvstdebug.txt
|
||||||
165
README.md
Normal file
165
README.md
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
# Pdvst-0.52
|
||||||
|
|
||||||
|
|
||||||
|
Based on https://github.com/jyg/pure-data/tree/master/pdvst but updated to load with Pd-0.52
|
||||||
|
or higher.
|
||||||
|
|
||||||
|
|
||||||
|
# How does it work ?
|
||||||
|
|
||||||
|
PdVst consists of two main parts :
|
||||||
|
* a vst-plugin (`pdvst-template.dll`) to place in your favorite vst folder.
|
||||||
|
* a custom external scheduler (`vstschedlib.dll`) to copy in the pure-data /bin folder
|
||||||
|
|
||||||
|
When a PdVst plugin is opened by the host application, a setup file (*.pdv) is read to determine
|
||||||
|
information about the plugin, such as the Pd patch file to use, the number of parameters, etc...
|
||||||
|
An instance of Pd.exe is started and opens the Pd patch file whose name was found in the setup file.
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
This new version doesn't need a custom version of pure-data. You can use your current pure-data
|
||||||
|
installation (>= Pd-0.52) with your favorite externals).
|
||||||
|
|
||||||
|
1) According to your pd version (32 or 64 bits), go to the folder `Release32` or `Release64`.
|
||||||
|
Copy `vstschedlib.dll` to `\bin` directory of your current pure-data installation
|
||||||
|
|
||||||
|
2) Copy your plugin `.dll` file (e.g. `Pd_Gain.dll`) to the vst plugins directory
|
||||||
|
for the application (e.g. `c:/Program Files (x86)/Steinberg/Cubase VST/VstPlugins/`)
|
||||||
|
|
||||||
|
3) New way : in the vst plugin directory, create a subdir with the name of your plugin
|
||||||
|
(e.g. `c:/Program Files (x86)/Steinberg/Cubase VST/VstPlugins/Pd_Gain/`).
|
||||||
|
This folder will contain the `.pdv` and `.pd` files associated to your plugin.
|
||||||
|
|
||||||
|
NOTE (advanced) : if you choose the new way, you can also include an standalone version of
|
||||||
|
puredata in the vst directory, simply paste it in the subfolder `.pd/`
|
||||||
|
(e.g. `c:/Program Files (x86)/Steinberg/Cubase VST/VstPlugins/.pd/`)
|
||||||
|
|
||||||
|
3bis) Old way : create a pdvst folder in the directory that contains the
|
||||||
|
application (e.g. `Reaper.exe`) that you want to use PdVst with.
|
||||||
|
(e.g. `c:/Program Files/REAPER/pdvst/`). This folder will contain the `.pdv` and `.pd` files, and
|
||||||
|
optionnally a copy of pure-data application (inside `c:/Program Files/REAPER/pdvst/pd/`).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Creating VST Plugins from Pd Patches
|
||||||
|
|
||||||
|
* Create a new `.pdv` setup file (see the `.pdv` Setup File section). The file
|
||||||
|
must be named the same as the plugin (e.g. for a plugin named Pd_Gain you
|
||||||
|
would create a file named `Pd_Gain.pdv`). Place this file and all dependant
|
||||||
|
files (`.pd` files, external Pd library `.dll` files, etc.) as specified above (section
|
||||||
|
"Installation").
|
||||||
|
|
||||||
|
* Make a copy of the `pdvst-template.dll` file and
|
||||||
|
rename the same as the plugin and `.pdv` file (e.g. for a plugin named
|
||||||
|
Pd_Gain you would copy `pdvst-template.dll` to a new file named `Pd_Gain.dll`).
|
||||||
|
Move your new plugin `.dll` file to the vst plugins folder of the application.
|
||||||
|
|
||||||
|
# The .pdv Setup File-
|
||||||
|
|
||||||
|
This file contains all of the information about your plugin. The format is ASCII
|
||||||
|
text with keys and values separated by an '=' character and each key and value
|
||||||
|
pair separated by a carriage return. Comments are demarked with a '#' character.
|
||||||
|
For an example, see Pd_Gain.pdv.
|
||||||
|
|
||||||
|
-Keys-
|
||||||
|
|
||||||
|
CHANNELS = <integer>
|
||||||
|
Number of audio input and output channels. Tested with 2 and 4.
|
||||||
|
Should work with larger values.
|
||||||
|
|
||||||
|
PDPATH = <string>
|
||||||
|
Path to the installation directory of pure-data program.
|
||||||
|
(example : PDPATH = C:/Program Files (x86)/pd-0.47-1/ )
|
||||||
|
If this line is not specified, for compatibility with older version, the program will first
|
||||||
|
look for pd.exe in <host_exec_dir>/pdvst/pd/bin.
|
||||||
|
If there is not an existing pd installation in <host_exec_dir>/pdvst/, the program will then
|
||||||
|
look for pd.exe in <VST_FOLDER>/.pd/
|
||||||
|
|
||||||
|
MAIN = <string>
|
||||||
|
The .pd file for Pd to open when the plugin is opened.
|
||||||
|
|
||||||
|
ID = <string[4]>
|
||||||
|
The 4-character unique ID for the VST plugin. This is required by VST and
|
||||||
|
just needs to be a unique string of four characters.
|
||||||
|
|
||||||
|
SYNTH = <TRUE/FALSE>
|
||||||
|
Boolean value stating whether this plugin is an instrument (VSTi) or an effect.
|
||||||
|
Both types of plugins can send/receive midi events.
|
||||||
|
|
||||||
|
CUSTOMGUI = <TRUE/FALSE>
|
||||||
|
Boolean value stating whether the Pd patch uses a custom GUI (e.g. GrIPD).
|
||||||
|
|
||||||
|
DEBUG = <TRUE/FALSE>
|
||||||
|
Boolean value stating whether to display the Pd GUI when the plugin is opened.
|
||||||
|
|
||||||
|
PARAMETERS = <integer>
|
||||||
|
Number of parameters the plugin uses (up to 128).
|
||||||
|
|
||||||
|
NAMEPARAMETER<integer> = <string>
|
||||||
|
Display name for parameters. Used when CUSTOMGUI is false or the VST host doesn't
|
||||||
|
support custom editors.
|
||||||
|
|
||||||
|
PROGRAM = <string>
|
||||||
|
Declares a new VST program and sets the name (up to 128 programs can be declared)
|
||||||
|
|
||||||
|
PARAMETER<integer> = <float>
|
||||||
|
Defines the parameter values for the last declared program. <float> must be
|
||||||
|
between 0 and 1 inclusive.
|
||||||
|
|
||||||
|
PROGRAMSARECHUNKS = <TRUE/FALSE>
|
||||||
|
All vst parameters are saved in the host session and additionally
|
||||||
|
you can set/get some "Pd list" in the session or to a .fxp/.fxb file
|
||||||
|
via [s svstdata] and [r rvstdata]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Pd/VST audio/midi Communication
|
||||||
|
|
||||||
|
When the plugin is opened, the .pd patch file declared in the .pdv setup file's MAIN key
|
||||||
|
will be opened.
|
||||||
|
|
||||||
|
The Pd patch will receive its incoming audio stream from the adc~ object,
|
||||||
|
and incoming MIDI data from the Pd objects notein, ctlin, and pgmin.
|
||||||
|
|
||||||
|
Pd patches should output their audio stream to the dac~ object,
|
||||||
|
and their midi stream to the noteout, ctlout, pgmout objects.
|
||||||
|
|
||||||
|
REMARKS :
|
||||||
|
* The midi out feature is still experimental and not fully tested. It should work when host uses ASIO driver, more erratic with mmio. Midi out note on/off have been tested, other midi messages untested but should work.
|
||||||
|
* Inside puredata plugin, don't use "media/ASIO" or "media/standard" audio menu, you may crash pd & host.
|
||||||
|
* You can continue to use "media/midi settings" menu to select input and output midi devices independently from host.
|
||||||
|
|
||||||
|
# Pd/VST - further communications
|
||||||
|
|
||||||
|
For purposes such as GUI interaction and VST automation, your patch may need to communicate
|
||||||
|
further with the VST host. Special Pd send/receive symbols can be used in your Pd patch.
|
||||||
|
For an example, see the pd-gain.pd file.
|
||||||
|
|
||||||
|
* `rvstparameter<integer>` : Use this symbol to receive parameter values from the VST host. Values will be floats between 0 and 1 inclusive.
|
||||||
|
* `svstparameter<integer>` : Use this symbol to send parameter values to the VST host. Values should be floats between 0 and 1 inclusive.
|
||||||
|
* `rvstopengui` : Use this symbol to receive notification that the patch's GUI should be opened or closed. The value will be either 1 or 0.
|
||||||
|
* `rvstprognumber`: Use this symbol to receive program number changes from host.
|
||||||
|
* `rvstprogname`: Use this symbol to receive program name changes from host.
|
||||||
|
* `rvstplugname`: Use this symbol to receive plug & instance name from host
|
||||||
|
* `vstTimeInfo`: (play head information support) :
|
||||||
|
|
||||||
|
`vstTimeInfo.ppqPos`, `vstTimeInfo.tempo`, `vstTimeInfo.timeSigNumerator`, `vstTimeInfo.timeSigDenominator`, `vstTimeInfo.flags` are experimental receivers for getting time infos from host. Names should change in the future.
|
||||||
|
|
||||||
|
* EXPERIMENTAL
|
||||||
|
`guiName` : use this symbol to send and signal to the host the name of the gui-extra window to embed (see Pd_Gain(gui) example).
|
||||||
|
|
||||||
|
Note: for most VST hosts, parameters for VST instruments are recorded as sysex data, so be
|
||||||
|
sure to disable any MIDI message filtering in the VST host.
|
||||||
|
|
||||||
|
#CURRENT FEATURES
|
||||||
|
|
||||||
|
* Windows x32 and x64 only
|
||||||
|
* Support for embedding external gui window into host
|
||||||
|
* multichannel audio in/out support
|
||||||
|
* integrated vst midi-in, experimental midi-out
|
||||||
|
* added play head information support (see examples)
|
||||||
|
|
||||||
|
#TODO
|
||||||
|
|
||||||
|
* optimize plugin loading
|
||||||
|
* use of chunks for preset saving
|
||||||
78
build/Release32/Pd_Chunks-test/Pd_Chunks-test.pd
Normal file
78
build/Release32/Pd_Chunks-test/Pd_Chunks-test.pd
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
#N canvas 19 118 947 544 12;
|
||||||
|
#X obj 78 87 adc~, f 6;
|
||||||
|
#X obj 73 241 loadbang;
|
||||||
|
#X msg 73 271 \; pd dsp 1 \;;
|
||||||
|
#X obj 77 162 dac~, f 6;
|
||||||
|
#X msg 142 52 \$1 30;
|
||||||
|
#X obj 142 87 line~;
|
||||||
|
#X obj 122 127 *~;
|
||||||
|
#X obj 78 127 *~;
|
||||||
|
#X obj 142 11 r gain;
|
||||||
|
#X obj 242 8 r rvstparameter0;
|
||||||
|
#X obj 239 279 * 100;
|
||||||
|
#X obj 239 307 dbtorms;
|
||||||
|
#X obj 239 334 s gain;
|
||||||
|
#X obj 297 269 s svstparameter0;
|
||||||
|
#X obj 242 72 vsl 50 128 0 1 0 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1;
|
||||||
|
#X msg 242 39 set \$1;
|
||||||
|
#X text 320 114 range is 0..1;
|
||||||
|
#X obj 64 393 r rvstplugname;
|
||||||
|
#X symbolatom 64 425 26 0 0 0 - - - 0;
|
||||||
|
#X obj 478 447 r rvstdata;
|
||||||
|
#X obj 476 356 s svstdata;
|
||||||
|
#X obj 478 479 print;
|
||||||
|
#X symbolatom 673 132 26 0 0 0 - - - 0;
|
||||||
|
#X obj 673 100 r rvstprogname;
|
||||||
|
#X obj 503 100 r rvstprognumber;
|
||||||
|
#X floatatom 503 124 5 0 0 0 - - - 0;
|
||||||
|
#X msg 476 324 hello world 1.2;
|
||||||
|
#N canvas 182 182 450 300 additionally 0;
|
||||||
|
#X msg 121 99 12 34 56 hello;
|
||||||
|
#X msg 150 136 0.2 0.4 0.78 foo;
|
||||||
|
#X msg 190 179 0.2 0.4 0.78 bar;
|
||||||
|
#X msg 211 208 0.7 0.5 10 something;
|
||||||
|
#X obj 117 49 sel 0 1 2 3;
|
||||||
|
#X obj 136 250 list;
|
||||||
|
#X obj 136 274 outlet;
|
||||||
|
#X obj 117 15 inlet;
|
||||||
|
#X connect 0 0 5 0;
|
||||||
|
#X connect 1 0 5 0;
|
||||||
|
#X connect 2 0 5 0;
|
||||||
|
#X connect 3 0 5 0;
|
||||||
|
#X connect 4 0 0 0;
|
||||||
|
#X connect 4 1 1 0;
|
||||||
|
#X connect 4 2 2 0;
|
||||||
|
#X connect 4 3 3 0;
|
||||||
|
#X connect 5 0 6 0;
|
||||||
|
#X connect 7 0 4 0;
|
||||||
|
#X restore 503 154 pd additionally;
|
||||||
|
#X listbox 503 182 23 0 0 0 - - - 0;
|
||||||
|
#X text 466 223 Experimental. Not all hosts supports it correctly. See the .pdv file. This only works if PROGRAMSARECHUNKS = TRUE is set., f 50;
|
||||||
|
#X obj 242 213 t f f;
|
||||||
|
#X text 464 273 1 all vstparameters are tracked and additionally you can send some Pd list to the host's data chunk;
|
||||||
|
#X text 463 383 2 from the host save your current session (or to a file as .fxp or .fxb);
|
||||||
|
#X text 462 417 3 from the host open your session (or the file you saved);
|
||||||
|
#X text 500 11 When the host chamges the program these 2 are updated. Additionally you can use this to set lots of parameters that are not exposed to the host. The program used is stored and recalled in the host/DAW project., f 52;
|
||||||
|
#X connect 0 0 7 0;
|
||||||
|
#X connect 0 1 6 0;
|
||||||
|
#X connect 1 0 2 0;
|
||||||
|
#X connect 4 0 5 0;
|
||||||
|
#X connect 5 0 6 1;
|
||||||
|
#X connect 5 0 7 1;
|
||||||
|
#X connect 6 0 3 1;
|
||||||
|
#X connect 7 0 3 0;
|
||||||
|
#X connect 8 0 4 0;
|
||||||
|
#X connect 9 0 15 0;
|
||||||
|
#X connect 10 0 11 0;
|
||||||
|
#X connect 11 0 12 0;
|
||||||
|
#X connect 14 0 30 0;
|
||||||
|
#X connect 15 0 14 0;
|
||||||
|
#X connect 17 0 18 0;
|
||||||
|
#X connect 19 0 21 0;
|
||||||
|
#X connect 23 0 22 0;
|
||||||
|
#X connect 24 0 25 0;
|
||||||
|
#X connect 25 0 27 0;
|
||||||
|
#X connect 26 0 20 0;
|
||||||
|
#X connect 27 0 28 0;
|
||||||
|
#X connect 30 0 10 0;
|
||||||
|
#X connect 30 1 13 0;
|
||||||
57
build/Release32/Pd_Chunks-test/Pd_Chunks-test.pdv
Normal file
57
build/Release32/Pd_Chunks-test/Pd_Chunks-test.pdv
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# Number of audio input and output channels
|
||||||
|
CHANNELS = 2
|
||||||
|
|
||||||
|
# installation directory of puredata (optional)
|
||||||
|
# If non specified, will search in <host_exec_dir>\pdvst\pd\
|
||||||
|
# then in <vst_dir>\.pd\
|
||||||
|
#PDPATH = D:\Programs\pd-0.48-1-test\
|
||||||
|
|
||||||
|
# Main Pd patch of the plugin
|
||||||
|
MAIN = Pd_Chunks-test.pd
|
||||||
|
|
||||||
|
# Unique four character VST plugin ID
|
||||||
|
ID = pdch
|
||||||
|
|
||||||
|
# Whether this is a VSTi
|
||||||
|
SYNTH = FALSE
|
||||||
|
|
||||||
|
# Whether there is a custom GUI (e.g. GrIPD)
|
||||||
|
CUSTOMGUI = FALSE
|
||||||
|
|
||||||
|
# Display Pd GUI or not
|
||||||
|
DEBUG = TRUE
|
||||||
|
|
||||||
|
# External libraries (comma delimited list, relative to pdvst/)
|
||||||
|
# ***OBSOLETE, use [declare] inside patch instead***
|
||||||
|
#LIB =
|
||||||
|
|
||||||
|
# All vst parameters are saved in the host session and additionally
|
||||||
|
# you can set/get some "Pd list" in the session or to a .fxp/.fxb file
|
||||||
|
# via [s svstdata] and [r rvstdata]
|
||||||
|
PROGRAMSARECHUNKS = TRUE
|
||||||
|
|
||||||
|
# Number of VST parameters (up to 128)
|
||||||
|
PARAMETERS = 1
|
||||||
|
|
||||||
|
# Name of first VST parameter
|
||||||
|
# used when CUSTOMGUI is false or VST host doesn't support custom editors
|
||||||
|
NAMEPARAMETER0 = Level
|
||||||
|
|
||||||
|
# Define a program (up to 128)
|
||||||
|
PROGRAM = Full Blast
|
||||||
|
|
||||||
|
# Set first parameter value for this program
|
||||||
|
PARAMETER0 = 1.0
|
||||||
|
|
||||||
|
#another program
|
||||||
|
PROGRAM = Muted
|
||||||
|
|
||||||
|
PARAMETER0 = 0.0
|
||||||
|
|
||||||
|
#another program
|
||||||
|
PROGRAM = -6dB
|
||||||
|
|
||||||
|
PARAMETER0 = 0.5
|
||||||
|
|
||||||
|
#another program
|
||||||
|
PROGRAM = test empty param
|
||||||
78
build/Release64/Pd_Chunks-test/Pd_Chunks-test.pd
Normal file
78
build/Release64/Pd_Chunks-test/Pd_Chunks-test.pd
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
#N canvas 19 118 947 544 12;
|
||||||
|
#X obj 78 87 adc~, f 6;
|
||||||
|
#X obj 73 241 loadbang;
|
||||||
|
#X msg 73 271 \; pd dsp 1 \;;
|
||||||
|
#X obj 77 162 dac~, f 6;
|
||||||
|
#X msg 142 52 \$1 30;
|
||||||
|
#X obj 142 87 line~;
|
||||||
|
#X obj 122 127 *~;
|
||||||
|
#X obj 78 127 *~;
|
||||||
|
#X obj 142 11 r gain;
|
||||||
|
#X obj 242 8 r rvstparameter0;
|
||||||
|
#X obj 239 279 * 100;
|
||||||
|
#X obj 239 307 dbtorms;
|
||||||
|
#X obj 239 334 s gain;
|
||||||
|
#X obj 297 269 s svstparameter0;
|
||||||
|
#X obj 242 72 vsl 50 128 0 1 0 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1;
|
||||||
|
#X msg 242 39 set \$1;
|
||||||
|
#X text 320 114 range is 0..1;
|
||||||
|
#X obj 64 393 r rvstplugname;
|
||||||
|
#X symbolatom 64 425 26 0 0 0 - - - 0;
|
||||||
|
#X obj 478 447 r rvstdata;
|
||||||
|
#X obj 476 356 s svstdata;
|
||||||
|
#X obj 478 479 print;
|
||||||
|
#X symbolatom 673 132 26 0 0 0 - - - 0;
|
||||||
|
#X obj 673 100 r rvstprogname;
|
||||||
|
#X obj 503 100 r rvstprognumber;
|
||||||
|
#X floatatom 503 124 5 0 0 0 - - - 0;
|
||||||
|
#X msg 476 324 hello world 1.2;
|
||||||
|
#N canvas 182 182 450 300 additionally 0;
|
||||||
|
#X msg 121 99 12 34 56 hello;
|
||||||
|
#X msg 150 136 0.2 0.4 0.78 foo;
|
||||||
|
#X msg 190 179 0.2 0.4 0.78 bar;
|
||||||
|
#X msg 211 208 0.7 0.5 10 something;
|
||||||
|
#X obj 117 49 sel 0 1 2 3;
|
||||||
|
#X obj 136 250 list;
|
||||||
|
#X obj 136 274 outlet;
|
||||||
|
#X obj 117 15 inlet;
|
||||||
|
#X connect 0 0 5 0;
|
||||||
|
#X connect 1 0 5 0;
|
||||||
|
#X connect 2 0 5 0;
|
||||||
|
#X connect 3 0 5 0;
|
||||||
|
#X connect 4 0 0 0;
|
||||||
|
#X connect 4 1 1 0;
|
||||||
|
#X connect 4 2 2 0;
|
||||||
|
#X connect 4 3 3 0;
|
||||||
|
#X connect 5 0 6 0;
|
||||||
|
#X connect 7 0 4 0;
|
||||||
|
#X restore 503 154 pd additionally;
|
||||||
|
#X listbox 503 182 23 0 0 0 - - - 0;
|
||||||
|
#X text 466 223 Experimental. Not all hosts supports it correctly. See the .pdv file. This only works if PROGRAMSARECHUNKS = TRUE is set., f 50;
|
||||||
|
#X obj 242 213 t f f;
|
||||||
|
#X text 464 273 1 all vstparameters are tracked and additionally you can send some Pd list to the host's data chunk;
|
||||||
|
#X text 463 383 2 from the host save your current session (or to a file as .fxp or .fxb);
|
||||||
|
#X text 462 417 3 from the host open your session (or the file you saved);
|
||||||
|
#X text 500 11 When the host chamges the program these 2 are updated. Additionally you can use this to set lots of parameters that are not exposed to the host. The program used is stored and recalled in the host/DAW project., f 52;
|
||||||
|
#X connect 0 0 7 0;
|
||||||
|
#X connect 0 1 6 0;
|
||||||
|
#X connect 1 0 2 0;
|
||||||
|
#X connect 4 0 5 0;
|
||||||
|
#X connect 5 0 6 1;
|
||||||
|
#X connect 5 0 7 1;
|
||||||
|
#X connect 6 0 3 1;
|
||||||
|
#X connect 7 0 3 0;
|
||||||
|
#X connect 8 0 4 0;
|
||||||
|
#X connect 9 0 15 0;
|
||||||
|
#X connect 10 0 11 0;
|
||||||
|
#X connect 11 0 12 0;
|
||||||
|
#X connect 14 0 30 0;
|
||||||
|
#X connect 15 0 14 0;
|
||||||
|
#X connect 17 0 18 0;
|
||||||
|
#X connect 19 0 21 0;
|
||||||
|
#X connect 23 0 22 0;
|
||||||
|
#X connect 24 0 25 0;
|
||||||
|
#X connect 25 0 27 0;
|
||||||
|
#X connect 26 0 20 0;
|
||||||
|
#X connect 27 0 28 0;
|
||||||
|
#X connect 30 0 10 0;
|
||||||
|
#X connect 30 1 13 0;
|
||||||
57
build/Release64/Pd_Chunks-test/Pd_Chunks-test.pdv
Normal file
57
build/Release64/Pd_Chunks-test/Pd_Chunks-test.pdv
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# Number of audio input and output channels
|
||||||
|
CHANNELS = 2
|
||||||
|
|
||||||
|
# installation directory of puredata (optional)
|
||||||
|
# If non specified, will search in <host_exec_dir>\pdvst\pd\
|
||||||
|
# then in <vst_dir>\.pd\
|
||||||
|
#PDPATH = D:\Programs\pd-0.48-1-test\
|
||||||
|
|
||||||
|
# Main Pd patch of the plugin
|
||||||
|
MAIN = Pd_Chunks-test.pd
|
||||||
|
|
||||||
|
# Unique four character VST plugin ID
|
||||||
|
ID = pdch
|
||||||
|
|
||||||
|
# Whether this is a VSTi
|
||||||
|
SYNTH = FALSE
|
||||||
|
|
||||||
|
# Whether there is a custom GUI (e.g. GrIPD)
|
||||||
|
CUSTOMGUI = FALSE
|
||||||
|
|
||||||
|
# Display Pd GUI or not
|
||||||
|
DEBUG = TRUE
|
||||||
|
|
||||||
|
# External libraries (comma delimited list, relative to pdvst/)
|
||||||
|
# ***OBSOLETE, use [declare] inside patch instead***
|
||||||
|
#LIB =
|
||||||
|
|
||||||
|
# All vst parameters are saved in the host session and additionally
|
||||||
|
# you can set/get some "Pd list" in the session or to a .fxp/.fxb file
|
||||||
|
# via [s svstdata] and [r rvstdata]
|
||||||
|
PROGRAMSARECHUNKS = TRUE
|
||||||
|
|
||||||
|
# Number of VST parameters (up to 128)
|
||||||
|
PARAMETERS = 1
|
||||||
|
|
||||||
|
# Name of first VST parameter
|
||||||
|
# used when CUSTOMGUI is false or VST host doesn't support custom editors
|
||||||
|
NAMEPARAMETER0 = Level
|
||||||
|
|
||||||
|
# Define a program (up to 128)
|
||||||
|
PROGRAM = Full Blast
|
||||||
|
|
||||||
|
# Set first parameter value for this program
|
||||||
|
PARAMETER0 = 1.0
|
||||||
|
|
||||||
|
#another program
|
||||||
|
PROGRAM = Muted
|
||||||
|
|
||||||
|
PARAMETER0 = 0.0
|
||||||
|
|
||||||
|
#another program
|
||||||
|
PROGRAM = -6dB
|
||||||
|
|
||||||
|
PARAMETER0 = 0.5
|
||||||
|
|
||||||
|
#another program
|
||||||
|
PROGRAM = test empty param
|
||||||
@@ -23,7 +23,7 @@ DEBUG = FALSE
|
|||||||
|
|
||||||
# External libraries (comma delimited list, relative to pdvst/)
|
# External libraries (comma delimited list, relative to pdvst/)
|
||||||
# ***OBSOLETE, use [declare] inside patch instead***
|
# ***OBSOLETE, use [declare] inside patch instead***
|
||||||
#LIB =
|
#LIB =
|
||||||
|
|
||||||
# Number of VST parameters (up to 128)
|
# Number of VST parameters (up to 128)
|
||||||
PARAMETERS = 1
|
PARAMETERS = 1
|
||||||
|
|||||||
@@ -17,5 +17,6 @@ ALL: vstschedlib.c
|
|||||||
gcc -Wall -I$(PDDIR)src -I../vst-template vstschedlib.c -static-libgcc \
|
gcc -Wall -I$(PDDIR)src -I../vst-template vstschedlib.c -static-libgcc \
|
||||||
-shared -L$(PDDIR)bin -l:pd.dll -o vstschedlib.dll
|
-shared -L$(PDDIR)bin -l:pd.dll -o vstschedlib.dll
|
||||||
strip vstschedlib.dll
|
strip vstschedlib.dll
|
||||||
cp vstschedlib.dll ../build/pd-scheduler$(arch)/vstschedlib.dll
|
#cp vstschedlib.dll ../build/pd-scheduler$(arch)/vstschedlib.dll
|
||||||
#cp vstschedlib.dll ../build/Release$(arch)/.pd/bin/vstschedlib.dll
|
#cp vstschedlib.dll ../build/Release$(arch)/.pd/bin/vstschedlib.dll
|
||||||
|
cp vstschedlib.dll ../build/Release$(arch)/vstschedlib.dll
|
||||||
@@ -70,10 +70,20 @@ typedef struct _vstGuiNameReceiver
|
|||||||
|
|
||||||
t_vstGuiNameReceiver *vstGuiNameReceiver;
|
t_vstGuiNameReceiver *vstGuiNameReceiver;
|
||||||
|
|
||||||
|
typedef struct _vstChunkReceiver
|
||||||
|
{
|
||||||
|
t_object x_obj;
|
||||||
|
}t_vstChunkReceiver;
|
||||||
|
|
||||||
|
t_vstChunkReceiver *vstChunkReceiver;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
t_vstParameterReceiver *vstParameterReceivers[MAXPARAMETERS];
|
t_vstParameterReceiver *vstParameterReceivers[MAXPARAMETERS];
|
||||||
|
|
||||||
t_class *vstParameterReceiver_class;
|
t_class *vstParameterReceiver_class;
|
||||||
t_class *vstGuiNameReceiver_class;
|
t_class *vstGuiNameReceiver_class;
|
||||||
|
t_class *vstChunkReceiver_class;
|
||||||
|
|
||||||
char *pdvstTransferMutexName,
|
char *pdvstTransferMutexName,
|
||||||
*pdvstTransferFileMapName,
|
*pdvstTransferFileMapName,
|
||||||
@@ -195,6 +205,54 @@ int setPdvstPlugName(char* instanceName)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*receive data chunk from host*/
|
||||||
|
int setPdvstChunk(const char *amsg)
|
||||||
|
{
|
||||||
|
t_symbol *tempSym;
|
||||||
|
tempSym = gensym("rvstdata");
|
||||||
|
|
||||||
|
if (tempSym->s_thing)
|
||||||
|
{
|
||||||
|
size_t len = strlen(amsg);
|
||||||
|
t_binbuf* bbuf = binbuf_new();
|
||||||
|
binbuf_text(bbuf, amsg, len);
|
||||||
|
|
||||||
|
int msg, natom = binbuf_getnatom(bbuf);
|
||||||
|
t_atom *at = binbuf_getvec(bbuf);
|
||||||
|
|
||||||
|
for (msg = 0; msg < natom;) {
|
||||||
|
int emsg;
|
||||||
|
for (emsg = msg; emsg < natom && at[emsg].a_type != A_COMMA
|
||||||
|
&& at[emsg].a_type != A_SEMI; emsg++);
|
||||||
|
if (emsg > msg) {
|
||||||
|
int i;
|
||||||
|
/* check for illegal atoms */
|
||||||
|
for (i = msg; i < emsg; i++)
|
||||||
|
if (at[i].a_type == A_DOLLAR || at[i].a_type == A_DOLLSYM) {
|
||||||
|
pd_error(NULL, "rvstdata: got dollar sign in message");
|
||||||
|
goto nodice;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (at[msg].a_type == A_FLOAT) {
|
||||||
|
if (emsg > msg + 1)
|
||||||
|
pd_list(tempSym->s_thing, 0, emsg-msg, at + msg);
|
||||||
|
else pd_float(tempSym->s_thing, at[msg].a_w.w_float);
|
||||||
|
}
|
||||||
|
else if (at[msg].a_type == A_SYMBOL) {
|
||||||
|
pd_anything(tempSym->s_thing, at[msg].a_w.w_symbol, emsg-msg-1, at + msg + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nodice:
|
||||||
|
msg = emsg + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
binbuf_free(bbuf);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int setPdvstFloatParameter(int index, float value)
|
int setPdvstFloatParameter(int index, float value)
|
||||||
{
|
{
|
||||||
@@ -227,6 +285,32 @@ void sendPdVstFloatParameter(t_vstParameterReceiver *x, t_float floatValue)
|
|||||||
ReleaseMutex(pdvstTransferMutex);
|
ReleaseMutex(pdvstTransferMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*send data chunk to host*/
|
||||||
|
void sendPdVstChunk(t_vstChunkReceiver *x, t_symbol *s, int argc, t_atom *argv)
|
||||||
|
{
|
||||||
|
char *buf;
|
||||||
|
int length;
|
||||||
|
t_atom at;
|
||||||
|
t_binbuf*bbuf = binbuf_new();
|
||||||
|
|
||||||
|
SETSYMBOL(&at, s);
|
||||||
|
binbuf_add(bbuf, 1, &at);
|
||||||
|
binbuf_add(bbuf, argc, argv);
|
||||||
|
binbuf_gettext(bbuf, &buf, &length);
|
||||||
|
binbuf_free(bbuf);
|
||||||
|
|
||||||
|
WaitForSingleObject(pdvstTransferMutex, INFINITE);
|
||||||
|
memset(&pdvstData->datachunk.value.stringData, '\0', MAXSTRINGSIZE);
|
||||||
|
pdvstData->datachunk.type = STRING_TYPE;
|
||||||
|
pdvstData->datachunk.direction = PD_SEND;
|
||||||
|
pdvstData->datachunk.updated = 1;
|
||||||
|
//strcpy(pdvstData->datachunk.value.stringData,buf);
|
||||||
|
memcpy(pdvstData->datachunk.value.stringData, buf, length);
|
||||||
|
ReleaseMutex(pdvstTransferMutex);
|
||||||
|
|
||||||
|
freebytes(buf, length+1);
|
||||||
|
}
|
||||||
|
|
||||||
void sendPdVstGuiName(t_vstGuiNameReceiver *x, t_symbol *symbolValue)
|
void sendPdVstGuiName(t_vstGuiNameReceiver *x, t_symbol *symbolValue)
|
||||||
{
|
{
|
||||||
WaitForSingleObject(pdvstTransferMutex, INFINITE);
|
WaitForSingleObject(pdvstTransferMutex, INFINITE);
|
||||||
@@ -234,9 +318,7 @@ void sendPdVstGuiName(t_vstGuiNameReceiver *x, t_symbol *symbolValue)
|
|||||||
pdvstData->guiName.direction = PD_SEND;
|
pdvstData->guiName.direction = PD_SEND;
|
||||||
pdvstData->guiName.updated = 1;
|
pdvstData->guiName.updated = 1;
|
||||||
strcpy(pdvstData->guiName.value.stringData,symbolValue->s_name);
|
strcpy(pdvstData->guiName.value.stringData,symbolValue->s_name);
|
||||||
|
|
||||||
ReleaseMutex(pdvstTransferMutex);
|
ReleaseMutex(pdvstTransferMutex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void makePdvstParameterReceivers()
|
void makePdvstParameterReceivers()
|
||||||
@@ -251,16 +333,20 @@ void makePdvstParameterReceivers()
|
|||||||
vstParameterReceivers[i]->x_sym = gensym(string);
|
vstParameterReceivers[i]->x_sym = gensym(string);
|
||||||
pd_bind(&vstParameterReceivers[i]->x_obj.ob_pd, gensym(string));
|
pd_bind(&vstParameterReceivers[i]->x_obj.ob_pd, gensym(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void makePdvstGuiNameReceiver()
|
void makePdvstGuiNameReceiver()
|
||||||
{
|
{
|
||||||
vstGuiNameReceiver = (t_vstGuiNameReceiver *)pd_new(vstGuiNameReceiver_class);
|
vstGuiNameReceiver = (t_vstGuiNameReceiver *)pd_new(vstGuiNameReceiver_class);
|
||||||
pd_bind(&vstGuiNameReceiver->x_obj.ob_pd, gensym("guiName"));
|
pd_bind(&vstGuiNameReceiver->x_obj.ob_pd, gensym("guiName"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void makevstChunkReceiver()
|
||||||
|
{
|
||||||
|
vstChunkReceiver = (t_vstChunkReceiver *)pd_new(vstChunkReceiver_class);
|
||||||
|
pd_bind(&vstChunkReceiver->x_obj.ob_pd, gensym("svstdata"));
|
||||||
|
}
|
||||||
|
|
||||||
void send_dacs(void)
|
void send_dacs(void)
|
||||||
{
|
{
|
||||||
@@ -331,7 +417,20 @@ int scheduler()
|
|||||||
|
|
||||||
class_addfloat(vstParameterReceiver_class, (t_method)sendPdVstFloatParameter);
|
class_addfloat(vstParameterReceiver_class, (t_method)sendPdVstFloatParameter);
|
||||||
makePdvstParameterReceivers();
|
makePdvstParameterReceivers();
|
||||||
|
|
||||||
|
|
||||||
|
vstChunkReceiver_class = class_new(gensym("vstChunkReceiver"),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
sizeof(t_vstChunkReceiver),
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
|
||||||
|
class_addanything(vstChunkReceiver_class,(t_method)sendPdVstChunk);
|
||||||
|
makevstChunkReceiver();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vstGuiNameReceiver_class = class_new(gensym("vstGuiNameReceiver"),
|
vstGuiNameReceiver_class = class_new(gensym("vstGuiNameReceiver"),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@@ -390,7 +489,38 @@ int scheduler()
|
|||||||
if (setPdvstPlugName((char*)pdvstData->plugName.value.stringData))
|
if (setPdvstPlugName((char*)pdvstData->plugName.value.stringData))
|
||||||
pdvstData->plugName.updated=0;
|
pdvstData->plugName.updated=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for data chunk from file
|
||||||
|
if (pdvstData->datachunk.direction == PD_RECEIVE && \
|
||||||
|
pdvstData->datachunk.updated)
|
||||||
|
{
|
||||||
|
if (setPdvstChunk((char*)pdvstData->datachunk.value.stringData))
|
||||||
|
pdvstData->datachunk.updated=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for vst program name changed
|
||||||
|
if (pdvstData->prognumber2pd.direction == PD_RECEIVE && \
|
||||||
|
pdvstData->prognumber2pd.updated)
|
||||||
|
{
|
||||||
|
t_symbol *tempSym;
|
||||||
|
tempSym = gensym("rvstprognumber");
|
||||||
|
if (tempSym->s_thing)
|
||||||
|
pd_float(tempSym->s_thing, (t_float)pdvstData->prognumber2pd.value.floatData);
|
||||||
|
pdvstData->prognumber2pd.updated=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for vst program number changed
|
||||||
|
if (pdvstData->progname2pd.direction == PD_RECEIVE && \
|
||||||
|
pdvstData->progname2pd.updated)
|
||||||
|
{
|
||||||
|
t_symbol *tempSym;
|
||||||
|
tempSym = gensym("rvstprogname");
|
||||||
|
if (tempSym->s_thing)
|
||||||
|
pd_symbol(tempSym->s_thing, \
|
||||||
|
gensym(pdvstData->progname2pd.value.stringData));
|
||||||
|
pdvstData->progname2pd.updated=0;
|
||||||
|
}
|
||||||
|
|
||||||
if (pdvstData->hostTimeInfo.updated)
|
if (pdvstData->hostTimeInfo.updated)
|
||||||
{
|
{
|
||||||
pdvstData->hostTimeInfo.updated=0;
|
pdvstData->hostTimeInfo.updated=0;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ ALL: $(SOURCES)
|
|||||||
cp pdvst-template.dll ../build/Release$(arch)/Pd_Gain-gui.dll
|
cp pdvst-template.dll ../build/Release$(arch)/Pd_Gain-gui.dll
|
||||||
cp pdvst-template.dll ../build/Release$(arch)/Pd_Gain-nogui.dll
|
cp pdvst-template.dll ../build/Release$(arch)/Pd_Gain-nogui.dll
|
||||||
cp pdvst-template.dll ../build/Release$(arch)/Pd_Midi.dll
|
cp pdvst-template.dll ../build/Release$(arch)/Pd_Midi.dll
|
||||||
|
cp pdvst-template.dll ../build/Release$(arch)/Pd_Chunks-test.dll
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ extern char globalHostPdvstPath[MAXFILENAMELEN];
|
|||||||
extern bool globalCustomGui;
|
extern bool globalCustomGui;
|
||||||
extern int globalCustomGuiWidth;
|
extern int globalCustomGuiWidth;
|
||||||
extern int globalCustomGuiHeight;
|
extern int globalCustomGuiHeight;
|
||||||
|
extern bool globalProgramsAreChunks;
|
||||||
|
|
||||||
extern bool globalIsASynth;
|
extern bool globalIsASynth;
|
||||||
extern pdvstProgram globalProgram[MAXPROGRAMS];
|
extern pdvstProgram globalProgram[MAXPROGRAMS];
|
||||||
@@ -226,6 +227,8 @@ pdvst::pdvst(audioMasterCallback audioMaster)
|
|||||||
// {JYG see pdvst::setProgram below for explanation
|
// {JYG see pdvst::setProgram below for explanation
|
||||||
timeFromStartup=GetTickCount();
|
timeFromStartup=GetTickCount();
|
||||||
// JYG }
|
// JYG }
|
||||||
|
programsAreChunks(globalProgramsAreChunks);
|
||||||
|
sendPlugName(globalPluginName);
|
||||||
}
|
}
|
||||||
|
|
||||||
pdvst::~pdvst()
|
pdvst::~pdvst()
|
||||||
@@ -490,6 +493,25 @@ void pdvst::resume()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pdvst::sendProgChange(VstInt32 prgm)
|
||||||
|
{
|
||||||
|
|
||||||
|
WaitForSingleObject(pdvstTransferMutex, 10);
|
||||||
|
{
|
||||||
|
pdvstData->prognumber2pd.direction = PD_RECEIVE;
|
||||||
|
pdvstData->prognumber2pd.type = FLOAT_TYPE;
|
||||||
|
pdvstData->prognumber2pd.value.floatData = (float)prgm;
|
||||||
|
pdvstData->prognumber2pd.updated = 1;
|
||||||
|
|
||||||
|
pdvstData->progname2pd.direction = PD_RECEIVE;
|
||||||
|
pdvstData->progname2pd.type = STRING_TYPE;
|
||||||
|
strcpy(pdvstData->progname2pd.value.stringData, program[prgm].name);
|
||||||
|
pdvstData->progname2pd.updated = 1;
|
||||||
|
|
||||||
|
ReleaseMutex(pdvstTransferMutex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void pdvst::setProgram(VstInt32 prgmNum)
|
void pdvst::setProgram(VstInt32 prgmNum)
|
||||||
{
|
{
|
||||||
debugLog("appel de setProgram %d", prgmNum);
|
debugLog("appel de setProgram %d", prgmNum);
|
||||||
@@ -497,6 +519,7 @@ void pdvst::setProgram(VstInt32 prgmNum)
|
|||||||
if (prgmNum >= 0 && prgmNum < nPrograms)
|
if (prgmNum >= 0 && prgmNum < nPrograms)
|
||||||
{
|
{
|
||||||
curProgram = prgmNum;
|
curProgram = prgmNum;
|
||||||
|
sendProgChange(prgmNum);
|
||||||
|
|
||||||
|
|
||||||
// {JYG to prevent host call of setProgram to override current param settings
|
// {JYG to prevent host call of setProgram to override current param settings
|
||||||
@@ -600,6 +623,59 @@ bool pdvst::getOutputProperties(VstInt32 index, VstPinProperties* properties)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VstInt32 pdvst::getChunk (void** data, bool isPreset)
|
||||||
|
{
|
||||||
|
|
||||||
|
Chunk = new pdvstProgramAreChunks;
|
||||||
|
//MessageBoxA(NULL, "getchunk call", "debug", MB_OK); // all host gets here
|
||||||
|
for (int i = 0; i < nParameters; i++)
|
||||||
|
{
|
||||||
|
Chunk->vstParam[i] = vstParam[i];
|
||||||
|
}
|
||||||
|
//MessageBoxA(NULL, "getchunk if data", "debug", MB_OK); // not all hosts gets here
|
||||||
|
WaitForSingleObject(pdvstTransferMutex, 10);
|
||||||
|
{
|
||||||
|
memset(&Chunk->Data, '\0', MAXSTRLEN);
|
||||||
|
strcpy (Chunk->Data, pdvstData->datachunk.value.stringData);
|
||||||
|
ReleaseMutex(pdvstTransferMutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
debugLog("luc:debug-size-of-chunk %d", sizeof(*Chunk));
|
||||||
|
*data = (void*)Chunk;
|
||||||
|
return sizeof(*Chunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
VstInt32 pdvst::setChunk (void* data, VstInt32 byteSize, bool isPreset)
|
||||||
|
{
|
||||||
|
//MessageBoxA(NULL, "setchunk call", "debug", MB_OK);
|
||||||
|
if(byteSize)
|
||||||
|
{
|
||||||
|
Chunk = (pdvstProgramAreChunks*)data;
|
||||||
|
//MessageBoxA(NULL, "setchunk call if bytesize", "debug", MB_OK);
|
||||||
|
WaitForSingleObject(pdvstTransferMutex, 10);
|
||||||
|
{
|
||||||
|
pdvstData->datachunk.direction = PD_RECEIVE;
|
||||||
|
pdvstData->datachunk.type = STRING_TYPE;
|
||||||
|
memset(&pdvstData->datachunk.value.stringData, '\0', MAXSTRLEN);
|
||||||
|
strcpy(pdvstData->datachunk.value.stringData, Chunk->Data);
|
||||||
|
pdvstData->datachunk.updated = 1;
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < nParameters; i++)
|
||||||
|
{
|
||||||
|
pdvstData->vstParameters[i].type = FLOAT_TYPE;
|
||||||
|
pdvstData->vstParameters[i].value.floatData = Chunk->vstParam[i];
|
||||||
|
pdvstData->vstParameters[i].direction = PD_RECEIVE;
|
||||||
|
pdvstData->vstParameters[i].updated = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReleaseMutex(pdvstTransferMutex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
VstInt32 pdvst::canDo(char* text)
|
VstInt32 pdvst::canDo(char* text)
|
||||||
{
|
{
|
||||||
//if (isASynth)
|
//if (isASynth)
|
||||||
@@ -1088,6 +1164,17 @@ void pdvst::updatePdvstParameters()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// to data chunk
|
||||||
|
|
||||||
|
if (pdvstData->datachunk.direction == PD_SEND && \
|
||||||
|
pdvstData->datachunk.updated)
|
||||||
|
{
|
||||||
|
if (pdvstData->datachunk.type == STRING_TYPE)
|
||||||
|
{
|
||||||
|
pdvstData->datachunk.updated=0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReleaseMutex(pdvstTransferMutex);
|
ReleaseMutex(pdvstTransferMutex);
|
||||||
|
|||||||
@@ -53,6 +53,13 @@ typedef struct _pdvstProgram
|
|||||||
float paramValue[MAXPARAMETERS];
|
float paramValue[MAXPARAMETERS];
|
||||||
} pdvstProgram;
|
} pdvstProgram;
|
||||||
|
|
||||||
|
/* for programsarechunks*/
|
||||||
|
typedef struct _pdvstProgramAreChunks
|
||||||
|
{
|
||||||
|
float vstParam[MAXPARAMETERS];
|
||||||
|
char Data[MAXSTRLEN];
|
||||||
|
} pdvstProgramAreChunks;
|
||||||
|
|
||||||
class pdVstBuffer
|
class pdVstBuffer
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -99,12 +106,16 @@ public:
|
|||||||
// virtual VstInt32 canMono ();
|
// virtual VstInt32 canMono ();
|
||||||
virtual void suspend();
|
virtual void suspend();
|
||||||
virtual void resume();
|
virtual void resume();
|
||||||
void sendGuiAction(int action);
|
void sendGuiAction(int action);
|
||||||
void sendPlugName(char * name ); // JYG : to send plug name to puredatapatch
|
void sendPlugName(char * name ); // JYG : to send plug name to puredatapatch
|
||||||
|
void sendProgChange(VstInt32 prgm); // send vst prog name and number to patch
|
||||||
|
|
||||||
LPTSTR displayString;//= new TCHAR[MAXSTRINGSIZE];
|
LPTSTR displayString;//= new TCHAR[MAXSTRINGSIZE];
|
||||||
|
|
||||||
HWND pdGui;
|
HWND pdGui;
|
||||||
|
|
||||||
|
virtual VstInt32 getChunk (void** data, bool isPreset);
|
||||||
|
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static int referenceCount;
|
static int referenceCount;
|
||||||
@@ -124,6 +135,7 @@ protected:
|
|||||||
char **vstParamName;
|
char **vstParamName;
|
||||||
int nParameters;
|
int nParameters;
|
||||||
pdvstProgram *program;
|
pdvstProgram *program;
|
||||||
|
pdvstProgramAreChunks *Chunk;
|
||||||
int nPrograms;
|
int nPrograms;
|
||||||
int nChannels;
|
int nChannels;
|
||||||
int nExternalLibs;
|
int nExternalLibs;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ bool globalCustomGui = false;
|
|||||||
int globalCustomGuiWidth= 320;
|
int globalCustomGuiWidth= 320;
|
||||||
int globalCustomGuiHeight= 150;
|
int globalCustomGuiHeight= 150;
|
||||||
pdvstProgram globalProgram[MAXPROGRAMS];
|
pdvstProgram globalProgram[MAXPROGRAMS];
|
||||||
|
bool globalProgramsAreChunks = false;
|
||||||
|
|
||||||
char *trimWhitespace(char *str);
|
char *trimWhitespace(char *str);
|
||||||
void parseSetupFile();
|
void parseSetupFile();
|
||||||
@@ -376,6 +377,18 @@ void parseSetupFile()
|
|||||||
globalProgram[progNum].paramValue[paramNum] = \
|
globalProgram[progNum].paramValue[paramNum] = \
|
||||||
(float)atof(value);
|
(float)atof(value);
|
||||||
}
|
}
|
||||||
|
// programsarechunks (save custom data in .fxp or .fxb file)
|
||||||
|
if (strcmp(param, "programsarechunks") == 0)
|
||||||
|
{
|
||||||
|
if (strcmp(strlwr(value), "true") == 0)
|
||||||
|
{
|
||||||
|
globalProgramsAreChunks = true;
|
||||||
|
}
|
||||||
|
else if (strcmp(strlwr(value), "false") == 0)
|
||||||
|
{
|
||||||
|
globalProgramsAreChunks = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ typedef struct _pdvstTransferData
|
|||||||
pdvstMidiMessage midiQueue[MAXMIDIQUEUESIZE];
|
pdvstMidiMessage midiQueue[MAXMIDIQUEUESIZE];
|
||||||
pdvstParameter guiState;
|
pdvstParameter guiState;
|
||||||
pdvstParameter plugName; // transmitted by host
|
pdvstParameter plugName; // transmitted by host
|
||||||
|
pdvstParameter datachunk; // get/set chunk from .fxp .fxb files
|
||||||
|
pdvstParameter progname2pd; // send program name to Pd
|
||||||
|
pdvstParameter prognumber2pd; // send program name to Pd
|
||||||
pdvstParameter guiName; // transmitted by pd : name of gui window to be embedded
|
pdvstParameter guiName; // transmitted by pd : name of gui window to be embedded
|
||||||
// #ifdef VSTMIDIOUTENABLE
|
// #ifdef VSTMIDIOUTENABLE
|
||||||
int midiOutQueueSize;
|
int midiOutQueueSize;
|
||||||
|
|||||||
Reference in New Issue
Block a user