1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Counter tempo limitation?

Discussion in 'REAKTOR' started by jue, May 14, 2020.

  1. jue

    jue NI Product Owner

    Messages:
    38
    Hello,
    is there a limitation for the counter module, because at 120 BPM 96th the counter stops working. Switching back to 64th it counts again. Like to count at very high speeds for some massive calculations in my new blocks.
    Possible there is a counter within Core?
    Thank you
    jk
     
  2. colB

    colB NI Product Owner

    Messages:
    3,969
    A core counter is trivial to make. Here's a basic one:
    counter.PNG
    I use that a lot for debugging (counting events)
    For 'real world' applications, you would probably add some sort of reset facility, maybe a 'step' value... whatever.
    It will work with events at any rate, up to audio rate (and beyond with some additional oversampling trickery)

    FWIW, if you are building Blocks, you should really be limiting Primary code to GUI and anything that's not possible in core. The Core standard requires all signals including control signals to be audio rate streams - that's not really practical in Primary. The only exception is GUI stuff which should be latched using the display clock for efficiency.
     
    • Like Like x 1
  3. jue

    jue NI Product Owner

    Messages:
    38
    Thank you for the example!
    What I got is this:
    Bildschirmfoto 2020-05-14 um 21.56.02.png

    And I have no idea how to change the outport.
    May I ask you to make me an example with reset and send the file?

    Tried a Clock at the in and a numeric at the output but no without response.
    I am really new to core, so much things to learn.....
     
    • Funny Funny x 1
  4. Michael O'Hagan

    Michael O'Hagan NI Product Owner

    Messages:
    1,163
    you've got a multiply instead of an add module, so that won't work, and there is a factory core counter, just hit enter and type "counter", it should come up.
     
    • Like Like x 1
  5. colB

    colB NI Product Owner

    Messages:
    3,969
    Hmm, that doesn't work for me - and when I search the core library manually, there's no counter module. My library might be out of date, but not extremely so, I've got most of the recent stuff as far as I'm aware?
     
  6. Michael O'Hagan

    Michael O'Hagan NI Product Owner

    Messages:
    1,163
    I think it's one of those things that was in R5 and then they took it out for some reason.

    here...




    Edit: I just checked and it's listed in the R5 manual, I always hate when they remove useful stuff without replacing it with a newer, preferably better alternative.

    thankfully I keep all of my core cells/macros in my user library so its not overwritten on updates.
     

    Attached Files:

  7. jue

    jue NI Product Owner

    Messages:
    38
    Thanks a lot!
    Is there an example to reset the counter after x steps with out this nasty event loop?
     
  8. Michael O'Hagan

    Michael O'Hagan NI Product Owner

    Messages:
    1,163
    an event loop inside of a core cell isn't really a big deal, but an event loop in primary with a core cell in the event chain is not allowed.

    Here's a counter that resets at 100.
     

    Attached Files:

    • Like Like x 1
  9. Paule

    Paule NI Product Owner

    Messages:
    7,555
  10. colB

    colB NI Product Owner

    Messages:
    3,969
  11. Paule

    Paule NI Product Owner

    Messages:
    7,555
    Oh - my fault - please excuse me that I use primary and core in my monsters.
     
  12. colB

    colB NI Product Owner

    Messages:
    3,969
    Yes, it's in the R5 Core library.

    I think it was a good choice to remove it. In my experience, counting is so often a thing that better when incorporated into other OBC processes rather than as a separate module. It's more flexible, more efficient and can be tailored to the situation rather than having to use workarounds to fix problems resulting in using a Library function.
    It's also so trivial to implement that and so rarely required as a stand-alone function that it really doesn't make sense as a Library component. Much better to get used to working directly with OBC.
     
  13. colB

    colB NI Product Owner

    Messages:
    3,969
    Everyone uses Primary.
    The discussion was specifically about the fact the the Primary counter doesn't work for the OP's problem.
     
  14. colB

    colB NI Product Owner

    Messages:
    3,969
    If you build it in core, you can avoid the event loops - something like this:
    counter2.PNG

    Try to build this yourself using the core library. Then try to understand it with reference to the manual. This kind of process is a really good way to learn how to work with core. If you really understand this, you're pretty much there.
     

    Attached Files: