<commit_before>
#include "test.h"
#include "fluidsynth.h"

// this test should make sure that sample rate changed are handled correctly
int main(void)
{
    fluid_synth_t *synth;
    fluid_settings_t *settings = new_fluid_settings();
    TEST_ASSERT(settings != NULL);
    
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.roomsize", 1.0));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.damp", 1.0));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.width", 1.0));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.level", 1.0));
    
    TEST_SUCCESS(fluid_settings_setint(settings, "synth.chorus.nr", 99));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.level", 1.0));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.speed", 1.0));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.depth", 1.0));
  
    synth = new_fluid_synth(settings);
    TEST_ASSERT(synth != NULL);    
    
    TEST_ASSERT(fluid_synth_get_reverb_roomsize(synth) == 1.0);
    TEST_ASSERT(fluid_synth_get_reverb_damp(synth) == 1.0);
    TEST_ASSERT(fluid_synth_get_reverb_width(synth) == 1.0);
    TEST_ASSERT(fluid_synth_get_reverb_level(synth) == 1.0);
    
    TEST_ASSERT(fluid_synth_get_chorus_nr(synth) == 99);
    TEST_ASSERT(fluid_synth_get_chorus_level(synth) == 1.0);
    TEST_ASSERT(fluid_synth_get_chorus_speed_Hz(synth) == 1.0);
    TEST_ASSERT(fluid_synth_get_chorus_depth_ms(synth) == 1.0);
    
    delete_fluid_synth(synth);
    delete_fluid_settings(settings);
    
    return EXIT_SUCCESS;
}<commit_msg>check that realtime reverb and chorus settings work<commit_after>
#include "test.h"
#include "fluidsynth.h"

// this test should make sure that sample rate changed are handled correctly
int main(void)
{
    fluid_synth_t *synth;
    fluid_settings_t *settings = new_fluid_settings();
    TEST_ASSERT(settings != NULL);
    
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.roomsize", 0.1));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.damp", 0.2));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.width", 0.3));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.level", 0.4));
    
    TEST_SUCCESS(fluid_settings_setint(settings, "synth.chorus.nr", 99));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.level", 0.5));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.speed", 0.6));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.depth", 0.7));
  
    synth = new_fluid_synth(settings);
    TEST_ASSERT(synth != NULL);    
    
    // check that the synth is initialized with the correct values
    TEST_ASSERT(fluid_synth_get_reverb_roomsize(synth) == 0.1);
    TEST_ASSERT(fluid_synth_get_reverb_damp(synth) == 0.2);
    TEST_ASSERT(fluid_synth_get_reverb_width(synth) == 0.3);
    TEST_ASSERT(fluid_synth_get_reverb_level(synth) == 0.4);
    
    TEST_ASSERT(fluid_synth_get_chorus_nr(synth) == 99);
    TEST_ASSERT(fluid_synth_get_chorus_level(synth) == 0.5);
    TEST_ASSERT(fluid_synth_get_chorus_speed(synth) == 0.6);
    TEST_ASSERT(fluid_synth_get_chorus_depth(synth) == 0.7);
    
    // update the realtime settings afterward
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.roomsize", 0.11));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.damp", 0.22));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.width", 0.33));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.reverb.level", 0.44));
    
    TEST_SUCCESS(fluid_settings_setint(settings, "synth.chorus.nr", 11));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.level", 0.55));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.speed", 0.66));
    TEST_SUCCESS(fluid_settings_setnum(settings, "synth.chorus.depth", 0.77));
    
    // check that the realtime settings correctly update the values in the synth
    TEST_ASSERT(fluid_synth_get_reverb_roomsize(synth) == 0.11);
    TEST_ASSERT(fluid_synth_get_reverb_damp(synth) == 0.22);
    TEST_ASSERT(fluid_synth_get_reverb_width(synth) == 0.33);
    TEST_ASSERT(fluid_synth_get_reverb_level(synth) == 0.44);
    
    TEST_ASSERT(fluid_synth_get_chorus_nr(synth) == 11);
    TEST_ASSERT(fluid_synth_get_chorus_level(synth) == 0.55);
    TEST_ASSERT(fluid_synth_get_chorus_speed(synth) == 0.66);
    TEST_ASSERT(fluid_synth_get_chorus_depth(synth) == 0.77);
    
    delete_fluid_synth(synth);
    delete_fluid_settings(settings);
    
    return EXIT_SUCCESS;
}
{'fraction_non_alphanumeric': 0.12494519947391496, 'fraction_numerical': 0.024112231477422183, 'mean_word_length': 5.250684931506849, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7297442', 'n_tokens_mistral': 1803, 'n_tokens_neox': 1674, 'n_words': 222}