# Seed numbers?

## Recommended Posts

Hello

I'm new here.

I'm on the demo and doing fine but for the life of me I can't figure out what the integer does after :seed?

I know seed fixes a random function so it is repeatable but what does that number do? I tried changing it in Tutorial 5 but I can't make sense of it!

Thanks

Andy

##### Share on other sites

Hi Andy,

the seed is just a number you choose. Because it stop the random engine in a state, it allow to recover some values you generate randomly.

Very useful for example for creating a random theme and call it back after or for further variations.

What the seed number is to initialise the random engine in a state attached to this number.

SB.

##### Share on other sites

Hi Stephane

Ah I think I see, so it is an arbitary number that is an identifier....is that correct?

Thank you

Andy

##### Share on other sites

Yes, something like that.

Best

SB.

##### Share on other sites

The seed number is the random state number.

##### Share on other sites

> the random state number.﻿

Seed values are only relevant for functions that do some random operations. In layman's terms, think of rolling a dice. You want to ensure that the dice always rolls the same number, and for that purpose, you put some glue on one of its sides. The seed number effectively controls on which side of your dice you put the glue. It is not the same as the number that is the result, but controls which number will be the result. Now think of having some more complex algorithm than just a dice, where you have a similar mechanism to control what the output should be and that way fixing the output to a static value that can be re-computed multiple times.

##### Share on other sites

Great explanation Torsten thanks....and the value of the number attached to the "glued side" is arbitrary? It's an index to the glued side but as such can be any chosen value?

##### Share on other sites

the﻿ value of﻿ the﻿ number attached﻿ to﻿ the "glued﻿ side﻿﻿﻿﻿﻿﻿﻿" is﻿ arbitra﻿﻿﻿r﻿﻿﻿﻿y

No, it is not, it depends on the implementation of the random generator used. However, this is far from being intuitive to understand, and beyond that, for several functions, the seed controls multiple random generators, where basically the seed for their seed is then computed randomly. So, for practical uses, you can consider the choice of seed values random.

Just for background, in a simple random number generator, the seed can be used in an integer division where the resulting random value is the modulus (see https://en.wikipedia.org/wiki/Lehmer_random_number_generator). So, there is no indexing...

Best,

Torsten

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• ### Similar Topics

• By Andy
Hi
I'm starting to loose the will to progress.
So I just spent an hour trying to evaluate this and getting errors and thinking I'd got the wrong number of brackets and yet it looks fine.

(setf motifx12 (rnd-order (gen-repeat 12 (list motif)))) :seed3)

And then I realise that I have to place the cursor not on the final bracket but on the one before :seed3)
Nowhere does it say this in the manual as far as I can tell.
And why?
I think it's something to do with the : colon that I don't understand in the language. And I still don't understand seed.
I'm really trying to get to grips with lisp but my hair is on fire. 😞

• Dear Friends

In my Doctoral Dissertation, I converted every FORTE number in a modulo 12 Rhythm via time-point-system.

After Janusz adjusted the Forte numbers to have the inversion, using "a" and "b" to differentiate the
prime forms from the inversions, it was easy to convert using codes like this:
(setf ch0 (time-point-system (pcs '5-11b :pitch)'s :start 0)) (setf ch1 (time-point-system (pcs '6-33 :pitch)'s :start 1)) (setf ch2 (time-point-system (pcs '7-11b :pitch)'s :start 2)) (setf ch3 (time-point-system (pcs '3-11b :pitch)'s :start 3)) (setf ch4 (time-point-system (pcs '3-11b :pitch)'s :start 0))
Das alturas ao ritmo : teoria dos conjuntos rítmicos como ferramenta composicional
From pitches to rhythm: rhythmic set theory as a compositional tool.
http://hdl.handle.net/10183/179457
Abstract
This doctoral dissertation is divided into two parts: the first deals a rhythmic set theory, and the second contains the portfolio of compositions developed during this period of studies. This dissertation presents a system of rhythmic organization parallel to the musical set theory pitch class organization FORTE (1973), as well as an adaptation of the time-point-system (BABBITT, 1962). From the standpoint of the traditional set theory, and also from the diatonic set theory, this unified approach allows to estabilish a connecting tissue of basic aspects: from the harmony and chords symbols to the rhythmic organization. At one time, in a complete catalog, the families of pitch class sets and chord symbols are related to their respective rhythmic counterparts. The musical motivation for this research came from my interest in the swinging and groovy repetitive rhythms called timelines (TOUSSAINT, 2013), commonly used in popular music. These dancing timelines have properties similar to those of the diatonic sets, and for this reason, this dissertation presents some properties of the diatonic pitch class sets, drawing a parallel with their rhythmic counterparts. These relationships also appear in the portfolio of compositions, characterizing some procedures used. The portfolio of compositions, which includes a composition for symphony orchestra, is presented form the standpoint of a duality between transparency and opacity. This duality address the essential differences in the audibility of the results from various composition techniques. This study of Rhythmic Set Theory will serve as an analytical approach of my compositional output in popular music, with a systematic way to understant and to extrapolate some aspects already used in my practice as composer and improviser.     Here is an analysis of a Wayne Krantz improvisation, using the rhythmic set theory system.   Hope you enjoy !!   Best, Julio
• By EAIP
Here is a suggestion for posting the random seed value used by a function.
When using Open Music way back in time I remember that you could "lock" a random function if you liked the result, which IMO was a great workflow feature.
Perhaps a similar thing could be achived in Opusmodus if the random seed used for a function was posted to the post window in addition to the result of the evaluation.
If you like the result of a particular seed you could then manually "lock" the randomization using the :seed keyword for the function:

; first try different randomizations (setf bin-rhythm (gen-binary-rnd 5 5 2 1)) => gen-binary-rnd :seed 752 (setf bin-rhythm (gen-binary-rnd 5 5 2 1)) => gen-binary-rnd :seed 234 ; then lock seed if you like the result (setf bin-rhythm (gen-binary-rnd 5 5 2 1) :seed 234)
Perhaps if possible also with the variable name as a label to keep track of things when using several random functions in complex code:

(setf bin-rhythm (gen-binary-rnd 5 5 2 1)) => bin-rhytm gen-binary-rnd :seed 37
I think that this or a similar approach would be a really powerful way of trying different results when working with randomization in Opusmodus.

×

• Lessons