Ejemplo n.º 1
0
Archivo: cubase.cpp Proyecto: berak/e6
//-------------------------------------------------------------------------------------------------------
e6::e6 (audioMasterCallback audioMaster)
: AudioEffectX (audioMaster, 1, nParams )	// 1 program, 1 parameter only
{
	setNumInputs (0);		// no in
	setNumOutputs (0);		// no out
	setUniqueID ('e6e6');	// identify

	// we don't do audio !
	canProcessReplacing (false);	// supports replacing output
	canDoubleReplacing (false);	// supports double precision processing


	for ( int id=0; id<nParams; id++ ) 
	{
		sprintf( params[id].name,"param_%d", id );
		strcpy( params[id].label, "db" ); 
		params[id].value = 0.0f; 
	}

	vst_strncpy (programName, "Default", kVstMaxProgNameLen);	// default program name

	logFile = fopen("e6.log", "wb" );
	int res = sock.connect( "localhost", 9999 );
	if ( res = SOCKET_ERROR )
	{
		fprintf( logFile, "could not connect to localhost on 9999\n" );
		fflush( logFile );
	}
	else
	{
		fprintf( logFile, "connected to localhost on 9999\n" );
		fflush( logFile );
	}
}
Ejemplo n.º 2
0
//-------------------------------------------------------------------------------------------------------
gsBEncoder::gsBEncoder (audioMasterCallback audioMaster)
: AudioEffectX (audioMaster, 1, num_params())	// 1 program, N parameters
, gen(0)
, bufferSize(512)
, sampleRate(44100)
, blockSize(512)
{
	inputBuffers.resize(num_inputs());
	outputBuffers.resize(num_outputs());

	for(int i=0; i < inputBuffers.size(); i++) {
		inputBuffers[i] = new t_sample[bufferSize];
	}
	for(int i=0; i < outputBuffers.size(); i++) {
		outputBuffers[i] = new t_sample[bufferSize];
	}

	gen = (CommonState *)create(sampleRate, blockSize);
	setNumInputs (num_inputs());
	setNumOutputs (num_outputs());
	setUniqueID ('GSE_I');	// identify
	canProcessReplacing ();	// supports replacing output
	canDoubleReplacing ();	// supports double precision processing

	vst_strncpy (programName, VST_NAME, kVstMaxProgNameLen);	// default program name
}
Ejemplo n.º 3
0
static void callProcess(BASS_VST_PLUGIN* this_, BASS_VST_PLUGIN* buffers, long numSamples)
{
	if( this_->effStartProcessCalled )
	{
		// do MIDI processing
		EnterCriticalSection(&this_->midiCritical_);
			if( this_->midiEventsCurr && this_->midiEventsCurr->numEvents )
			{
				this_->aeffect->dispatcher(this_->aeffect, effProcessEvents, 0, 0, this_->midiEventsCurr, 0.0);

				// prepare for the next round ... use the other buffer
				VstEvents* temp = this_->midiEventsCurr; this_->midiEventsCurr = this_->midiEventsPrev; this_->midiEventsPrev = temp;
				if( this_->midiEventsCurr )
					this_->midiEventsCurr->numEvents = 0;
			}
		LeaveCriticalSection(&this_->midiCritical_);

		if(    this_->aeffect->processReplacing
		 && ( (this_->aeffect->flags & effFlagsCanReplacing) || this_->aeffect->__processDeprecated == NULL) )
		{
			// do the normal float processing
			this_->aeffect->processReplacing(this_->aeffect, buffers->buffersIn, buffers->buffersOut, numSamples);
		}
		else if( this_->aeffect->__processDeprecated )
		{
			// do the "old" float processing - better than the overhead for the double replacing
			this_->aeffect->__processDeprecated(this_->aeffect, this_->buffersIn, this_->buffersOut, numSamples);
		}
		else if( canDoubleReplacing(this_) )
		{
			// convert all buffers to double; the output buffer is already emptied incl. the double headroom
			double* doubleIn[MAX_CHANS];
			double* doubleOut[MAX_CHANS];
			int i;
			for( i = 0; i < MAX_CHANS; i++ )
			{
				doubleIn[i] = (double*)buffers->buffersIn[i];
				if( doubleIn[i] )
					cnvFloatToDouble(buffers->buffersIn[i], doubleIn[i], numSamples*sizeof(float));

				doubleOut[i] = (double*)buffers->buffersOut[i]; 
			}

			// do process double replacing
			this_->aeffect->processDoubleReplacing(this_->aeffect, doubleIn, doubleOut, numSamples);

			// convert all buffers back to floats; this is also needed for the input buffers as 
			// callProcess() may be called for several instances of effects (eg. for editor forwarding)
			for( i = 0; i < MAX_CHANS; i++ )
			{
				if( doubleIn[i] )
					cnvDoubleToFloat(doubleIn[i], buffers->buffersIn[i], numSamples*sizeof(double));

				if( doubleOut[i] )
					cnvDoubleToFloat(doubleOut[i], buffers->buffersOut[i], numSamples*sizeof(double));
			}
		}
	}
}
Ejemplo n.º 4
0
Silence::Silence(audioMasterCallback audio_master)
  : AudioEffectX(audio_master, 1, 1) {
  setNumInputs(2);
  setNumOutputs(2);
  setUniqueID('Silence');
  canProcessReplacing();
  canDoubleReplacing();

  vst_strncpy(program_name, "Default", kVstMaxProgNameLen);
}
Ejemplo n.º 5
0
//-------------------------------------------------------------------------------------------------------
AGain::AGain (audioMasterCallback audioMaster)
    : AudioEffectX (audioMaster, 1, 11)	// 1 program, 1 parameter only
{
    setNumInputs (2);		// stereo in
    setNumOutputs (2);		// stereo out
    setUniqueID ('Band');	// identify
    canProcessReplacing ();	// supports replacing output
    canDoubleReplacing ();	// supports double precision processing

    fGain = 1.f;			// default to 0 dB
    vst_strncpy (programName, "Default", kVstMaxProgNameLen);	// default program name
    UdpLog::setup( 7777, "localhost" );
}
Ejemplo n.º 6
0
plugin::plugin(audioMasterCallback audioMaster)
: AudioEffectX(audioMaster, 1, PARAMETERS)
{
	setNumInputs(2);
	setNumOutputs(2);
	setUniqueID(ID);
	canProcessReplacing();
	canDoubleReplacing();
	vst_strncpy(programName, "Init", kVstMaxProgNameLen);
	#if (PARAMETERS > 0)
	::construct_params(params);
	#endif
	::construct(&data);
}
Ejemplo n.º 7
0
//-------------------------------------------------------------------------------------------------------
FormantPlugin::FormantPlugin (audioMasterCallback audioMaster)
: AudioEffectX (audioMaster, 1,2)	// 1 program, 1 parameter only
{
	setNumInputs (2);		// stereo in
	setNumOutputs (2);		// stereo out
	setUniqueID ('ijnh');	// identify
	canProcessReplacing ();	// supports replacing output
	canDoubleReplacing ();	// supports double precision processing

	params[pPosition] = new VstParameter("Position", 1.f);
	params[pVowelA] = new VstParameter("VowelA", 1.f);

	filters[0]= new StateVariableFilter(800);
	filters[1]= new StateVariableFilter(1150);
	filters[2]= new StateVariableFilter(800);
	filters[3]= new StateVariableFilter(1150);

	vst_strncpy (programName, "Default", kVstMaxProgNameLen);	// default program name
}
Ejemplo n.º 8
0
BlueSaturation::BlueSaturation(audioMasterCallback audioMaster) :
	AudioEffectX(audioMaster, kNumPresets, kNumParameters), 
	mNumChannels(2),
	mOverdrive(NULL),
	mInput(NULL),
	mOutput(NULL)
{
	TTDSPInit();
	
	setNumInputs(2);		// stereo in
	setNumOutputs(2);		// stereo out
	setUniqueID('TTOv');	// identify
	canProcessReplacing();	// supports replacing output
	canDoubleReplacing();	// supports double precision processing

	TTObjectInstantiate(TT("overdrive"), &mOverdrive, mNumChannels);
	TTObjectInstantiate(kTTSym_audiosignal, &mInput, mNumChannels);
	TTObjectInstantiate(kTTSym_audiosignal, &mOutput, mNumChannels);
	
	mParameterList = new BlueParameter[kNumParameters];

	strncpy(mParameterList[kParameterDrive].name, "drive", 256);
	mParameterList[kParameterDrive].scaling = 9.0;
	mParameterList[kParameterDrive].offset = 1.0;

	strncpy(mParameterList[kParameterPreamp].name, "preamp", 256);
	mParameterList[kParameterPreamp].scaling = 96.0;
	mParameterList[kParameterPreamp].offset = -78.0;

	strncpy(mParameterList[kParameterMode].name, "mode", 256);
	mParameterList[kParameterMode].scaling = 2.0;		// just round this one
	mParameterList[kParameterMode].offset = 0.5;

	strncpy(mParameterList[kParameterBlockDC].name, "dcblocker", 256);
	mParameterList[kParameterBlockDC].scaling = 1.0;	// just round this one
	mParameterList[kParameterBlockDC].offset = 0.5;
	
	vst_strncpy(programName, "Default", kVstMaxProgNameLen);	// default program name
}
Ejemplo n.º 9
0
//-------------------------------------------------------------------------------------------
FBdelay::FBdelay (audioMasterCallback audioMaster)
  : AudioEffectX (audioMaster, 1, 3)	
{
  setNumInputs (1);		// stereo in
  setNumOutputs (1);		// stereo out
  setUniqueID ('delay');	// identify
  canProcessReplacing ();	// supports replacing output
  canDoubleReplacing ();	// supports double precision processing

  i0		= 1;    // gain
  i1		= 0.5f; // delay
  i2		= 0.7f; // fb
  maxdlyms      = 10000;
  maxbufsize	= maxdlyms * getSampleRate() * 0.001;
  rpos		= 0;
  wpos		= 0;
  dlybuf        = new double[maxbufsize];
  lsamp         = 0;
  memset(dlybuf, 0, maxbufsize * sizeof(double));
  
  vst_strncpy (programName, "Default", kVstMaxProgNameLen);	// default program name
}
Ejemplo n.º 10
0
//------------------------------------------------------------------------------
VStep::VStep(audioMasterCallback audioMaster)
: AudioEffectX(audioMaster, 1, 0) // 1 program, 0 parameters
, keyForChannel(pattern.numChannels())
, pattern(8, 16) // 8 channels, 16 steps
, listener("7770", &pattern)
, keepAlive(0)
{
  setUniqueID('VSTP');

  setNumInputs(0);
  setNumOutputs(2);
  isSynth();

  canProcessReplacing();
  canDoubleReplacing();

  vst_strncpy(programName, "Default", kVstMaxProgNameLen);

  for (unsigned int channel = 0; channel < pattern.numChannels(); ++channel)
  {
    keyForChannel[channel] = 36 + channel;
  }
}
Ejemplo n.º 11
0
Vst::Vst (audioMasterCallback audioMaster, bool asInstrument) :
    AudioEffectX (audioMaster, 128, 128),
    myApp(0),
    myHost(0),
    myWindow(0),
    bufferSize(0),
    listEvnts(0),
    hostSendVstEvents(false),
    hostSendVstMidiEvent(false),
    hostReportConnectionChanges(false),
    hostAcceptIOChanges(false),
    hostSendVstTimeInfo(false),
    hostReceiveVstEvents(false),
    hostReceiveVstMidiEvents(false),
    hostReceiveVstTimeInfo(false),
    opened(false),
    currentHostProg(0),
    chunkData(0)
{
    setNumInputs (DEFAULT_INPUTS*2);
    setNumOutputs (DEFAULT_OUTPUTS*2);

    if(asInstrument)
        setUniqueID (uniqueIDInstrument);
    else
        setUniqueID (uniqueIDEffect);

    isSynth(asInstrument);
    canProcessReplacing(true);
    programsAreChunks(true);
    vst_strncpy (programName, "Default", kVstMaxProgNameLen);	// default program name

    qRegisterMetaType<ConnectionInfo>("ConnectionInfo");
    qRegisterMetaType<ObjectInfo>("ObjectInfo");
    qRegisterMetaType<int>("ObjType::Enum");
    qRegisterMetaType<QVariant>("QVariant");
    qRegisterMetaType<AudioBuffer*>("AudioBuffer*");

    qRegisterMetaTypeStreamOperators<ObjectInfo>("ObjectInfo");

    QCoreApplication::setOrganizationName("CtrlBrk");
    QCoreApplication::setApplicationName("VstBoard");

#ifdef QT_NO_DEBUG
    if(qtTranslator.load("qt_" + QLocale::system().name(), ":/translations/"))
        qApp->installTranslator(&qtTranslator);
    if(commonTranslator.load("common_" + QLocale::system().name(), ":/translations/"))
        qApp->installTranslator(&commonTranslator);
    if(myappTranslator.load("vstboard_" + QLocale::system().name(), ":/translations/"))
        qApp->installTranslator(&myappTranslator);
#endif
    myHost = new MainHostVst(this,0,"plugin/");
    if(myHost->doublePrecision)
        canDoubleReplacing(true);
    connect(myHost, SIGNAL(DelayChanged(long)),
            this, SLOT(DelayChanged(long)));

    myWindow = new MainWindowVst(myHost);
    qEditor = new Gui(this);
    setEditor(qEditor);
    qEditor->SetMainWindow(myWindow);
}