moxi Posted February 4, 2007 Report Share Posted February 4, 2007 Hi,I'm workin on a CV controled filter based on the "analog toolbox" app.what I want to do is to add for each CV output some butons to select the modulation source..this part of the work is already done, I can now select which mod source is applied to the cv output (the eg, the lfo ...or the pot connected to the core... but instead of being obliged to choose between any digital mod source and the pot, I want the pot to be used as "offset", but I don't understand how to program to get two value "mixed" before sending them to the cv out : I don't want to add the two value, the pot have to set the max value that the mod source won't exceed...hope that's clear..for the while, my prog look like that: /////////////////////////////////////////////////////////////////////////// // if ((last_din_pin) == (3) | (pin_value) == (1)){ // cv 1 is driven by LFO1, the rate is modified with AIN5 lfo1_rate = midi_cc_chn0[10]; aout_value[0] = sinewave[CONV_16BIT_TO_8BIT(lfo1_value)]; } else if ((last_din_pin) == (2) | (pin_value) == (1)){ aout_value[0] = CONV_7BIT_TO_8BIT(midi_cc_chn0[9]);} else if ((last_din_pin) == (1) | (pin_value) == (1)){ aout_value[0] = CONV_7BIT_TO_8BIT(midi_cc_chn0[8]); } elseI'm not sure that adding the two value into the app is the best way, I would prefer to simply add a pot that drive directly the cv intput of my filter (i.e. that will not be sampled by the core then converted back to analog) , but I'm not sure about the way to mix two cv signal without damaging my chip (a CEM 3378).I've seen somewhere that you can mix many CV using current limiting resistor, if someone know how to do that for my chip.... Quote Link to comment Share on other sites More sharing options...
moxi Posted February 4, 2007 Author Report Share Posted February 4, 2007 ...and here a quick view of the signal flow of this filter...more option will be added one time this will be workin fine..I own an Oakley Filtrex 2 too, so maybe I will try to mix this two device in one, to be abble to choose between two type of filter (the Oakley one is really smooth -moog like- , the cem3378 is more "rough"...) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted February 4, 2007 Report Share Posted February 4, 2007 If you want to 'limit' the modulation to the pot value then you can AND them, or if you want to 'scale' the values there is example code around somewhere, I think AC's sensorizer project is using it... Hope that helps! Quote Link to comment Share on other sites More sharing options...
moxi Posted February 4, 2007 Author Report Share Posted February 4, 2007 ok, thanks, I will try to work with the AND function, I was thinking first that value will be added together with this function...I do some test and keep you informed :) Quote Link to comment Share on other sites More sharing options...
mess Posted February 5, 2007 Report Share Posted February 5, 2007 Hi Moxianother way to this is by multiplying the value with your scalar and keep the most significant byte as resultthis way: scaled_value = (scale*value)/256 _PRODL = scale; _PRODH = value; __asm movf _PRODL, w mulwf _PRODH __endasm; scaled_value = _PROD_H note: I didn't try the above code! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.