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

Random Note Generator -- never seems to send note off?

Discussion in 'Building With Reaktor' started by chaircrusher2, Sep 25, 2015.

  1. chaircrusher2

    chaircrusher2 NI Product Owner

    Messages:
    155
    This seems to behave oddly. I'd expect it to send out a stream of MIDI notes but it seems to send note on without note off. If I capture the midi, the notes begin but they only end if the same note is triggered again.

    randomNoteSource.jpg
     

    Attached Files:

  2. colB

    colB NI Product Owner

    Messages:
    3,969
    Haven't done any testing, but looking at the code, I see that the pitch is being updated by an audio rate process while the Gate is being controlled by an event rate process. The result is that the Clk output will trigger a change in pitch within a sample tick of the exact update time, while the Gate could be waiting for most of a control rate tick before its value is updated. This means that in most cases, the pitch is updated before the note of event is generated, so the code attempts to switch off the wrong MIDI note (unless the new note is the same as the old one).
     
  3. chaircrusher2

    chaircrusher2 NI Product Owner

    Messages:
    155
    That sounds plausible; so the solution would be to trigger them both at control rate? Should I use an Order Module so the Pitch is set before the trigger, or vice versa?
     
  4. chaircrusher2

    chaircrusher2 NI Product Owner

    Messages:
    155
    Tried to take your suggestion about making sure the pitch and gate are both event rate. This doesn't fix the note off problem.

    I wonder about the pulse width of the Geiger pulses. Is that causing a problem?
    reaktorRNG.jpg
     

    Attached Files:

  5. colB

    colB NI Product Owner

    Messages:
    3,969
    Not sure that Geiger pulses have width. Here's a version using a flipflop so that each Geiger event toggles between noteOff and noteOn.
     

    Attached Files:

  6. PIANOPICTURES

    PIANOPICTURES NI Product Owner

    Messages:
    552
    Hi, I think the problem is that G input on the Note module need a real gate signal with both value on state and then(!) a zero state. Geiger seems to send only a momentary event with no time for off state. The possible fix is to insert a Hold module or a H-Env module or some delay module for delaying sending 0 via Value module + Event Merge.

    Added: we answered almost at the same time ColB :D
     
  7. John6455

    John6455 Member

    Messages:
    102
    For such things I would use the control rate hold module. Every time you send a new note on message, use an order module to send a gate of zero to end the current pitch value at the MIDI out module before sending a new pitch message to it.