Re: [LAU] Sequencer suggestions?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-user@...>
Date: Tuesday, August 26, 2014 - 4:06 pm

On Tue, Aug 26, 2014 at 05:20:24PM +0200, Philipp √úberbacher wrote:

> Thanks Fons, much appreciated. It seems the original author didn't

The following patches seem to fix the problem. They remove the
(inoperative) per patch DC blocker and add one per voice, just
after the oscillators. More testing may be required.

--- engine.h.orig 2013-01-13 08:18:49.000000000 +0100
+++ engine.h 2014-08-26 17:18:13.514909324 +0200
@@ -84,9 +84,7 @@
sample_t bps; /* beats per second */
sample_t out1; /* output sample 2 */
sample_t out2; /* output sample 1 */
-#ifdef ENABLE_DC_REJECTION_FILTER
- sample_t dcR_const;
-#endif
+ sample_t wdcf;
} GLOBAL;

@@ -105,6 +103,8 @@
int portamento_sample; /* sample number within portamento */
int portamento_samples; /* portamento time in samples */
int age; /* voice age, in samples */
+ sample_t dcf1; /* DC filter state 1 */
+ sample_t dcf2; /* DC filter state 2 */
sample_t out1; /* output sample 1 */
sample_t out2; /* output sample 2 */
sample_t amp_env; /* smoothed final output of env generator */

--- engine.c.orig 2013-01-13 08:18:49.000000000 +0100
+++ engine.c 2014-08-26 17:54:29.301481175 +0200
@@ -193,9 +193,7 @@

/* (-3dB @ 20Hz) DC blocking filter */
/* 1.0 - (M_PI * 2 * freq / (sample_t) f_sample_rate) */
-#ifdef ENABLE_DC_REJECTION_FILTER
- global.dcR_const = 1.0 - (125.6 / (sample_t) f_sample_rate);
-#endif
+ global.wdcf = 125.7 / (sample_t) f_sample_rate;
}

@@ -487,6 +485,10 @@
voice->midi_key = -1;
voice->keypressed = -1;

+ /* init dc filters */
+ voice->dcf1 = 0.0;
+ voice->dcf2 = 0.0;
+
/* initialize moog filters */
voice->filter_y1_1 = 0.0;
voice->filter_y1_2 = 0.0;
@@ -780,10 +782,6 @@
run_part(PART *part, PATCH_STATE *state, unsigned int part_num)
{
unsigned int osc;
-#ifdef ENABLE_DC_REJECTION_FILTER
- sample_t tmp1;
- sample_t tmp2;
-#endif

/* generate amplitude envelopes for all voices */
run_voice_envelopes(part, state, part_num);
@@ -842,19 +840,6 @@
if (state->delay_mix_cc) {
run_delay(get_delay(part_num), part, state);
}
-
- /* output this sample to the buffer */
-#ifdef ENABLE_DC_REJECTION_FILTER
- tmp1 = part->out1;
- part->out1 = part->out1 - part->dcR_in1 + global.dcR_const * part->dcR_out1;
- part->dcR_in1 = tmp1;
- part->dcR_out1 = part->out1;
-
- tmp2 = part->out2;
- part->out2 = part->out2 - part->dcR_in2 + global.dcR_const * part->dcR_out2;
- part->dcR_in2 = tmp2;
- part->dcR_out2 = part->out2;
-#endif
}

@@ -1300,6 +1285,12 @@
run_osc(voice, part, state, osc);
}

+ /* apply DC filters */
+ voice->dcf1 += global.wdcf * (voice->out1 - voice->dcf1);
+ voice->out1 -= voice->dcf1;
+ voice->dcf2 += global.wdcf * (voice->out2 - voice->dcf2);
+ voice->out2 -= voice->dcf2;
+
/* oscs are mixed. now apply AM oscs. */
for (osc = 0; osc < NUM_OSCS; osc++) {
if (state->osc_modulation[osc] == MOD_TYPE_AM) {

--
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] Sequencer suggestions?, Philipp , (Tue Aug 26, 12:09 pm)
Re: [LAU] Sequencer suggestions?, Harry van Haaren, (Tue Aug 26, 10:30 pm)
Re: [LAU] Sequencer suggestions?, Dave Phillips, (Tue Aug 26, 2:13 pm)
Re: [LAU] Sequencer suggestions?, Will Godfrey, (Tue Aug 26, 4:48 pm)
Re: [LAU] [Bulk] Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 12:40 pm)
Re: [LAU] [Bulk] Sequencer suggestions?, Philipp , (Tue Aug 26, 1:20 pm)
Re: [LAU] [Bulk] Sequencer suggestions?, Harry van Haaren, (Tue Aug 26, 10:24 pm)
Re: [LAU] [Bulk] Re: [Bulk] Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 1:41 pm)
Re: [LAU] [Bulk] Re: [Bulk] Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 1:47 pm)
Re: [LAU] [Bulk] Re: [Bulk] Sequencer suggestions?, Fons Adriaensen, (Tue Aug 26, 2:08 pm)
Re: [LAU] Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 2:40 pm)
Re: [LAU] Sequencer suggestions?, Fons Adriaensen, (Tue Aug 26, 3:13 pm)
Re: [LAU] [Bulk] Re: Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 3:27 pm)
Re: [LAU] Sequencer suggestions?, Philipp , (Tue Aug 26, 3:20 pm)
Re: [LAU] Sequencer suggestions?, Fons Adriaensen, (Tue Aug 26, 4:06 pm)
Re: [LAU] [Bulk] Re: Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 4:16 pm)
Re: [LAU] [Bulk] Re: Sequencer suggestions?, Fons Adriaensen, (Tue Aug 26, 4:23 pm)
[LAU] Update Phasex: Sequencer suggestions?, Ralf Mardorf, (Thu Aug 28, 9:07 pm)
Re: [LAU] Update Phasex: Sequencer suggestions?, Ralf Mardorf, (Thu Aug 28, 9:29 pm)
Re: [LAU] Update Phasex: Sequencer suggestions?, Philipp , (Fri Aug 29, 11:02 am)
Re: [LAU] Update Phasex: Sequencer suggestions?, Ralf Mardorf, (Sun Aug 31, 1:16 pm)
Re: [LAU] Update Phasex: Sequencer suggestions?, Philipp , (Mon Sep 1, 2:46 pm)
Re: [LAU] Update Phasex: Sequencer suggestions?, Ralf Mardorf, (Mon Sep 1, 3:51 pm)
Re: [LAU] [Bulk] Re: [Bulk] Re: Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 4:36 pm)
Re: [LAU] [Bulk] Re: [Bulk] Re: Sequencer suggestions?, Fons Adriaensen, (Tue Aug 26, 7:12 pm)
Re: [LAU] Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 4:59 pm)
Re: [LAU] Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 5:09 pm)
Re: [LAU] Sequencer suggestions?, michael noble, (Tue Aug 26, 3:28 pm)
Re: [LAU] [Bulk] Re: Sequencer suggestions?, Ralf Mardorf, (Tue Aug 26, 4:02 pm)