julienvoirin Posted October 18, 2007 Report Share Posted October 18, 2007 HiI would like to code a LFO with different waveforms (sin, square, saw for example) in order to modulate a CC value.It would be sync to the BPM received by the midi In.It seems that Audiocommander did something to get the bpm with the clockbox.Any other idea ?Cheers Quote Link to comment Share on other sites More sharing options...
audiocommander Posted October 18, 2007 Report Share Posted October 18, 2007 Hi julienvoirin,to get the BMP is a relatively trivial task; if you're working with a master, the current version of the clockBox is already implementing everything. I did some slave-extensions to the code as well.To generate a square or saw waveform should be no prob: you just have to set up a timer (or use the relevant functions in the clockBox example) and change the form appropriately.Generating a sinus wave in C - however sounds like trouble to me, because (as you surely know), there are no highLevel mathmatical functions on the PIC. So I guess you have to find some ASM-optimized code for this (MB SID? MB FM?). Dunno if something helpful can be found in the lib; but I'm no friend of this lib anyway, because it blows up your code dramatically - and I'm not sure if it's as efficient as it should be.Hope this helpsbest,Michael Quote Link to comment Share on other sites More sharing options...
julienvoirin Posted October 18, 2007 Author Report Share Posted October 18, 2007 thnaks for a so fast replyslave-extensions the clockbox must be sync to the BPM. I 'll dig onto your code.some ASM-optimized code for this (MB SID? MB FM?)hardcore ! but good ideacan be found in the libwhat is this lib ? sdcc ?thanks again Quote Link to comment Share on other sites More sharing options...
bill Posted October 18, 2007 Report Share Posted October 18, 2007 http://ucapps.de/mios/mios_libsdcc_v2_5_0.zip Quote Link to comment Share on other sites More sharing options...
stryd_one Posted October 18, 2007 Report Share Posted October 18, 2007 I would look to two places - MIOS code, and piclist.com Quote Link to comment Share on other sites More sharing options...
TK. Posted October 19, 2007 Report Share Posted October 19, 2007 It's better to generate the sine wave table-basedThe analog toolbox has some code for this, you can easily create any periodic waveform (just have a look into lfo.c and map.c)Best Regards, Thorsen. Quote Link to comment Share on other sites More sharing options...
audiocommander Posted October 19, 2007 Report Share Posted October 19, 2007 Brilliant! azz- I ought to think of lookup-tables in my first post... Cheers,Michael :) 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.