i wish the random number module had an option for no repeat

yes, that's what i wish!

Comments

  • That’s not how random works. I don’t know what you want to achieve but you‘re probably looking at it from the wrong perspective.

    Random can and must eventually repeat values, what a good random generator does is assure there’s a normal distribution, so one value on average has the same probability as any other value

    It also has a seed used to start from, since it’s not real random but pseudo-random (meaning the same starting seed will always generate the same pseudo random values). So if you want different random sequences then randomize the seed to begin with

    but your request is very vague without further explanation

  • sorry, i thought assumed this a standard.

    i know it from max for example

    and also in puredata

    its named " else/rand.u" there

    and in a recent idea i had and wanted to build in drambo, i missed this option.

    that made and still makes me wish...

    :)

  • I’ll have to take a look into that but I love the subject

    the only way I know of programming a non-repeatable random is through brute force

    Say you want random card shuffle: have 52 card slots, then keep asking for random numbers and only fill the open 52 card slots if the number is not yet present. Until all slots filled

  • You tried the meta randomizer, though? It might answer your question

  • :)

    yes, but that would require the use of lists to compare to...

    in the meantime i built a patch in plugdata, which i could load as a midi plugin in drambo.

    but plugdata for me still has some unstableness feeling with it.

  • Isolate the random part in PD and post a screenshot or something, we can’t read your mind 😂

    but you got me curious

  • there's not much to isolate here, because that's it:


  • The problem is that you need an array for that and we don’t have any thing like it in drambo

    that rand.u module creates an array of N elements and fills it ahead with random values (probably using the brute force approach I mentioned) then outputs one by one until the array has cycled through

    I really don’t see a way to build it in drambo except for a dedicated module

  • sorry, not midi plugin, as plugdata doesnt seem to have one.

    has to be instrument plugin.

  • edited April 23

    Unlike that max msp gen, Random module generates float values, so they almost never repeat, e.g. 0.00121 and 0.00122 are not the same, in integer domain they would be both zeros. Most probably repeated values come after quantization in the following modules. What's the use case?

  • the use case is to pick randomly out of n lines from the speech synth without repetition until all lines have been chosen.

    then start over.

  • edited April 23

    like @giku says the output is a float 0 to 1, but this hypothetical module could have an integer input N, and quantize the random value into 1/N sized buckets that would output 0 if random<1/N, else if <2/N output 1/N else etc… up to N/N (or 1.0)

    that output you could feed directly to the index of the text module

    only the without repeating part would have to be a precomputed array and that only giku can do

  • but your text module usage case is a compelling one, I’ve used the code module to generate those quantized values to modulate the index and it works. But there is no array type in the code module, the seq function is read only and predetermined. Maybe we should ask @giku for an array in code module instead

  • edited April 23

    Or maybe if the seq could be declared initially empty (but with predetermined fixed size N) and then treated as a stack with push and pop to set values. You could scan all values before deciding to push a new one. That would go a long way

  • This would require more than just a "random" mode, like:

    • Min and max integer value adjustments
    • A gate/trigger input
    • A reset input
    • Maybe a bipolar switch to add a negative counterpart, doubling the range of values

    Thinking about it, this could serve as a nice experimental digital oscillator too 😊

  • Oh, and yet another way using Shift Registers and feedback modules:


  • edited April 24

    Ok, this helps a lot. The issue is that a random float value gets quantized by a stepped/integer knob.

    I think adding a Steps parameter to the random generator will solve this. By default it’s infinity, but when you set it to the number of steps in the modulated parameter, it won’t repeat values.

    Will be on the upcoming beta.

  • cool, looking forward to try it out, but i'm not on the drambo beta (yet)

  • wish come true! :)

    thanks alot @giku

  • I wonder if it’d be clearer for users to have a drop-down option to specify that you have Urn selected or instead a quantised pure pseudo-random. Also for some purposes it’d be great to add or save the seed for the random, which would give repeating results when you restart a session. In addition, having a third option for random walk would be helpful.

  • Yes, but we need to distinguish between the random generator and the sequencer with a Randomize button. Maybe it’s worth exploring this direction. Random should remain random.

Sign In or Register to comment.