Compare commits
4 Commits
dd4847399c
...
squashchun
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f9fae2822 | |||
| bea578104f | |||
| af7afaf8b2 | |||
| 9f67aa682a |
43
build/Release64/Pd_Chunks-test/Pd_Chunks-test.pd
Normal file
43
build/Release64/Pd_Chunks-test/Pd_Chunks-test.pd
Normal file
@@ -0,0 +1,43 @@
|
||||
#N canvas 0 265 818 358 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 242 235 * 100;
|
||||
#X obj 242 263 dbtorms;
|
||||
#X obj 242 290 s gain;
|
||||
#X obj 300 225 s svstparameter0;
|
||||
#X obj 277 75 vsl 50 128 0 1 0 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1;
|
||||
#X msg 277 42 set \$1;
|
||||
#X text 355 117 range is 0..1;
|
||||
#X obj 498 10 r rvstplugname;
|
||||
#X symbolatom 498 48 17 0 0 0 - - - 0;
|
||||
#X obj 516 102 r rvstdata;
|
||||
#X symbolatom 516 136 17 0 0 0 - - - 0;
|
||||
#X obj 516 265 s svstdata;
|
||||
#X msg 547 216 symbol hello\ world\ 2;
|
||||
#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 10 0;
|
||||
#X connect 9 0 15 0;
|
||||
#X connect 10 0 11 0;
|
||||
#X connect 11 0 12 0;
|
||||
#X connect 14 0 13 0;
|
||||
#X connect 14 0 10 0;
|
||||
#X connect 15 0 14 0;
|
||||
#X connect 17 0 18 0;
|
||||
#X connect 19 0 20 0;
|
||||
#X connect 22 0 21 0;
|
||||
49
build/Release64/Pd_Chunks-test/Pd_Chunks-test.pdv
Normal file
49
build/Release64/Pd_Chunks-test/Pd_Chunks-test.pdv
Normal file
@@ -0,0 +1,49 @@
|
||||
# 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 =
|
||||
|
||||
# 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.94
|
||||
BIN
build/Release64/Pd_Chunks-test/test.fxp
Normal file
BIN
build/Release64/Pd_Chunks-test/test.fxp
Normal file
Binary file not shown.
@@ -17,5 +17,5 @@ ALL: vstschedlib.c
|
||||
gcc -Wall -I$(PDDIR)src -I../vst-template vstschedlib.c -static-libgcc \
|
||||
-shared -L$(PDDIR)bin -l:pd.dll -o vstschedlib.dll
|
||||
strip 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/pd-scheduler$(arch)/vstschedlib.dll
|
||||
cp vstschedlib.dll ../build/Release$(arch)/.pd/bin/vstschedlib.dll
|
||||
@@ -70,10 +70,20 @@ typedef struct _vstGuiNameReceiver
|
||||
|
||||
t_vstGuiNameReceiver *vstGuiNameReceiver;
|
||||
|
||||
typedef struct _vstChunkReceiver
|
||||
{
|
||||
t_object x_obj;
|
||||
}t_vstChunkReceiver;
|
||||
|
||||
t_vstChunkReceiver *vstChunkReceiver;
|
||||
|
||||
|
||||
|
||||
t_vstParameterReceiver *vstParameterReceivers[MAXPARAMETERS];
|
||||
|
||||
t_class *vstParameterReceiver_class;
|
||||
t_class *vstGuiNameReceiver_class;
|
||||
t_class *vstChunkReceiver_class;
|
||||
|
||||
char *pdvstTransferMutexName,
|
||||
*pdvstTransferFileMapName,
|
||||
@@ -195,6 +205,19 @@ int setPdvstPlugName(char* instanceName)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setPdvstChunk(char* instanceName)
|
||||
{
|
||||
t_symbol *tempSym;
|
||||
tempSym = gensym("rvstdata");
|
||||
if (tempSym->s_thing)
|
||||
{
|
||||
pd_symbol(tempSym->s_thing, gensym(instanceName));
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int setPdvstFloatParameter(int index, float value)
|
||||
{
|
||||
@@ -227,6 +250,17 @@ void sendPdVstFloatParameter(t_vstParameterReceiver *x, t_float floatValue)
|
||||
ReleaseMutex(pdvstTransferMutex);
|
||||
}
|
||||
|
||||
void sendPdVstChunk(t_vstChunkReceiver *x, t_symbol *sym)
|
||||
{
|
||||
|
||||
WaitForSingleObject(pdvstTransferMutex, INFINITE);
|
||||
pdvstData->datachunk.type = STRING_TYPE;
|
||||
pdvstData->datachunk.direction = PD_SEND;
|
||||
pdvstData->datachunk.updated = 1;
|
||||
strcpy(pdvstData->datachunk.value.stringData,sym->s_name);
|
||||
ReleaseMutex(pdvstTransferMutex);
|
||||
}
|
||||
|
||||
void sendPdVstGuiName(t_vstGuiNameReceiver *x, t_symbol *symbolValue)
|
||||
{
|
||||
WaitForSingleObject(pdvstTransferMutex, INFINITE);
|
||||
@@ -251,6 +285,7 @@ void makePdvstParameterReceivers()
|
||||
vstParameterReceivers[i]->x_sym = gensym(string);
|
||||
pd_bind(&vstParameterReceivers[i]->x_obj.ob_pd, gensym(string));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void makePdvstGuiNameReceiver()
|
||||
@@ -260,6 +295,15 @@ void makePdvstGuiNameReceiver()
|
||||
|
||||
}
|
||||
|
||||
void makevstChunkReceiver()
|
||||
{
|
||||
vstChunkReceiver = (t_vstChunkReceiver *)pd_new(vstChunkReceiver_class);
|
||||
pd_bind(&vstChunkReceiver->x_obj.ob_pd, gensym("svstdata"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void send_dacs(void)
|
||||
@@ -331,7 +375,20 @@ int scheduler()
|
||||
|
||||
class_addfloat(vstParameterReceiver_class, (t_method)sendPdVstFloatParameter);
|
||||
makePdvstParameterReceivers();
|
||||
|
||||
|
||||
vstChunkReceiver_class = class_new(gensym("vstChunkReceiver"),
|
||||
0,
|
||||
0,
|
||||
sizeof(t_vstChunkReceiver),
|
||||
0,
|
||||
0);
|
||||
|
||||
class_addsymbol(vstChunkReceiver_class,(t_method)sendPdVstChunk);
|
||||
makevstChunkReceiver();
|
||||
|
||||
|
||||
|
||||
vstGuiNameReceiver_class = class_new(gensym("vstGuiNameReceiver"),
|
||||
0,
|
||||
0,
|
||||
@@ -390,6 +447,14 @@ int scheduler()
|
||||
if (setPdvstPlugName((char*)pdvstData->plugName.value.stringData))
|
||||
pdvstData->plugName.updated=0;
|
||||
}
|
||||
|
||||
// lucarda get data chunk from file
|
||||
if (pdvstData->datachunk.direction == PD_RECEIVE && \
|
||||
pdvstData->datachunk.updated)
|
||||
{
|
||||
if (setPdvstChunk((char*)pdvstData->datachunk.value.stringData))
|
||||
pdvstData->datachunk.updated=0;
|
||||
}
|
||||
|
||||
if (pdvstData->hostTimeInfo.updated)
|
||||
{
|
||||
|
||||
@@ -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-nogui.dll
|
||||
cp pdvst-template.dll ../build/Release$(arch)/Pd_Midi.dll
|
||||
cp pdvst-template.dll ../build/Release$(arch)/Pd_Chunks-test.dll
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -226,6 +226,8 @@ pdvst::pdvst(audioMasterCallback audioMaster)
|
||||
// {JYG see pdvst::setProgram below for explanation
|
||||
timeFromStartup=GetTickCount();
|
||||
// JYG }
|
||||
programsAreChunks(true);
|
||||
sendPlugName(globalPluginName);
|
||||
}
|
||||
|
||||
pdvst::~pdvst()
|
||||
@@ -600,6 +602,29 @@ bool pdvst::getOutputProperties(VstInt32 index, VstPinProperties* properties)
|
||||
return false;
|
||||
}
|
||||
|
||||
VstInt32 pdvst::getChunk (void** data, bool isPreset)
|
||||
{
|
||||
MessageBox(0,"getchunk","debug",MB_OK);
|
||||
strcpy ((char *)*data, pdvstData->datachunk.value.stringData);
|
||||
return strlen(pdvstData->datachunk.value.stringData);
|
||||
}
|
||||
|
||||
VstInt32 pdvst::setChunk (void* data, VstInt32 byteSize, bool isPreset)
|
||||
{
|
||||
|
||||
WaitForSingleObject(pdvstTransferMutex, 10);
|
||||
{
|
||||
pdvstData->datachunk.direction = PD_RECEIVE;
|
||||
pdvstData->datachunk.type = STRING_TYPE;
|
||||
strcpy(pdvstData->datachunk.value.stringData,(char *)data);
|
||||
pdvstData->datachunk.updated = 1;
|
||||
ReleaseMutex(pdvstTransferMutex);
|
||||
}
|
||||
MessageBox(0,"setchunk","debug",MB_OK);
|
||||
debugLog("setchunk: %s", data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
VstInt32 pdvst::canDo(char* text)
|
||||
{
|
||||
//if (isASynth)
|
||||
@@ -1088,6 +1113,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);
|
||||
|
||||
@@ -105,6 +105,9 @@ public:
|
||||
LPTSTR displayString;//= new TCHAR[MAXSTRINGSIZE];
|
||||
|
||||
HWND pdGui;
|
||||
|
||||
virtual VstInt32 getChunk (void** data, bool isPreset = false);
|
||||
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset = false);
|
||||
|
||||
protected:
|
||||
static int referenceCount;
|
||||
@@ -170,6 +173,7 @@ protected:
|
||||
|
||||
|
||||
// JYG }
|
||||
//void programsAreChunks (bool) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -121,6 +121,7 @@ typedef struct _pdvstTransferData
|
||||
pdvstMidiMessage midiQueue[MAXMIDIQUEUESIZE];
|
||||
pdvstParameter guiState;
|
||||
pdvstParameter plugName; // transmitted by host
|
||||
pdvstParameter datachunk; // get/set chunk from .fxp file
|
||||
pdvstParameter guiName; // transmitted by pd : name of gui window to be embedded
|
||||
// #ifdef VSTMIDIOUTENABLE
|
||||
int midiOutQueueSize;
|
||||
|
||||
Reference in New Issue
Block a user