[chuck-users] collecting sum signal per-channel of midi-notes
Michael Heuer
heuermh at gmail.com
Fri May 9 11:15:34 EDT 2014
Peter Billam <pj at pjb.com.au> wrote:
> Greetings.
>
> ( Serious Newbie-warning :-)
>
> So: I want to work with MIDI, and implement the Great Missing
> Midi-Controller, namely a per-channel overdrive distortion
> like the foverdrive,1196 LADSPA plugin. Untested:
> fun float foverdrive_1196(float x, float drive) {
> drive - 1.0 => float drivem1;
> Std.fabs(x) => float fx;
> return x*(fx + drive)/(x*x + drivem1*fx + 1.0);
> }
>
> This means I have to get the TriOsc of the note not into a dac
> TriOsc t => dac; // NO!
> but into some code which will add it to the per-channel total.
> I guess those totals will be stored in perhaps LiSa's ?
> float cha2drive[16]; // set by nonstandard MIDI controller 87
> LiSa lisa[16]; // the per-channel total signal of all its notes
>
> But at this point I get brain-overload :-(
> How do I add the TriOsc sample to its LiSa ? How do I invoke
> foverdrive_1196() on each sample before outputting it to the dac ?
If you are going to shape a wave at sample rate, you want to use a Chugen:
class Foverdrive1196 extends Chugen {
1.0 => float drive;
fun float tick(float in) {
return ...;
}
}
Then
TriOsc t => Foverdrive1196 over => dac;
> I'm very unsure about "now", too, how it co-ordinates between
> code of all the individual notes and the final "=> dac" step,
> but still executes all these things scattered throughout the code
> in an appropriate order.
>
> Hope this makes sense...
> If I get this solved, I should become more self-maintaining...
Keep it up, this sounds interesting!
michael
More information about the chuck-users
mailing list