void soundfonts_chorus_n(t_soundfonts *instance, t_floatarg amount) { fluid_synth_set_chorus(instance->synth, amount, instance->chorus_level, instance->chorus_speed, instance->chorus_depth, instance->chorus_type); instance->chorus_nr = amount; }
int MidiDriver_FluidSynth::open() { if (_isOpen) return MERR_ALREADY_OPEN; if (!ConfMan.hasKey("soundfont")) error("FluidSynth requires a 'soundfont' setting"); _settings = new_fluid_settings(); // The default gain setting is ridiculously low - at least for me. This // cannot be fixed by ScummVM's volume settings because they can only // soften the sound, not amplify it, so instead we add an option to // adjust the gain of FluidSynth itself. double gain = (double)ConfMan.getInt("midi_gain") / 100.0; setNum("synth.gain", gain); setNum("synth.sample-rate", _outputRate); _synth = new_fluid_synth(_settings); if (ConfMan.getBool("fluidsynth_chorus_activate")) { fluid_synth_set_chorus_on(_synth, 1); int chorusNr = ConfMan.getInt("fluidsynth_chorus_nr"); double chorusLevel = (double)ConfMan.getInt("fluidsynth_chorus_level") / 100.0; double chorusSpeed = (double)ConfMan.getInt("fluidsynth_chorus_speed") / 100.0; double chorusDepthMs = (double)ConfMan.getInt("fluidsynth_chorus_depth") / 10.0; Common::String chorusWaveForm = ConfMan.get("fluidsynth_chorus_waveform"); int chorusType = FLUID_CHORUS_MOD_SINE; if (chorusWaveForm == "sine") { chorusType = FLUID_CHORUS_MOD_SINE; } else { chorusType = FLUID_CHORUS_MOD_TRIANGLE; } fluid_synth_set_chorus(_synth, chorusNr, chorusLevel, chorusSpeed, chorusDepthMs, chorusType); } else { fluid_synth_set_chorus_on(_synth, 0); } if (ConfMan.getBool("fluidsynth_reverb_activate")) { fluid_synth_set_reverb_on(_synth, 1); double reverbRoomSize = (double)ConfMan.getInt("fluidsynth_reverb_roomsize") / 100.0; double reverbDamping = (double)ConfMan.getInt("fluidsynth_reverb_damping") / 100.0; int reverbWidth = ConfMan.getInt("fluidsynth_reverb_width"); double reverbLevel = (double)ConfMan.getInt("fluidsynth_reverb_level") / 100.0; fluid_synth_set_reverb(_synth, reverbRoomSize, reverbDamping, reverbWidth, reverbLevel); } else { fluid_synth_set_reverb_on(_synth, 0); } Common::String interpolation = ConfMan.get("fluidsynth_misc_interpolation"); int interpMethod = FLUID_INTERP_4THORDER; if (interpolation == "none") { interpMethod = FLUID_INTERP_NONE; } else if (interpolation == "linear") { interpMethod = FLUID_INTERP_LINEAR; } else if (interpolation == "4th") { interpMethod = FLUID_INTERP_4THORDER; } else if (interpolation == "7th") { interpMethod = FLUID_INTERP_7THORDER; } fluid_synth_set_interp_method(_synth, -1, interpMethod); const char *soundfont = ConfMan.get("soundfont").c_str(); _soundFont = fluid_synth_sfload(_synth, soundfont, 1); if (_soundFont == -1) error("Failed loading custom sound font '%s'", soundfont); MidiDriver_Emulated::open(); _mixer->playStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); return 0; }
void sf2Instrument::updateChorus() { fluid_synth_set_chorus( m_synth, static_cast<int>( m_chorusNum.value() ), m_chorusLevel.value(), m_chorusSpeed.value(), m_chorusDepth.value(), 0 ); }
void soundfonts_chorus_type(t_soundfonts *instance, t_floatarg type) { fluid_synth_set_chorus(instance->synth, instance->chorus_nr, instance->chorus_level, instance->chorus_speed, instance->chorus_depth, type); instance->chorus_type = type; }