sharing will be fun: optimisation help needed for a graphic step sequencer

    Apr 24 2009 | 9:49 am
    Dear all
    I have this lovely basic step sequencer, which freaks my computer out (even in overdrive mode)... I think it is the itterative redraw of the squares, or maybe the iterative implementation of the pattr handling, but before redoing it differently, I'd like some help from some (most) of you who are much more experienced coders...
    I've attached both the js code and pasted a test file below
    thanks or your input

    • Apr 27 2009 | 5:36 pm
      a shameful bump, with some more info...
      I have removed the all the pattr stuff (notifyclient() and all) and it does not change the efficiency.
      I have change the number of squares (from 5 tracks of 32 clicks to 2 tracks of 16) and it does help a little, but it is still hiccupping when clicked...
      Any help from a good javascripter is welcome.
    • Apr 28 2009 | 6:54 pm
      Cher Nicolas
      Thanks for this, there is still some problem with your suggestions:
      1) using JS offline to fill a coll will not allow proper pattr interpolation (which is important for the use I do)
      2)matrixctrl is not allowing staccato (consecutive cells to be on without being continuous)
      3)drawing just the selected shapes (with a sort of dirty flag) could be an option, but I will have to look into partial erasing. I could keep the cursor that way as well, redrawing only 10 cells... or maybe dismiss it as you suggest.
      Anyway, thanks for taking the time to reply, and I'll try the option 3 and keep people posted (and asking for more help
    • Apr 28 2009 | 7:01 pm
      I also tried to open badaboum.tutorial and I have a blank, locked patcher, with MaxOS10.4.11, Max5.0.7 with Jitter. No error message,just nothing!
      What am I supposed to see?
    • Apr 29 2009 | 7:45 am
      ok, got it to work, this is nice work!
      I've open the js and doing it in jitter is a good idea (joined with the independent editing) maybe I could handle the pattr in another object...
      I'll continue my explorations
    • Apr 29 2009 | 9:10 am
      ok, here goes v.0.2
      - now only the clicked cells are updated graphically - I've pushed my querying method to the scheduler thread
      Any other input is more than welcome
      ps use the same test patch above
    • Apr 29 2009 | 9:12 am
    • Apr 30 2009 | 1:22 pm
      It would be possible to just use [matrixctrl]. You just need to set it so that each square has 3 values, on, off and joined, then create your own custom picture to show these states. You can then use the "clickvalue" message to decide which to use (for example normal click to add, shift+click to delete). You might need to analyse which is the last location on each row to be selected and whether it has been added or removed and then change the click state to make it look tidier. You can then read through using the "getcolumn" message. Perhaps using a semi-transparent [slider] placed over the top to be your cursor.
      I'll see if I can piece an example together for you when I get back from work.
    • May 01 2009 | 7:51 am
      thanks for this
      The only problem I can see with this is when you click in the middle of a long bar to chop it, you will not be able to update the previous square to and ending one...
      but I'll give it a go