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

Help setting up conditional routing

Discussion in 'REAKTOR' started by mbira, Feb 15, 2017.

  1. mbira

    mbira NI Product Owner

    Messages:
    114
    Hi folks,
    I'm trying to figure out how to achieve something and hoping for someone to point me in the right direction. I'm primarily using blocks, but I have a feeling I will need to dive into some primary or core to achieve this (and I am NOT good with those!)....

    I have a bunch of CV pitches being generated randomly from a sequencer in blocks. I want to set up a conditional where if a pitch is played then if the next pitch is lower it will go to one output, but if it is higher it will go to a different output. Also, I want it to remember the lowest note played as the low note to compare to. So in other words, the "low" output will only output lower and lower notes (actually, ideally it will only output 'equal to or lower notes') until it reaches a pitch that I have defined to jump back up to a predefined high note.

    So basically, I need something like a router that will hold in memory the lowest note played and then when it reaches a certain threshold it will jump back up. Any tips?
     
  2. mbira

    mbira NI Product Owner

    Messages:
    114
    In pseudo code, I am trying to do this:

    note # threshold = 10;
    note number = n;
    x=10;


    if (n<=x) {
    go to output 1;
    x=n;
    if (x = 0) {
    x=10;
    }
    }
    else {
    go to output 2;
    }
     
  3. mbira

    mbira NI Product Owner

    Messages:
    114
    Attached is what I have so far. This will output to the event watcher the midi notes and they will go lower and lower until about midi #36 (depending on how you set the center pitch). I just can't figure out how to reset the threshold to 50 once the note has gotten down to 36.
     

    Attached Files:

  4. Jonathan Tremblay

    Jonathan Tremblay NI Product Owner

    Messages:
    402
    Not sure how CV sends pitch in terms of value of ranges, however I have made this, idk if it'll work but anyhow you'll have a starting point. Or we could expand upon it.

    Knobs have a range from 0-127

    Edit: Just fixed a quick bug, should work as intended now.
     

    Attached Files:

    Last edited: Feb 16, 2017
    • Like Like x 1
  5. mbira

    mbira NI Product Owner

    Messages:
    114
    Thanks Jonathan. Checking out out now!
     
  6. mbira

    mbira NI Product Owner

    Messages:
    114
    Jonathan-what sort of input can i use for the "Pitch"? I am able to use a constant, but the pitch output from a sequencer or OSC is not able to connect to the pitch input of your patch. Ideally, I want to be able to hook up the output of one of the Reaktor Blocks sequencers to the Pitch.

    EDIT: ok, I see I can use something like a MIDI note in module to feed to this patch. Does anyone know how to convert the output of the 8 step sequencer to be in a format that can be used in the same way that the Note In module outputs?
     
    Last edited: Feb 16, 2017
  7. Ken88

    Ken88 NI Product Owner

    Messages:
    194
    @mbira - one of the most important differences between blocks and the rest of Reaktor is that in blocks pitch ranges from 0 - 1 and in the rest of Reaktor pitch ranges from 0 to 127. In blocks, note 60 = .5 and there is a 1/120 = 0.0083333 interval between notes in blocks.

    Hope this helps!
     
  8. mbira

    mbira NI Product Owner

    Messages:
    114
    Thanks @Ken88. That does help. So then for usable note numbers I would think something like a multiplier bloc that multiplies every value coming in by 120 would do the trick, but when I plug the pitch output of the 8-step sequencer block into a multiplier with a constant of 120 on the other input of the multiplier, the 8-step sequencer input just says "inactive" while in debug. But if I hook the pitch output to an OSC, I get pitches....
     
  9. Jonathan Tremblay

    Jonathan Tremblay NI Product Owner

    Messages:
    402
    Oh, yeah. sorry.

    I just made the splitter as a test, you need to feed it 0-127 pitch for resutls, however to make it a block would require just a little more work.

    I'll get to it after dinner.
     
  10. Ken88

    Ken88 NI Product Owner

    Messages:
    194
    @mbira - everything in blocks is designed to have inputs and outputs of 0 to 1 to make the system more modular and allow anything to modulate anything else. That is why the block step sequencer will output 0 to 1.

    It can get confusing if you try to use the block sequencer to drive an old non-block synth like Carbon (or an external synth in your DAW), since the old synth will expect a pitch input of 0 -127. Similarly, an old sequencer like Spiral will have a pitch output of 0 to 127. The new OSC blocks like Monark will expect a pitch of 0 to 1.

    But eventually you will get used to the conventions ;)
     
  11. Jonathan Tremblay

    Jonathan Tremblay NI Product Owner

    Messages:
    402
    @mbira Tell me if this works, takes in 0-1 values, and outputs 0-1.
     

    Attached Files:

  12. mbira

    mbira NI Product Owner

    Messages:
    114
    Thanks so much, @Jonathan Tremblay. I hate to say that I don't seem to be able to get it to work. When I bypass the compare, the sequencer is outputting pitch, but when I plug in the compare, I just get a low note sounding. I am attaching the full patch with the sequencers to show you what I'm doing...

    The forum is not letting me upload the file here, so here it is:
    http://rattletree.com/delete/testing_compare.ens.zip
     
    Last edited: Feb 16, 2017
  13. Jonathan Tremblay

    Jonathan Tremblay NI Product Owner

    Messages:
    402
    Wait, I just realized something is off..

    Fixing atm.
     
  14. Jonathan Tremblay

    Jonathan Tremblay NI Product Owner

    Messages:
    402