Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Help With Code

For general discussion related FlowStone

Help With Code

Postby Audiocave » Mon Nov 14, 2016 2:02 pm

Hi guys.

I have a schematic for a drum sequencer which will play midi notes from a plugin out to my daw. It's all fine except for when I send midi notes the CPU use goes through the roof, spikes really badly. I've done a few things to try to reduce the load like..

    - Move some of the graphics drawing for the progress update to global variables so that instead of it creating a new pen, new color, etc, etc, on every 8-16th note trigger those things are already set. That helped a tiny bit.

    - Rewrote the project to put most of my Ruby code into the main module. That helped a tiny bit.

    - Put the midi trigger code into it's own module so only the ticker triggers would be hitting that event block.

But still, it's unworkable as it is sending a midi note even one midi note while running. Assume below that the ticker is sending 0-64 for 8 bars of 8th notes and this code below triggering a single note spikes my CPU, let alone trying to fill out the grid later with multiple drum notes.

Code: Select all
def event i,v
      if @ins[0] == 8 then
            on = Midi.new 144,1,36, $triggers[@pos]
            off = Midi.new 128,1,36,100
            output 0, on
            output 0, off, t+0.25
      end
end


Here's my main module code...

Any help would be appreciated. Thanks.
Audiocave
 
Posts: 1
Joined: Tue Apr 15, 2014 9:26 pm

Re: Help With Code

Postby nix » Fri Nov 18, 2016 8:42 am

DS_RC2015.fsm
(371.93 KiB) Downloaded 824 times


Here is a sequencer I wrote, it doesn't use much cpu, but it uses a little too much RAM.
The timer itself doesn't though.

I can't see why the code snippet is too heavy, it goes slowly

If you up the schematic, maybe I or someone is keen to have a look mate
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am


Return to General

Who is online

Users browsing this forum: No registered users and 71 guests