Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 13 of 13

Thread: Strange error in complilig sketch for Simplewavetable

  1. #1

    Strange error in complilig sketch for Simplewavetable

    Hello.
    I have a strange error in this sketch at instrucion:

    wavetable.setInstrument(ChurhOrgan),

    No matching funcion for call to "AudioSynthWavetable::setInstrument(const instrument_data&)'

    I have decoded ChurchOrgan with utility Soundfontdecoder from a sf2 files.

    Can anyone help me?

    Thanks you.
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,762
    In your Churchorgan_samples.h change this line:
    Code:
    #include <AudioSynthWavetable.h>
    to this:
    Code:
    #include <synth_wavetable.h>
    It still won't compile but it'll get further along.

    Pete

  3. #3
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    314
    can you post the compile error output

    it can be because you are using a old version of Soundfontdecoder

  4. #4
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    314
    By the way i did a compile myself
    There is some reference errors.

    As I also had problems the first time
    and the problem is in the soundfontdecoder.

  5. #5
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    314
    I had little time when I did the last post

    there has been some changes to the synth_wavetable.h and the soundFontDecoder provided at PaulStoffregen:s github is not updated

    I have attached the new version of soundFontDecoder which also includes new options for both teensy 4.0 and teensy 4.1

    there is a nice library here (extracted from the GM by wrightflyer using a updated version of the soundFontDecoder)
    https://github.com/wrightflyer/Synth...c/GMinstrument
    you can read this post by wrightflyer how to use them all
    https://forum.pjrc.com/threads/65740...l=1#post266172





    or else if you want to you can change the header yourself (but that will only solve the problem for your current converted soundfont)

    this is the right "header" this is just an example and you need to do the changes yourself to match
    Code:
    static const AudioSynthWavetable::sample_data MmmmHumSynth_samples[1] = {
    	{
    		(int16_t*)sample_0_MmmmHumSynth_MMMMM, // sample
    		true, // LOOP
    		15, // LENGTH_BITS
    		(1 << (32 - 15)) * WAVETABLE_CENTS_SHIFT(-73) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(72) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
    		((uint32_t)21844 - 1) << (32 - 15), // MAX_PHASE
    		((uint32_t)21843 - 1) << (32 - 15), // LOOP_PHASE_END
    		(((uint32_t)21843 - 1) << (32 - 15)) - (((uint32_t)4817 - 1) << (32 - 15)), // LOOP_PHASE_LENGTH
    		uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-0.0)), // INITIAL_ATTENUATION_SCALAR
    		uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
    		uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
    		uint32_t(0.98 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
    		uint32_t(1.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
    		uint32_t(2500.99 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
    		int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-0.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
    		uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
    		uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
    		(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
    		(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
    		uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
    		uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
    		(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
    		(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
    		int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
    		int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
    	},
    };
    this is the "header" from ChurchOrgan_samples.cpp which is incorrect
    Code:
    const sample_data ChurchOrgan_samples[1] = {
    	{
    		(int16_t*)sample_0_ChurchOrgan_ChurchOrgC3,	//16-bit PCM encoded audio sample
    		true,	//Whether or not to loop this sample
    		12,	//Number of bits needed to hold length
    		(1048576*0.9885140203528962*(44100.0 / AUDIO_SAMPLE_RATE_EXACT)) / 391.99543598174927 + 0.5,	//((0x80000000 >> (index_bits - 1)) * cents_offset * sampling_rate / AUDIO_SAME_RATE_EXACT) / sample_freq + 0.5
    		((uint32_t)3966-1) << (32 - 12),	//(sample_length-1) << (32 - sample_length_bits)
    		((uint32_t)3958-1) << (32 - 12),	//(loop_end-1) << (32 - sample_length_bits) == LOOP_PHASE_END
    		(((uint32_t)3958-1) << (32 - 12)) - (((uint32_t)3736-1) << (32 - 12)),	//LOOP_PHASE_END - (loop_start-1) << (32 - sample_length_bits) == LOOP_PHASE_END - LOOP_PHASE_START == LOOP_PHASE_LENGTH
    		uint16_t(UINT16_MAX * DECIBEL_SHIFT(-1500/100.0)), //INITIAL_ATTENUATION_SCALAR
    		uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5),	//DELAY_COUNT
    		uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5),	//ATTACK_COUNT
    		uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5),	//HOLD_COUNT
    		uint32_t(0*SAMPLES_PER_MSEC/8.0+0.5),	//DECAY_COUNT
    		uint32_t(654*SAMPLES_PER_MSEC/8.0+0.5),	//RELEASE_COUNT
    		int32_t(0*UNITY_GAIN),	//SUSTAIN_MULT
    		uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), 	// VIBRATO_DELAY
    		uint32_t(672/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
    		(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
    		(1.0 - CENTS_SHIFT(0/1000.0))*4, // VIBRATO_COEFFICIENT_SECONDARY
    		uint32_t(0 * SAMPLES_PER_MSEC / (2 * LFO_PERIOD)), // MODULATION_DELAY
    		uint32_t(672/1000.0 * LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
    		(CENTS_SHIFT(-0/1000.0) - 1.0)*4, // MODULATION_PITCH_COEFFICIENT_INITIAL
    		(1.0 - CENTS_SHIFT(0/1000.0))*4, // MODULATION_PITCH_COEFFICIENT_SECOND
    		int32_t(UINT16_MAX * (DECIBEL_SHIFT(-0.1) - 1.0)) *4, // MODULATION_AMPLITUDE_INITIAL_GAIN
    		int32_t(UINT16_MAX * (1.0 - DECIBEL_SHIFT(0.1))) *4, // MODULATION_AMPLITUDE_FINAL_GAIN
    	},
    };
    Attached Files Attached Files

  6. #6
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    314
    a note about the attached SoundfontDecoder
    it only contains the changed files and must be extracted in your current SoundfontDecoder folder

  7. #7
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,762
    The attached version compiles. I mangled the code until it looked like the example in Files/Examples/Audio/Synthesis/WaveTable/Simpletable.
    SimpleWavetable_ver004_1.zip

    Pete

  8. #8
    Quote Originally Posted by el_supremo View Post
    The attached version compiles. I mangled the code until it looked like the example in Files/Examples/Audio/Synthesis/WaveTable/Simpletable.
    SimpleWavetable_ver004_1.zip

    Pete
    Thanks you for reply.
    But now I have this error:
    Attached Files Attached Files

  9. #9
    Have you a Soundfontdecoder.exe updated?
    I am not able to use python bat.
    Thanks you.

  10. #10
    Quote Originally Posted by el_supremo View Post
    The attached version compiles. I mangled the code until it looked like the example in Files/Examples/Audio/Synthesis/WaveTable/Simpletable.
    SimpleWavetable_ver004_1.zip

    Pete
    have you a sounfontdecoder.exe update?
    I am non able to use python.
    Thanks you.

  11. #11
    Quote Originally Posted by el_supremo View Post
    the attached version compiles. I mangled the code until it looked like the example in files/examples/audio/synthesis/wavetable/simpletable.
    SimpleWavetable_ver004_1.zip

    pete
    thanks you: I resolved error and now it works very well.

  12. #12
    Scuse me: It works very well!!!!!!!
    Thanks you

  13. #13
    Quote Originally Posted by Gennaro Pirozzi View Post
    Scuse me: It works very well!!!!!!!
    Thanks you
    Now I am searching for Soundfontdecoder.exe update. Have this .exe?
    Thanks you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •