Commit 35a4a59f authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

rename final_period to period


Signed-off-by: default avatarErik Faye-Lund <kusmabite@gmail.com>
parent 29eac55d
......@@ -31,7 +31,7 @@ struct pimp_channel_state
u8 volume_command;
s32 note_period;
s32 final_period;
s32 period;
s8 volume;
u8 pan;
......
......@@ -16,31 +16,31 @@ static void porta_up(struct pimp_channel_state *chan, s32 period_low_clamp)
{
ASSERT(chan != 0);
chan->final_period -= chan->porta_speed;
if (chan->final_period < period_low_clamp) chan->final_period = period_low_clamp;
chan->period -= chan->porta_speed;
if (chan->period < period_low_clamp) chan->period = period_low_clamp;
}
static void porta_down(struct pimp_channel_state *chan, s32 period_high_clamp)
{
ASSERT(chan != 0);
chan->final_period += chan->porta_speed;
if (chan->final_period > period_high_clamp) chan->final_period = period_high_clamp;
chan->period += chan->porta_speed;
if (chan->period > period_high_clamp) chan->period = period_high_clamp;
}
static void porta_note(struct pimp_channel_state *chan)
{
ASSERT(chan != 0);
if (chan->final_period > chan->porta_target)
if (chan->period > chan->porta_target)
{
chan->final_period -= chan->porta_speed;
if (chan->final_period < chan->porta_target) chan->final_period = chan->porta_target;
chan->period -= chan->porta_speed;
if (chan->period < chan->porta_target) chan->period = chan->porta_target;
}
else if (chan->final_period < chan->porta_target)
else if (chan->period < chan->porta_target)
{
chan->final_period += chan->porta_speed;
if (chan->final_period > chan->porta_target) chan->final_period = chan->porta_target;
chan->period += chan->porta_speed;
if (chan->period > chan->porta_target) chan->period = chan->porta_target;
}
}
......@@ -64,10 +64,10 @@ static void vibrato(struct pimp_channel_state *chan, s32 period_low_clamp, s32 p
-180, -161, -141, -120, -97, -74, -49, -24
};
chan->final_period = chan->note_period + (sine_waveform[chan->vibrato_counter & 63] * chan->vibrato_depth) / 32;
chan->period = chan->note_period + (sine_waveform[chan->vibrato_counter & 63] * chan->vibrato_depth) / 32;
if (chan->final_period < period_low_clamp) chan->final_period = period_low_clamp;
if (chan->final_period > period_high_clamp) chan->final_period = period_high_clamp;
if (chan->period < period_low_clamp) chan->period = period_low_clamp;
if (chan->period > period_high_clamp) chan->period = period_high_clamp;
chan->vibrato_counter += chan->vibrato_speed;
}
......
......@@ -76,7 +76,7 @@ static void note_on(const struct pimp_mod_context *ctx, struct pimp_mixer_channe
chan->note_period = pimp_get_amiga_period(((s32)chan->note) + chan->sample->rel_note, chan->sample->fine_tune);
}
chan->final_period = chan->note_period;
chan->period = chan->note_period;
}
}
......@@ -454,11 +454,11 @@ static void pimp_mod_context_update_row(struct pimp_mod_context *ctx)
{
if (ctx->mod->flags & FLAG_LINEAR_PERIODS)
{
mc->sample_cursor_delta = pimp_get_linear_delta(chan->final_period, ctx->delta_scale);
mc->sample_cursor_delta = pimp_get_linear_delta(chan->period, ctx->delta_scale);
}
else
{
mc->sample_cursor_delta = pimp_get_amiga_delta(chan->final_period, ctx->delta_scale);
mc->sample_cursor_delta = pimp_get_amiga_delta(chan->period, ctx->delta_scale);
}
}
......@@ -625,11 +625,11 @@ static void pimp_mod_context_update_tick(struct pimp_mod_context *ctx)
{
if (ctx->mod->flags & FLAG_LINEAR_PERIODS)
{
mc->sample_cursor_delta = pimp_get_linear_delta(chan->final_period, ctx->delta_scale);
mc->sample_cursor_delta = pimp_get_linear_delta(chan->period, ctx->delta_scale);
}
else
{
mc->sample_cursor_delta = pimp_get_amiga_delta(chan->final_period, ctx->delta_scale);
mc->sample_cursor_delta = pimp_get_amiga_delta(chan->period, ctx->delta_scale);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment