Jump to content

Recommended Posts

Posted

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 performance

i'm planning to make the LCD always displaying which modulation is used...same question..

thanks

Posted

Hi Moxi,

this looks like a nice application  :)

I don't think that you can avoid the if...else statements

if you want to measure the performance see this post (first answer by TK):

http://www.midibox.org/forum/index.php?topic=7335.0

it 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 time

the only disadvantage is that you need a scope for this...

Posted

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?

Posted

i don't have a scope...

:(

another option is to implement a performance counter,

each time the Tick() routine is executed you increment a counter

then this counter is periodically displayed and resetted

for an example, see mbfm_load.inc in the midibox FM source package

this method gives some extra load but I think that this could be neglected

Michaël

Posted

The WIKI page would be most helpfull as the performance topic

has come up several times

a little off topic, but I think that the SRIO problem

with the debounce method and a ledmatrix would also be useful WIKI info...

Posted
a little off topic, but I think that the SRIO problem

with 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.

Posted

the release candidate is located here:

http://www.ucapps.de/tmp/mios_v1_9c_rc1.zip

If 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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...