structural help please!


    Jun 14 2006 | 3:37 pm
    Hey there,
    been working hard on this bit of patch which will be used as a tracking system for music patterns.
    Basically a list of numbers determines certain sounds that get played. If a zero is located in the list, it will play nothing for that bar (this patcher is hooked to a metro system).
    I am implementing a feature where if a person makes a mistake, they can choose any number in the list to 'delete' which will set that box to zero.
    If they then choose to place another pattern in, i wish that the pattern number be placed in the list, from left to right, overwriting the first zero it finds. The cases and problem will be listed below (with examples)
    Pattern number 'injected' = 9
    Pattern contents: 1 2 3 4 5 6
    What happens: Nothing. This is good, because the list is full.
    Pattern number 'injected' = 9
    Pattern contents: 1 2 3 0 5 6
    What happens: List is replaced with 1 2 3 9 5 6. This is good.
    Pattern number 'injected' = 9
    Pattern contents: 1 2 3 4 5 0
    What happens: Nothing. list gets sent to zero_on_end (i will be implementing this feature soon/now.
    Pattern number 'injected' = 9
    Pattern contents: 1 2 0 0 5 6
    What happens: List is replaced by 1 2 0 9 5 6. Here is the problem! We should have ended up with 1 2 9 0 5 6, but the zero is on the other side.
    I believe the problem has to do with the calculation of splitting the lists (near the zl slice functions) and maybe has something to do with the '- 1' function. However, i am not sure how i can modify what i have here to get the correct result if two zero's are present, without disrupting the existing 3 cases.
    This makes my brain hurt.. I will keep at it, but the patcher is listed below if anyone could try and provide a solution i would hugely appreciate it.
    Patcher is included in msp file and text.
    Regards,
    n00ds
    -------------------------
    max v2;
    -----------------

    • Jun 14 2006 | 4:36 pm
      never mind, crisis over! forgot what my actual concept was. 3 part 56 command pile of junk replaced by 1 20 command subroutine. :D
    • Jun 14 2006 | 8:01 pm
      I like that. Don't worry, my brain hurts most of the time as well.
    • Jun 17 2006 | 8:02 am
      seb wrote:
      > never mind, crisis over! forgot what my actual concept was. 3 part 56
      > command pile of junk replaced by 1 20 command subroutine.
      Aah, you switched to a state of real creativity... Love it!
      Stefan
      --
      Stefan Tiedje------------x-------
      --_____-----------|--------------
      --(_|_ ----|-----|-----()-------
      -- _|_)----|-----()--------------
      ----------()--------www.ccmix.com