Example #1
0
bool MainContentComponent::keyPressed (const KeyPress& key)
{
    //[UserCode_keyPressed] -- Add your code here...
    if (key.getKeyCode() == 95 && key.getModifiers().isCtrlDown())
    {
        changeGain(-1.00);
    }
    if (key.getKeyCode() == 43 && key.getModifiers().isCtrlDown())
    {
        changeGain(+1.00);
    }
    return FALSE;  // Return true if your handler uses this key event, or false to allow it to be passed-on.
    //[/UserCode_keyPressed]
}
Example #2
0
bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
{
	if( !isEnabled() || !isRunning () )
	{
		return( false );
	}
	// check out changed controls
	if( m_frequencyChangeNeeded || m_bbControls.m_freqModel.isValueChanged() )
	{
		changeFrequency();
		m_frequencyChangeNeeded = false;
	}
	if( m_bbControls.m_gainModel.isValueChanged() ) { changeGain(); }
	if( m_bbControls.m_ratioModel.isValueChanged() ) { changeRatio(); }

	float gain = m_bbControls.m_gainModel.value();
	ValueBuffer *gainBuffer = m_bbControls.m_gainModel.valueBuffer();
	int gainInc = gainBuffer ? 1 : 0;
	float *gainPtr = gainBuffer ? &( gainBuffer->values()[ 0 ] ) : &gain;

	double outSum = 0.0;
	const float d = dryLevel();
	const float w = wetLevel();
	if( gainBuffer )
	{
		//process period using sample exact data
		for( fpp_t f = 0; f < frames; ++f )
		{
			m_bbFX.leftFX().setGain( *gainPtr );
			m_bbFX.rightFX().setGain( *gainPtr );
			outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];

			sample_t s[2] = { buf[f][0], buf[f][1] };
			m_bbFX.nextSample( s[0], s[1] );

			buf[f][0] = d * buf[f][0] + w * s[0];
			buf[f][1] = d * buf[f][1] + w * s[1];
			gainPtr += gainInc;
		}
	} else
	{
		//process period without sample exact data
		m_bbFX.leftFX().setGain( *gainPtr );
		m_bbFX.rightFX().setGain( *gainPtr );
		for( fpp_t f = 0; f < frames; ++f )
		{
			outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];

			sample_t s[2] = { buf[f][0], buf[f][1] };
			m_bbFX.nextSample( s[0], s[1] );

			buf[f][0] = d * buf[f][0] + w * s[0];
			buf[f][1] = d * buf[f][1] + w * s[1];
		}
	}

	checkGate( outSum / frames );

	return isRunning();
}
Example #3
0
StocSynthAudioProcessor::StocSynthAudioProcessor()
{
    for (int i = 0; i < VOICES; i++) {
        synth.addVoice(new SynthVoice());
    }

    synth.addSound (new SynthSound());
    
    changeToneAmp(1.0f);
    changeA135(0.5f);
    changeA246(0.5f);
    changeA789(0.5f);
    changeSub(0.0f);
    changeVar135(0.0f);
    changeVar246(0.0f);
    changeVar789(0.0f);
    
    changeCutoff(0.5f);
    changeRes(0.1f);
    
    changeAmpA(0.01f);
    changeAmpD(0.5f);
    changeAmpS(0.7f);
    changeAmpR(1.0f);
    changeGain(0.7f);
}
Example #4
0
void StocSynthAudioProcessor::setParameter (int index, float newValue)
{
    switch(index) {
        case TONE_AMP_PARAM:
            changeToneAmp(newValue);
            break;
        case A135_PARAM:
            changeA135(newValue);
            break;
        case A246_PARAM:
            changeA246(newValue);
            break;
        case A789_PARAM:
            changeA789(newValue);
            break;
        case SUB_PARAM:
            changeSub(newValue);
            break;
        case VAR135_PARAM:
            changeVar135(newValue);
            break;
        case VAR246_PARAM:
            changeVar246(newValue);
            break;
        case VAR789_PARAM:
            changeVar789(newValue);
            break;
        case PITCH135_PARAM:
            changePitch135(newValue);
            break;
        case PITCH246_PARAM:
            changePitch246(newValue);
            break;
        case PITCH789_PARAM:
            changePitch789(newValue);
            break;
        case CUTOFF_PARAM:
            changeCutoff(newValue);
            break;
        case RES_PARAM:
            changeRes(newValue);
            break;
        case AMP_A_PARAM:
            changeAmpA(newValue);
            break;
        case AMP_D_PARAM:
            changeAmpD(newValue);
            break;
        case AMP_S_PARAM:
            changeAmpS(newValue);
            break;
        case AMP_R_PARAM:
            changeAmpR(newValue);
            break;
        case GAIN_PARAM:
            changeGain(newValue);
            break;
    }
}
Example #5
0
BassBoosterEffect::BassBoosterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ) :
	Effect( &bassbooster_plugin_descriptor, parent, key ),
	m_frequencyChangeNeeded( false ),
	m_bbFX( DspEffectLibrary::FastBassBoost( 70.0f, 1.0f, 2.8f ) ),
	m_bbControls( this )
{
	changeFrequency();
	changeGain();
	changeRatio();
}
bool KlustersView::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: updatedDimensions((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 1: singleColorUpdated((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 2: clusterRemovedFromView((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 3: clusterAddedToView((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 4: newClusterAddedToView((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1)),(int)static_QUType_int.get(_o+2),(bool)static_QUType_bool.get(_o+3)); break;
    case 5: newClusterAddedToView((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 6: spikesRemovedFromClusters((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2)); break;
    case 7: modeToSet((BaseFrame::Mode)(*((BaseFrame::Mode*)static_QUType_ptr.get(_o+1)))); break;
    case 8: spikesAddedToCluster((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 9: updateContents(); break;
    case 10: emptySelection(); break;
    case 11: modifiedClusters((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2),(bool)static_QUType_bool.get(_o+3)); break;
    case 12: modifiedClustersUndo((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2)); break;
    case 13: updatedTimeFrame((long)(*((long*)static_QUType_ptr.get(_o+1))),(long)(*((long*)static_QUType_ptr.get(_o+2)))); break;
    case 14: sampleMode(); break;
    case 15: timeFrameMode(); break;
    case 16: meanPresentation(); break;
    case 17: allWaveformsPresentation(); break;
    case 18: overLayPresentation(); break;
    case 19: sideBySidePresentation(); break;
    case 20: increaseAmplitude(); break;
    case 21: decreaseAmplitude(); break;
    case 22: updateDisplayNbSpikes((long)(*((long*)static_QUType_ptr.get(_o+1)))); break;
    case 23: increaseAmplitudeofCorrelograms(); break;
    case 24: decreaseAmplitudeofCorrelograms(); break;
    case 25: noScale(); break;
    case 26: maxScale(); break;
    case 27: shoulderScale(); break;
    case 28: updatedBinSizeAndTimeFrame((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 29: setShoulderLine((bool)static_QUType_bool.get(_o+1)); break;
    case 30: updateDrawing(); break;
    case 31: changeGain((int)static_QUType_int.get(_o+1)); break;
    case 32: changeTimeInterval((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 33: changeChannelPositions((QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+1))); break;
    case 34: computeProbabilities(); break;
    case 35: changeBackgroundColor((QColor)(*((QColor*)static_QUType_ptr.get(_o+1)))); break;
    case 36: clustersRenumbered((bool)static_QUType_bool.get(_o+1)); break;
    case 37: updateClusters((QString)static_QUType_QString.get(_o+1),(QValueList<int>&)*((QValueList<int>*)static_QUType_ptr.get(_o+2)),(ItemColors*)static_QUType_ptr.get(_o+3),(bool)static_QUType_bool.get(_o+4)); break;
    case 38: increaseAllAmplitude(); break;
    case 39: decreaseAllAmplitude(); break;
    case 40: showLabels((bool)static_QUType_bool.get(_o+1)); break;
    case 41: nextCluster(); break;
    case 42: previousCluster(); break;
    default:
	return KDockArea::qt_emit(_id,_o);
    }
    return TRUE;
}
Example #7
0
DWORD WINAPI changeGainThread(LPVOID lpParam){
    changeGain(thFilename, thGainchange, thGainchange);
    return 0;
    UNREFERENCED_PARAMETER(lpParam);
}
Example #8
0
void MainContentComponent::buttonClicked (Button* buttonThatWasClicked)
{
    //[UserbuttonClicked_Pre]
    //[/UserbuttonClicked_Pre]

    if (buttonThatWasClicked == tb_Plus025)
    {
        //[UserButtonCode_tb_Plus025] -- add your button handler code here..
        changeGain(+0.25);
        //[/UserButtonCode_tb_Plus025]
    }
    else if (buttonThatWasClicked == tb_Plus100)
    {
        //[UserButtonCode_tb_Plus100] -- add your button handler code here..
        changeGain(+1.00);
        //[/UserButtonCode_tb_Plus100]
    }
    else if (buttonThatWasClicked == tb_Minus025)
    {
        //[UserButtonCode_tb_Minus025] -- add your button handler code here..
        changeGain(-0.25);
        //[/UserButtonCode_tb_Minus025]
    }
    else if (buttonThatWasClicked == tb_Minus100)
    {
        //[UserButtonCode_tb_Minus100] -- add your button handler code here..
        changeGain(-1.00);
        //[/UserButtonCode_tb_Minus100]
    }
    else if (buttonThatWasClicked == tb_Enable)
    {
        //[UserButtonCode_tb_Enable] -- add your button handler code here..
        if (tb_Enable->getToggleState())
        {
            tb_Plus500->setEnabled(TRUE);
        }
        else
        {
            tb_Plus500->setEnabled(FALSE);
        }
        //[/UserButtonCode_tb_Enable]
    }
    else if (buttonThatWasClicked == tb_Plus500)
    {
        //[UserButtonCode_tb_Plus500] -- add your button handler code here..
        if(tb_Enable->getToggleState())
        {
            changeGain(+5.00);
            tb_Plus500->setEnabled(FALSE);
            tb_Enable->setToggleState(FALSE, dontSendNotification);
        }
        //[/UserButtonCode_tb_Plus500]
    }
    else if (buttonThatWasClicked == tb_Minus500)
    {
        //[UserButtonCode_tb_Minus500] -- add your button handler code here..
        changeGain(-5.00);
        //[/UserButtonCode_tb_Minus500]
    }
    else if (buttonThatWasClicked == tb_Mute)
    {
        //[UserButtonCode_tb_Mute] -- add your button handler code here..
        if (muteState)
        {
            for(int deviceNumber = 0; deviceNumber < deviceCount; deviceNumber++)
            {
                int32 outputChannelCount = deviceList[deviceNumber]->getoutputchannelcount();

                for(int channelNumber = 0; channelNumber < outputChannelCount; channelNumber++)
                {
                    deviceList[deviceNumber]->setmastermute(channelNumber, 0);
                }
            }

            muteState = FALSE;
            tb_Mute->setButtonText("MUTE");
            tb_Mute->setColour(TextButton::buttonColourId, Colours::red);
            tb_Mute->setColour (TextButton::buttonOnColourId, Colours::red);

        }
        else
        {
            for(int32 deviceNumber = 0; deviceNumber < deviceCount; deviceNumber++)
            {
                int32 outputChannelCount = deviceList[deviceNumber]->getoutputchannelcount();

                for(int32 channelNumber = 0; channelNumber < outputChannelCount; channelNumber++)
                {
                    deviceList[deviceNumber]->setmastermute(channelNumber, 1);
                }
            }

            muteState = TRUE;
            tb_Mute->setButtonText("UNMUTE");
            tb_Mute->setColour(TextButton::buttonColourId, Colours::greenyellow);
            tb_Mute->setColour (TextButton::buttonOnColourId, Colours::green);
        }

        //[/UserButtonCode_tb_Mute]
    }
    else if (buttonThatWasClicked == tb_Minus2000)
    {
        //[UserButtonCode_tb_Minus2000] -- add your button handler code here..
        changeGain(-20.00);
        //[/UserButtonCode_tb_Minus2000]
    }
    else if (buttonThatWasClicked == tb_Info)
    {
        //[UserButtonCode_tb_Info] -- add your button handler code here..
        infoWindow->setVisible(!infoWindow->isVisible());
        //[/UserButtonCode_tb_Info]
    }
    else if (buttonThatWasClicked == tb_Help)
    {
        //[UserButtonCode_tb_Help] -- add your button handler code here..
        helpWindow->setVisible(!helpWindow->isVisible());
        //[/UserButtonCode_tb_Help]
    }

    //[UserbuttonClicked_Post]
    //[/UserbuttonClicked_Post]
}