Skip to content

Commit

Permalink
Changes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
MyBlackMIDIScore committed Aug 22, 2024
1 parent 2b64268 commit f867442
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions render/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::PathBuf;
use xsynth_core::{
channel::ChannelInitOptions,
channel_group::{ChannelGroupConfig, ParallelismOptions, SynthFormat, ThreadCount},
soundfont::{Interpolator, SoundfontInitOptions},
soundfont::{EnvelopeCurveType, EnvelopeOptions, Interpolator, SoundfontInitOptions},
AudioStreamParams, ChannelCount,
};

Expand Down Expand Up @@ -91,9 +91,9 @@ impl State {
.long("disable_fade_out")
.help("Disables fade out when killing a voice. This may cause popping.")
.action(ArgAction::SetFalse),
Arg::new("linear release")
.long("linear_release")
.help("Use a linear release phase in the volume envelope.")
Arg::new("linear envelope")
.long("linear_envelope")
.help("Use a linear decay and release phase in the volume envelope.")
.action(ArgAction::SetTrue),
Arg::new("interpolation")
.short('I')
Expand Down Expand Up @@ -152,10 +152,23 @@ impl State {
sf_options: SoundfontInitOptions {
bank: None,
preset: None,
linear_release: matches
vol_envelope_options: if matches
.get_one("linear release")
.copied()
.unwrap_or_default(),
.unwrap_or_default()
{
EnvelopeOptions {
attack_curve: EnvelopeCurveType::Exponential,
decay_curve: EnvelopeCurveType::Exponential,
release_curve: EnvelopeCurveType::Exponential,
}
} else {
EnvelopeOptions {
attack_curve: EnvelopeCurveType::Exponential,
decay_curve: EnvelopeCurveType::Linear,
release_curve: EnvelopeCurveType::Linear,
}
},
use_effects: true,
interpolator: matches
.get_one("interpolation")
Expand Down

0 comments on commit f867442

Please sign in to comment.