Beginn der weitergeleiteten Nachricht:
Datum: Sun, 1 Aug 2010 12:40:14 +0200
Von: Martin Homuth-Rosemann <linuxaudio(a)cryptomys.de>
An: James Morris <james(a)jwm-art.net>
Betreff: Re: [LAU] Connie, an organ template for JACK
Am Sat, 31 Jul 2010 23:41:52 +0100
schrieb James Morris <james(a)jwm-art.net>:
> ...
> Same problem as Foo YC 20, a lack of volume envelope. The clicks
> resulting from sudden jumps in sample amplitude make it unusable for
> me.
>
> Cheers,
> James.
Hi James,
I do apply a simple envelope to the keys to reduce the awful clicking -
it's done in connie_main.c in rt_process_cb(), starting at line 370:
--- 8< ---
// process the keys (attac/decay/release), do stop mixture
if ( ++timer > tg_sample_rate / 4000 ) { // 4 kHz -> every 250us
timer = 0;
int *p_vol = tg_vol_key + LOWNOTE; // tg_vol_key[note]
int *p_raw = midi_vol_raw + LOWNOTE;
// ramp the midi volumes up/down to remove the clicking at key
press/release
for ( int note = LOWNOTE; note < HIGHNOTE; note++,
p_vol++, p_raw++ ) { if ( *p_vol < *p_raw ) {
if ( tg_percussion ) // attack immediately up to 0..256
(*p_vol) = 256 * tg_percussion; // then decay to 64 (0..48
ms)
else
(*p_vol) += 8; // attack quick up (2 ms)
} else if ( *p_vol > *p_raw ) {
(*p_vol)--; // decay/release slow down (16 ms)
}
} // for ( note )
...
--- 8< ---
If you change the line 382
(*p_vol) += 8; // attack quick up (2 ms)
to
(*p_vol) ++; // attack slow up (16 ms)
you'll get a slower attac.
But a soft click will be leftover because your envelope is a ramp (i.e.
non bandlimited frequency range and aliasing...) and it's only integer
range 0..64. I chose the quick up / slow down because if you press a key
the starting sound will "mask" the click and you'll get a more direct
feeling - no delay between key action and playing sound. It decays more
slowly because there is no "masking" (silence). Feel free to
improve this part to your needs.
If it's still unusable for you it willbe possible to use a more complex
envelope (e.g. bandlimited step) or shorter time steps - but this will
cost more cpu because at the moment the keys were calculated every
250µs only (-> sample rate 4KHz) to reduce cpu load.
Ciao Martin
---------- Forwarded message ----------
Hi all,
Our Brussels-based organization, iMAL, is partner of the *Media Facade
Festival Europe* starting 27th of August in 7 cities (Helsinki, Berlin,
Linz, Budapest, Madrid, Liverpool and Brussels).
see: http://www.imal.org and
*http://www.mediafacades.eu*<http://www.mediafacades.eu/>
On the *3rd of September*, there is a *Live Coding Performance* initiated by
Kibu ( *http://www.kitchenbudapest.hu/en*
<http://www.kitchenbudapest.hu/en>)that should take place in every
city and being live streamed so that local
coders could respond to other coders inputs. see: *
http://www.mediafacades.eu/node/125* <http://www.mediafacades.eu/node/125>
We are still looking for live coders to take part in the Brussels node of
the event.
If you are interested and located in or near Brussels (Belgium, Nederland,
Germany, France), *send your application* to:
marie-laure(a)imal.org *before August 10th.*
*
*
Feel free to forward this call to potential interested live coders!
best,
Marie-Laure Delaby
project manager & coordinator
iMAL- Center for digital cultures and technology
http://www.imal.org
+32 2 410 30 93