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

pick random sample

Discussion in 'Building With Reaktor' started by JAMCPH, Apr 28, 2014.

  1. JAMCPH

    JAMCPH Member

    Messages:
    48
    Hi. I am new to reactor and I am trying to build a sampler with a few twists. I am using the memory drum ensemble and modifying it. Is there any way to randomly select a sample from the sample pool upon receiving a midi note?
    How would i go about building that?
    Im guessing i somehow can access the sampleppol and then have a sample/hold thingie to be activated once a midi event is received. Then if s/h output=3 - sample nr 3 would be chosen. If s/h =5, samples nr 5 would be chosen… or maybe there is some completely different way to do this.
    Thanks a lot!
     
  2. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    just use the randomize module. you give it a value and a range - you could give a value of 0.5, a range of 0.5, and multiply the output by 127 to get a value between 0 and 127.
     
  3. JAMCPH

    JAMCPH Member

    Messages:
    48
    Thanks. I just have to locate where in the world the actual menu for selecting samples is located:) you wouldn't happen to know the memory drum module by chance? I'll have another look tomorrow and see if I can figure it out.
    Thanks again:)
     
  4. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    most of the sampling modules have a 'Sel' input. the ones that don't control the sample using the 'P' input.
     
  5. JAMCPH

    JAMCPH Member

    Messages:
    48
    Thanks i located where to "hack" the sampler, but i don't really follow your logic with "value" and "range".. Could you please explain?
    thanks a ton:)
     
  6. John6455

    John6455 Member

    Messages:
    102
    The primary randomizer module sends an event when it receives a value. If you set the range as 0.5, then send it a value of 0.5, it will output a value of 0.5 +/- 0.5. So between 0 and 1. Multiply that random value by 127, and if necessary use the quantize module to produce an integer between 0 and 127.

    Similarly, you can add and subtract, or multiply by a smaller number to produce a particular range of random values.
     
  7. JAMCPH

    JAMCPH Member

    Messages:
    48
    mehhh… sorry, I'm dumb.
    Lets get practical.
    This is the original:
    original.png

    if i modify it to this:
    knob.png
    And just control it with a knob and set the knob range to 35-40 (my samples are located from keys 35-40) i can successfully select between samples by rotating the knob.

    I want to rotate between those values… have a lower and an upper range (35-40). so each time i press, say C1 it will randomly pick one of the 5 samples and play that..

    Sorry for being and idiot, but where do i go from here?
    Thanks again:)
     
  8. JAMCPH

    JAMCPH Member

    Messages:
    48
    Ah! I got it working! Thanks a lot:)
     
  9. JAMCPH

    JAMCPH Member

    Messages:
    48
    Ok… Now lets say that i want to eliminate the option to trigger the same sample twice?
    I imagine something like this: Sample the value of the output of the random generator(generated upon key pressed). Check that value against a new randomly generated value (key pressed again). If former and new value are equal=+1 to the newest sample. How do i do that with the modules? thanks again!