Csound Csound-dev Csound-tekno Search About

[Csnd] betarand - parameter ranges and interaction issue

Date2024-03-05 16:54
From"Jeanette C."
Subject[Csnd] betarand - parameter ranges and interaction issue
Hey hey,
I'm doing some work with betrand trying to shape certain random number ranges, 
by adjusting the alpha and beta parameters.

I noticed that with higher values for both alpha and beta there is an issue. 
Csound uses 100% CPU and a 2 second i-event does not stop.

With 6 for both alpha and beta it appears to work, with 7 it does not.

Is this an inherent limitation of the mahts behind betarand or a bug? I could 
think of ways around it, if I have to, though this feels more ellgant.

Best wishes and thanks,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Make all the clouds disappear
Put all your fears to rest <3
(Britney Spears)

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

Date2024-03-05 19:16
FromST Music
SubjectRe: [Csnd] betarand - parameter ranges and interaction issue
Hi Jeanette,
   FWIW I was able to somewhat replicate the issue although in this simple example with alpha/beta higher than approx. 9 or 10.

<CsoundSynthesizer>
<CsOptions>
 -odac
</CsOptions>
<CsInstruments>

sr = 48000
ksmps =  32
nchnls = 1
0dbfs  = 1

instr 1
  iIdx  = 64
  while iIdx >= 0 do
    iBeta = betarand:i(1, 14, 14)
    print iBeta
    iIdx -= 1
  od
  aSig  = poscil(.3, 330)
  out aSig
endin

instr 2
  aSig = poscil(.5, 220)
  out aSig
endin

</CsInstruments>
<CsScore>
i1 0 2
i2 0 8
</CsScore>
</CsoundSynthesizer>

Best,
Scott

On Tue, Mar 5, 2024, 11:54 a.m. Jeanette C. <julien@mail.upb.de> wrote:
Hey hey,
I'm doing some work with betrand trying to shape certain random number ranges,
by adjusting the alpha and beta parameters.

I noticed that with higher values for both alpha and beta there is an issue.
Csound uses 100% CPU and a 2 second i-event does not stop.

With 6 for both alpha and beta it appears to work, with 7 it does not.

Is this an inherent limitation of the mahts behind betarand or a bug? I could
think of ways around it, if I have to, though this feels more ellgant.

Best wishes and thanks,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Make all the clouds disappear
Put all your fears to rest <3
(Britney Spears)

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

Date2024-03-05 19:43
From"Jeanette C."
SubjectRe: [Csnd] betarand - parameter ranges and interaction issue
Attachmentsbetarand.csd  
Hi again,
thanks for your reply and the code Scott. I have attached my own testing code, 
which uses betarand at k-rate. I find that with alpha and beta = 7 the code 
will complete, but it takes approximately more than double the alotted 2 
seconds. Alpha and Beta values are supplied in the score, but printed out for 
every instrument call.

Currently, the instrument runs betarand at k-rate, calculating the minimum and 
maximum values, to print them and the responsible alpha and beta in the last 
cycle of the event. This is to gain a better understanding of the relationship 
between the parameters and the resultant random values.

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Make all the clouds disappear
Put all your fears to rest <3
(Britney Spears)

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