Skip to content

Commit

Permalink
add reminder to future me
Browse files Browse the repository at this point in the history
- change of sample rate is checked for every single sample
  • Loading branch information
mzuther committed Jul 11, 2020
1 parent 7c0b583 commit 23acb74
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ProtoFaust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,20 @@ void ProtoFaust::onAdd()
attachFaustParameter( widget );
}

// initialize Faust using default sample rate
// initialize Faust using default sample rate; see
// ProtoFaust::process()
FaustDSP.init( 44100 );
}


void ProtoFaust::process( const ProcessArgs& args )
{
// update Faust DSP on sample rate changes
//
// running this check in *every* module and for *every* single
// sample seems like a *huge* amount of overhead; however, this is
// the current expected behaviour of VCV Rack modules; see
// https://github.com/mzuther/ProtoFaust/pull/2
if ( args.sampleRate != FaustDSP.getSampleRate() ) {
FaustDSP.init( args.sampleRate );
}
Expand Down

0 comments on commit 23acb74

Please sign in to comment.