setronic
Synthedit regular

Posts: 293
Posts: 293
|
Post by setronic on Feb 15, 2014 12:11:17 GMT 1
layman's questions:
*what does the code/C++ look like for basic logic gates? (in SDK2 ? do i need to specify?)
AND/OR/NOT/NAND/NOR/XOR/XNOR
*how does a GUIBools sem differ from a DSP sem? is there a kind of 'wrapper' for the code of any GUI sem, according to type: Bool/List/Text/Int/Float ? with header/ending etc?
*is there any similarity with the layout of html? headers, subheaders open/close etc. looking for recognisable elements is the first step for anyone looking at C++, i reckon. i don't know what the jargon means yet: 'declare' blablabla, need to get C++ for eejuts.
*what does the autoduplicate pin routine look like? how do you identify left/right output side? (**and many other questions besides**)
|
|
|
Post by Rob on Feb 19, 2014 12:43:06 GMT 1
For example AND ( this is how I would do it based on the truth table ): if ( input1 && input2 == 1 ) { output = 1; } else { output = 0; } linkTruth table: INPUT OUTPUT A B A AND B 0 0 0 0 1 0 1 0 0 1 1 1
|
|
|
Post by Rob on Feb 19, 2014 12:46:23 GMT 1
layman's questions: *how does a GUIBools sem differ from a DSP sem? is there a kind of 'wrapper' for the code of any GUI sem, according to type: Bool/List/Text/Int/Float ? with header/ending etc? - GUI modules don't refresh at samplerate. - Wrapper? No there is none. *is there any similarity with the layout of html? headers, subheaders open/close etc. looking for recognisable elements is the first step for anyone looking at C++, i reckon. i don't know what the jargon means yet: 'declare' blablabla, need to get C++ for eejuts. www.cplusplus.com/doc/tutorial/*what does the autoduplicate pin routine look like? how do you identify left/right output side? (**and many other questions besides**) Link: www.synthedit.com/software-development-kit/documentation-old-version/faq/Auto-Duplicating Pins Some modules like the Switch modules have 'spare' pins that automatically add new pins as you use them. These are called Autoduplicating pins. To make a pin Autoduplicate add flag IO_AUTODUPLICATE. If you want it's name to change when you connect it, use IO_RENAME... case 0: properties->name = "Spare"; properties->direction = DR_IN; properties->datatype = DT_FSAMPLE; properties->flags = IO_AUTODUPLICATE|IO_RENAME; If you want a List plug to reflect the names of the autoduplicating plugs... case 1: properties->name = "Choice"; properties->direction = DR_IN; properties->datatype = DT_ENUM; properties->datatype_extra = "{AUTO}"; break; To access the variables on Autoduplicate plugs ( as on SE's Many-to-One switch) you need to allocate some memory to hold pointers to the variables... in header module.h ... h ... int dynamic_plugs_count; float **dynamic_plugs; In module.cpp void Module::open() { int normal_out_plugs = 3; // however many 'normal' output plugs int num_in_plugs = CallHost(seaudioMasterGetInputPinCount); int num_out_plugs = CallHost(seaudioMasterGetOutputPinCount); dynamic_plugs_count = num_out_plugs - normal_out_plugs; dynamic_plugs = new float *[ dynamic_plugs_count]; for(int i = 0 ; i < dynamic plugs count ; i++ ) { dynamic_plugs = (float *)CallHost(seaudioMasterGetPinVarAddress, normal_out_plugs+i); }
//etc... }
void Module::sub_process(long buffer_offset, long sampleFrames ) { for(int i = 0 ; i < dynamic_plugs_count; i ++ ) { float *out = buffer_offset + dynamic_plugs; for(int s = sampleFrames ; s > 0 ; s-- ) { *out++ = (float) i; // just testing, different voltage out each one } } }
Module::~Module() { // This is where you free any memory/resources your module has created delete [] dynamic_plugs; }
|
|
setronic
Synthedit regular

Posts: 293
Posts: 293
|
Post by setronic on Feb 19, 2014 19:34:58 GMT 1
|
|
setronic
Synthedit regular

Posts: 293
Posts: 293
|
Post by setronic on Feb 19, 2014 19:45:42 GMT 1
logic gate looks pretty simple though. i've been thinking a lot about combinations, and about multiples.
when you say GUI doesn't operate at sample rate: these are very simple instructions - does it matter? are they treated differently from 'dsp'? how come they operate without transport run?
this is the selling point for me: i want my GUI to operate with host transport 'off' - i also got the impression GUI was snappier eg: LED respnse difference, using volt or float.
so: a dsp gate is 'faster'? more/less cpu? i figured GUIBool/float wouldn't take much cpu - i still get a heavy load within SE, even with tr.run off: *not* running audio, but with refresh, making lots of connections..time for a more powerful pc(and prostitute principles about running on 'average' performance machine...)
|
|