Skip to content

Commit

Permalink
Merge remote-tracking branch 'sletz/update_sr' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuther committed Jul 11, 2020
2 parents e9c8310 + 89054db commit 7c0b583
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 7 additions & 9 deletions src/ProtoFaust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,18 @@ void ProtoFaust::onAdd()
attachFaustParameter( widget );
}

FaustDSP.init(
APP->engine->getSampleRate() );
// initialize Faust using default sample rate
FaustDSP.init( 44100 );
}


void ProtoFaust::onSampleRateChange()
void ProtoFaust::process( const ProcessArgs& args )
{
FaustDSP.instanceConstants(
APP->engine->getSampleRate() );
}

// update Faust DSP on sample rate changes
if ( args.sampleRate != FaustDSP.getSampleRate() ) {
FaustDSP.init( args.sampleRate );
}

void ProtoFaust::process( const ProcessArgs& /* args (unused) */ )
{
std::vector<FAUSTFLOAT> temporaryInputs( numberOfChannels );
std::vector<FAUSTFLOAT> temporaryOutputs( numberOfChannels );

Expand Down
2 changes: 0 additions & 2 deletions src/ProtoFaust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ struct ProtoFaust : Module {
ProtoFaust();

void onAdd() override;
void onSampleRateChange() override;

void process( const ProcessArgs& args ) override;

private:
Expand Down

0 comments on commit 7c0b583

Please sign in to comment.