sfztools / sfizz

SFZ parser and synth c++ library, providing a JACK standalone client
https://sfz.tools/sfizz/
BSD 2-Clause "Simplified" License
418 stars 58 forks source link

Demos and Benchmarks require review #1148

Open redtide opened 1 year ago

redtide commented 1 year ago

EDIT: Some temporary fixes were applied in #1167 to be able to build them but still need some work, see comment below.

Benchmarks:

In file included from /home/redtide/Documenti/Sviluppo/SFZTools/sfizz/benchmarks/BM_ADSR.cpp:9:
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/benchmarks/BM_ADSR.cpp: In constructor ‘EnvelopeFixture_Block_Benchmark::EnvelopeFixture_Block_Benchmark()’:
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/benchmarks/BM_ADSR.cpp:43:1: error: use of deleted function ‘EnvelopeFixture::EnvelopeFixture()’
   43 | BENCHMARK_DEFINE_F(EnvelopeFixture, Block)(benchmark::State& state)
      | ^~~~~~~~~~~~~~~~~~
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/benchmarks/BM_ADSR.cpp:22:7: note: ‘EnvelopeFixture::EnvelopeFixture()’ is implicitly deleted because the default definition would be ill-formed:
   22 | class EnvelopeFixture : public benchmark::Fixture
      |       ^~~~~~~~~~~~~~~
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/benchmarks/BM_ADSR.cpp:22:7: error: no matching function for call to ‘sfz::ADSREnvelope::ADSREnvelope()’
In file included from /home/redtide/Documenti/Sviluppo/SFZTools/sfizz/benchmarks/BM_ADSR.cpp:8:
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/src/sfizz/ADSREnvelope.h:21:5: note: candidate: ‘sfz::ADSREnvelope::ADSREnvelope(const sfz::MidiState&)’
   21 |     ADSREnvelope(const MidiState& state)
      |     ^~~~~~~~~~~~
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/src/sfizz/ADSREnvelope.h:21:5: note:   candidate expects 1 argument, 0 provided
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/src/sfizz/ADSREnvelope.h:17:7: note: candidate: ‘constexpr sfz::ADSREnvelope::ADSREnvelope(const sfz::ADSREnvelope&)’
   17 | class ADSREnvelope {
      |       ^~~~~~~~~~~~
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/src/sfizz/ADSREnvelope.h:17:7: note:   candidate expects 1 argument, 0 provided
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/src/sfizz/ADSREnvelope.h:17:7: note: candidate: ‘constexpr sfz::ADSREnvelope::ADSREnvelope(sfz::ADSREnvelope&&)’
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/src/sfizz/ADSREnvelope.h:17:7: note:   candidate expects 1 argument, 0 provided
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/benchmarks/BM_ADSR.cpp: In member function ‘virtual void EnvelopeFixture_Block_Benchmark::BenchmarkCase(benchmark::State&)’:
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/benchmarks/BM_ADSR.cpp:46:23: error: no matching function for call to ‘sfz::ADSREnvelope::reset(sfz::EGDescription&, sfz::Region&, sfz::MidiState&, int, int, const float&)’
   46 |         envelope.reset(region.amplitudeEG, region, midiState, 0, 0, sampleRate);
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/src/sfizz/ADSREnvelope.h:33:10: note: candidate: ‘void sfz::ADSREnvelope::reset(const sfz::EGDescription&, const sfz::Region&, int, float, float)’
   33 |     void reset(const EGDescription& desc, const Region& region, int delay, float velocity, float sampleRate) noexcept;
      |          ^~~~~
/home/redtide/Documenti/Sviluppo/SFZTools/sfizz/src/sfizz/ADSREnvelope.h:33:10: note:   candidate expects 5 arguments, 6 provided

Demos error log is even bigger, including some references to sndfile.hh; it looks like an old API related issue.

redtide commented 1 year ago

Some files use bundled dr_{flac|wav}.h and explicit use of sndfile.hh: it would be nice to have a global replacement in the entire library with st_audiofile function replacement utilities, and so removing SFIZZ_USE_SNDFILE define checks (if not dropping entirely sndfile and use dr_libs only).