moxi Posted August 23, 2006 Report Posted August 23, 2006 Hi,i'm starting to play with the analog toolbox app but before spending many hours to program what i need, i want to be sure that what i'm doing won't lead to performance issue:so, it's what i've done for the while:instead of a static configuration, the Aouts can be modulated by all available source (midi, lfo1, lfo2, eg, pot) depending on a din event (to make it more clear: you press a buton to select from which source the Aout will be modulated )here is a portion of the code i've started (it works): // AOUT #1: forward Note value of MIDI channel #9 or lfo value if ((last_din_pin) == (3) | (pin_value) == (1)){ //lfo rate is controled by CC10 channel 1 lfo1_rate = midi_cc_chn0[10]; aout_value[0] = sinewave[CONV_16BIT_TO_8BIT(lfo1_value)]; } else aout_value[0] = CONV_7BIT_TO_8BIT(midi_cc_chn0[9]);}so, does such a programmation with a lot of "if" and "else" will be nefast to realtime performancei'm planning to make the LCD always displaying which modulation is used...same question..thanks Quote
mess Posted August 23, 2006 Report Posted August 23, 2006 Hi Moxi,this looks like a nice application :)I don't think that you can avoid the if...else statementsif you want to measure the performance see this post (first answer by TK):http://www.midibox.org/forum/index.php?topic=7335.0it works fine with: void someroutine () { PORTDbits.RD4 = 1; //other code PORTDbits.RD4 = 0; } so when you connect your probe to J14 it's possible to measure the execution timethe only disadvantage is that you need a scope for this... Quote
moxi Posted August 23, 2006 Author Report Posted August 23, 2006 thanks for the answer !i don't have a scope... :( Quote
stryd_one Posted August 23, 2006 Report Posted August 23, 2006 I ?think? it was TK that recommended another method, where you can increment a counter each time the function is called, and then use a timer to send that value over MIDI at regular intervals. This way, you know that for example every 500ms your function runs N times... My twist on this method is to export the data to a file, parse the file for the rate of change of the counter, and graph it in excel. You can use multiple data sets in excel to compare the performance of different methods of code.TK has dropped a few cool hints about tweaking and monitoring performance (some of which I have in a 2 foot tall pile of printed forum pages hehehe)it'd make a good wiki page actually.... If anyone's interested, I'll search around and compile what I can find? Quote
mess Posted August 23, 2006 Report Posted August 23, 2006 i don't have a scope... :(another option is to implement a performance counter,each time the Tick() routine is executed you increment a counterthen this counter is periodically displayed and resettedfor an example, see mbfm_load.inc in the midibox FM source packagethis method gives some extra load but I think that this could be neglectedMichaël Quote
mess Posted August 23, 2006 Report Posted August 23, 2006 The WIKI page would be most helpfull as the performance topichas come up several timesa little off topic, but I think that the SRIO problemwith the debounce method and a ledmatrix would also be useful WIKI info... Quote
TK. Posted August 23, 2006 Report Posted August 23, 2006 a little off topic, but I think that the SRIO problemwith the debounce method and a ledmatrix would also be useful WIKI info...it will be obsolete as soon as I release MIOS V1.9c - I already made the required change, it was easier than expected. And now it works a little bit better, because debouncing is not applied on encoder pins anymore.I've tested it on my MBSID and MBSEQ so far, but they have perfect buttons and therefore normaly don't need debouncing anyhow. With the other MIDIboxes I will do this in the next days...Is anybody interested in helping me with testing?Best Regards, Thorsten. Quote
mess Posted August 23, 2006 Report Posted August 23, 2006 I would like to help with testing :-) Quote
TK. Posted August 23, 2006 Report Posted August 23, 2006 the release candidate is located here:http://www.ucapps.de/tmp/mios_v1_9c_rc1.zipIf you haven't updated to the new bootloader yet, you have to do this before. Thereafter update from MIOS V1.9a to this new version (the bootloader/MIOS update package will be available with the official release, because it's some additional effort for me to combine the codes and to calculate the correct CRC)The algorithm I've developed is very tricky, and I'm not 100% sure if it works in all cases (haven't tested it that much yet), so anybody who tries this out on his MIDIbox helps me a lot!Best Regards, Thorsten. Quote
moxi Posted August 24, 2006 Author Report Posted August 24, 2006 Hi TK,my seq use cheap buton, so i will test that too... Quote
docbrown Posted August 24, 2006 Report Posted August 24, 2006 TK,I will try it too on my SEQ.. I have a self made illuminated tact switch..thanks.. Quote
TK. Posted August 26, 2006 Report Posted August 26, 2006 Thanks for testing! Is it working? Then I can create the complete update package..Best Regards, Thorsten. Quote
docbrown Posted August 27, 2006 Report Posted August 27, 2006 Works great for me so far!!thanks.. Quote
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.