Csound Csound-dev Csound-tekno Search About

[Csnd] Random with no duplicates

Date2018-01-02 14:05
FromSantiago Bogacz
Subject[Csnd] Random with no duplicates
Dear Csounders,

I'm working on a piece, for which, in a section, I'd like to do a "glissando" with random notes in a restrained "space", I mean, starting from an A point that has X random "space" and make a "glissando" of that "space".
I solved it like this: 

knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

p5-p8 are the notes I choose in the score, for which, to make that effect, p6/p8 is 4-5 semitones away from p5/p7.

Now, the problem is that notes are, many times, repeated in succession, which doesn't make it really sound that "random". 
So what I should do is make knum2(A) ≠ knum1(A). I've been thinking of a proper syntax, but haven't really found a good one that works the way I want, mostly where I should be writing it (I mean, in the instrument itself).
I know it may be an easy thing to solve, but as I've never really done it, I'm not so sure. If someone could help me out with this, I'd be really thankful!

Thanks very much and happy new year!

Santiago Bogacz

Libre de virus. www.avast.com
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2018-01-02 15:15
FromAndrea Strappa
SubjectRe: [Csnd] Random with no duplicates

Have you tried with 'dust' opcode?

Greetings

Andrea

<CsoundSynthesizer>
<CsOptions>
-odac1
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
0dbfs  = 1
nchnls = 1

instr 1 ;with metro
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig metro 2
printk2 ktrig
if ktrig = 1 then
event "i", 3, 0, .5, knot
endif

endin

instr 2 ;with dust
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig dust 1, 2
if ktrig > .001 then
event "i", 3, 0, .5, knot
endif

endin

instr 3
inot = p4
kenv linenr .3, p3*.5, p3*.5, .01
aSig vco2 kenv, cpsmidinn(inot)
out aSig
endin
</CsInstruments>
<CsScore>
i1 0  10 0 84 96 72 84 ;metro
i2 10 10 0 84 96 72 84 ;dust
</CsScore>
</CsoundSynthesizer>



Il 02/01/2018 15:05, Santiago Bogacz ha scritto:
Dear Csounders,

I'm working on a piece, for which, in a section, I'd like to do a "glissando" with random notes in a restrained "space", I mean, starting from an A point that has X random "space" and make a "glissando" of that "space".
I solved it like this: 

knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

p5-p8 are the notes I choose in the score, for which, to make that effect, p6/p8 is 4-5 semitones away from p5/p7.

Now, the problem is that notes are, many times, repeated in succession, which doesn't make it really sound that "random". 
So what I should do is make knum2(A) ≠ knum1(A). I've been thinking of a proper syntax, but haven't really found a good one that works the way I want, mostly where I should be writing it (I mean, in the instrument itself).
I know it may be an easy thing to solve, but as I've never really done it, I'm not so sure. If someone could help me out with this, I'd be really thankful!

Thanks very much and happy new year!

Santiago Bogacz

Libre de virus. www.avast.com
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2018-01-02 15:27
FromSantiago Bogacz
SubjectRe: [Csnd] Random with no duplicates
Andrea,

Thanks very much! Didn't know about the dust opcode! I'll try it right away. Silly question: what would "iciao" respond to? As I noticed you put it as a "p" and I guessed it's something specific for the general code and not specifically for the dust opcode

Libre de virus. www.avast.com

On Tue, Jan 2, 2018 at 4:15 PM, Andrea Strappa <a_strappa@tin.it> wrote:

Have you tried with 'dust' opcode?

Greetings

Andrea

<CsoundSynthesizer>
<CsOptions>
-odac1
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
0dbfs  = 1
nchnls = 1

instr 1 ;with metro
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig metro 2
printk2 ktrig
if ktrig = 1 then
event "i", 3, 0, .5, knot
endif

endin

instr 2 ;with dust
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig dust 1, 2
if ktrig > .001 then
event "i", 3, 0, .5, knot
endif

endin

instr 3
inot = p4
kenv linenr .3, p3*.5, p3*.5, .01
aSig vco2 kenv, cpsmidinn(inot)
out aSig
endin
</CsInstruments>
<CsScore>
i1 0  10 0 84 96 72 84 ;metro
i2 10 10 0 84 96 72 84 ;dust
</CsScore>
</CsoundSynthesizer>



Il 02/01/2018 15:05, Santiago Bogacz ha scritto:
Dear Csounders,

I'm working on a piece, for which, in a section, I'd like to do a "glissando" with random notes in a restrained "space", I mean, starting from an A point that has X random "space" and make a "glissando" of that "space".
I solved it like this: 

knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

p5-p8 are the notes I choose in the score, for which, to make that effect, p6/p8 is 4-5 semitones away from p5/p7.

Now, the problem is that notes are, many times, repeated in succession, which doesn't make it really sound that "random". 
So what I should do is make knum2(A) ≠ knum1(A). I've been thinking of a proper syntax, but haven't really found a good one that works the way I want, mostly where I should be writing it (I mean, in the instrument itself).
I know it may be an easy thing to solve, but as I've never really done it, I'm not so sure. If someone could help me out with this, I'd be really thankful!

Thanks very much and happy new year!

Santiago Bogacz

Libre de virus. www.avast.com
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2018-01-02 15:45
FromAndrea Strappa
SubjectRe: [Csnd] Random with no duplicates

I used  'iciao' only to fill an empty pfield, you can remove it.

Ciao

Andrea


Il 02/01/2018 16:27, Santiago Bogacz ha scritto:
Andrea,

Thanks very much! Didn't know about the dust opcode! I'll try it right away. Silly question: what would "iciao" respond to? As I noticed you put it as a "p" and I guessed it's something specific for the general code and not specifically for the dust opcode

Libre de virus. www.avast.com

On Tue, Jan 2, 2018 at 4:15 PM, Andrea Strappa <a_strappa@tin.it> wrote:

Have you tried with 'dust' opcode?

Greetings

Andrea

<CsoundSynthesizer>
<CsOptions>
-odac1
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
0dbfs  = 1
nchnls = 1

instr 1 ;with metro
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig metro 2
printk2 ktrig
if ktrig = 1 then
event "i", 3, 0, .5, knot
endif

endin

instr 2 ;with dust
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig dust 1, 2
if ktrig > .001 then
event "i", 3, 0, .5, knot
endif

endin

instr 3
inot = p4
kenv linenr .3, p3*.5, p3*.5, .01
aSig vco2 kenv, cpsmidinn(inot)
out aSig
endin
</CsInstruments>
<CsScore>
i1 0  10 0 84 96 72 84 ;metro
i2 10 10 0 84 96 72 84 ;dust
</CsScore>
</CsoundSynthesizer>



Il 02/01/2018 15:05, Santiago Bogacz ha scritto:
Dear Csounders,

I'm working on a piece, for which, in a section, I'd like to do a "glissando" with random notes in a restrained "space", I mean, starting from an A point that has X random "space" and make a "glissando" of that "space".
I solved it like this: 

knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

p5-p8 are the notes I choose in the score, for which, to make that effect, p6/p8 is 4-5 semitones away from p5/p7.

Now, the problem is that notes are, many times, repeated in succession, which doesn't make it really sound that "random". 
So what I should do is make knum2(A) ≠ knum1(A). I've been thinking of a proper syntax, but haven't really found a good one that works the way I want, mostly where I should be writing it (I mean, in the instrument itself).
I know it may be an easy thing to solve, but as I've never really done it, I'm not so sure. If someone could help me out with this, I'd be really thankful!

Thanks very much and happy new year!

Santiago Bogacz

Libre de virus. www.avast.com
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2018-01-02 16:47
FromSantiago Bogacz
SubjectRe: [Csnd] Random with no duplicates
Ah ok haha. Well thanks very very much Andrea!!

Have a great time!

On Tue, Jan 2, 2018 at 4:45 PM, Andrea Strappa <a_strappa@tin.it> wrote:

I used  'iciao' only to fill an empty pfield, you can remove it.

Ciao

Andrea


Il 02/01/2018 16:27, Santiago Bogacz ha scritto:
Andrea,

Thanks very much! Didn't know about the dust opcode! I'll try it right away. Silly question: what would "iciao" respond to? As I noticed you put it as a "p" and I guessed it's something specific for the general code and not specifically for the dust opcode

Libre de virus. www.avast.com

On Tue, Jan 2, 2018 at 4:15 PM, Andrea Strappa <a_strappa@tin.it> wrote:

Have you tried with 'dust' opcode?

Greetings

Andrea

<CsoundSynthesizer>
<CsOptions>
-odac1
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
0dbfs  = 1
nchnls = 1

instr 1 ;with metro
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig metro 2
printk2 ktrig
if ktrig = 1 then
event "i", 3, 0, .5, knot
endif

endin

instr 2 ;with dust
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig dust 1, 2
if ktrig > .001 then
event "i", 3, 0, .5, knot
endif

endin

instr 3
inot = p4
kenv linenr .3, p3*.5, p3*.5, .01
aSig vco2 kenv, cpsmidinn(inot)
out aSig
endin
</CsInstruments>
<CsScore>
i1 0  10 0 84 96 72 84 ;metro
i2 10 10 0 84 96 72 84 ;dust
</CsScore>
</CsoundSynthesizer>



Il 02/01/2018 15:05, Santiago Bogacz ha scritto:
Dear Csounders,

I'm working on a piece, for which, in a section, I'd like to do a "glissando" with random notes in a restrained "space", I mean, starting from an A point that has X random "space" and make a "glissando" of that "space".
I solved it like this: 

knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

p5-p8 are the notes I choose in the score, for which, to make that effect, p6/p8 is 4-5 semitones away from p5/p7.

Now, the problem is that notes are, many times, repeated in succession, which doesn't make it really sound that "random". 
So what I should do is make knum2(A) ≠ knum1(A). I've been thinking of a proper syntax, but haven't really found a good one that works the way I want, mostly where I should be writing it (I mean, in the instrument itself).
I know it may be an easy thing to solve, but as I've never really done it, I'm not so sure. If someone could help me out with this, I'd be really thankful!

Thanks very much and happy new year!

Santiago Bogacz

Libre de virus. www.avast.com
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2018-01-02 19:48
FromAndrea Strappa
SubjectRe: [Csnd] Random with no duplicates

It's a pleasure.

Greetings

Andrea


Il 02/01/2018 17:47, Santiago Bogacz ha scritto:
Ah ok haha. Well thanks very very much Andrea!!

Have a great time!

On Tue, Jan 2, 2018 at 4:45 PM, Andrea Strappa <a_strappa@tin.it> wrote:

I used  'iciao' only to fill an empty pfield, you can remove it.

Ciao

Andrea


Il 02/01/2018 16:27, Santiago Bogacz ha scritto:
Andrea,

Thanks very much! Didn't know about the dust opcode! I'll try it right away. Silly question: what would "iciao" respond to? As I noticed you put it as a "p" and I guessed it's something specific for the general code and not specifically for the dust opcode

Libre de virus. www.avast.com

On Tue, Jan 2, 2018 at 4:15 PM, Andrea Strappa <a_strappa@tin.it> wrote:

Have you tried with 'dust' opcode?

Greetings

Andrea

<CsoundSynthesizer>
<CsOptions>
-odac1
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
0dbfs  = 1
nchnls = 1

instr 1 ;with metro
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig metro 2
printk2 ktrig
if ktrig = 1 then
event "i", 3, 0, .5, knot
endif

endin

instr 2 ;with dust
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig dust 1, 2
if ktrig > .001 then
event "i", 3, 0, .5, knot
endif

endin

instr 3
inot = p4
kenv linenr .3, p3*.5, p3*.5, .01
aSig vco2 kenv, cpsmidinn(inot)
out aSig
endin
</CsInstruments>
<CsScore>
i1 0  10 0 84 96 72 84 ;metro
i2 10 10 0 84 96 72 84 ;dust
</CsScore>
</CsoundSynthesizer>



Il 02/01/2018 15:05, Santiago Bogacz ha scritto:
Dear Csounders,

I'm working on a piece, for which, in a section, I'd like to do a "glissando" with random notes in a restrained "space", I mean, starting from an A point that has X random "space" and make a "glissando" of that "space".
I solved it like this: 

knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

p5-p8 are the notes I choose in the score, for which, to make that effect, p6/p8 is 4-5 semitones away from p5/p7.

Now, the problem is that notes are, many times, repeated in succession, which doesn't make it really sound that "random". 
So what I should do is make knum2(A) ≠ knum1(A). I've been thinking of a proper syntax, but haven't really found a good one that works the way I want, mostly where I should be writing it (I mean, in the instrument itself).
I know it may be an easy thing to solve, but as I've never really done it, I'm not so sure. If someone could help me out with this, I'd be really thankful!

Thanks very much and happy new year!

Santiago Bogacz

Libre de virus. www.avast.com
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-05-20 05:50
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] Random with no duplicates
Dear Andrea,

From a long time ago...  you posted this excellent and clear and inspiring little instrument to the Csound mailing list.
- I look forward to sharing it with my students this semester.

Funny.  I always think of "listening" to dust and not using it as a random trigger source.
- this is why I loved Csound so much.  Great people like you change the way we understand or think of imagine.

Super appreciate.

-Richard

Dr. Richard Boulanger

Professor of Electronic Production and Design

Berklee College of Music

Professional Writing and Music Technology Division


On Tue, Jan 2, 2018 at 10:15 AM Andrea Strappa <a_strappa@tin.it> wrote:

Have you tried with 'dust' opcode?

Greetings

Andrea

<CsoundSynthesizer>
<CsOptions>
-odac1
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
0dbfs  = 1
nchnls = 1

instr 1 ;with metro
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig metro 2
printk2 ktrig
if ktrig = 1 then
event "i", 3, 0, .5, knot
endif

endin

instr 2 ;with dust
iciao = p4
knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

ktrig dust 1, 2
if ktrig > .001 then
event "i", 3, 0, .5, knot
endif

endin

instr 3
inot = p4
kenv linenr .3, p3*.5, p3*.5, .01
aSig vco2 kenv, cpsmidinn(inot)
out aSig
endin
</CsInstruments>
<CsScore>
i1 0  10 0 84 96 72 84 ;metro
i2 10 10 0 84 96 72 84 ;dust
</CsScore>
</CsoundSynthesizer>



Il 02/01/2018 15:05, Santiago Bogacz ha scritto:
Dear Csounders,

I'm working on a piece, for which, in a section, I'd like to do a "glissando" with random notes in a restrained "space", I mean, starting from an A point that has X random "space" and make a "glissando" of that "space".
I solved it like this: 

knum1 linseg p5, p3, p6
knum2 linseg p7, p3, p8
knot random knum1, knum2

p5-p8 are the notes I choose in the score, for which, to make that effect, p6/p8 is 4-5 semitones away from p5/p7.

Now, the problem is that notes are, many times, repeated in succession, which doesn't make it really sound that "random". 
So what I should do is make knum2(A) ≠ knum1(A). I've been thinking of a proper syntax, but haven't really found a good one that works the way I want, mostly where I should be writing it (I mean, in the instrument itself).
I know it may be an easy thing to solve, but as I've never really done it, I'm not so sure. If someone could help me out with this, I'd be really thankful!

Thanks very much and happy new year!

Santiago Bogacz

Libre de virus. www.avast.com
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here