Print

Print


The answer above will already work great, but just for the hell of it, I
have another option for non melodic random frequencies...

Chose your starting values in hertz
Log2() the range values
Choose a random value between the log2() range values using the usual
random number opcode
And exp2() the result.

This will give you a random value within your chosen range with an
exponential2 distribution as you desire.

Pete

On 4 Nov 2017 8:12 a.m., "joachim heintz" <[log in to unmask]> wrote:

> i'd use the oct scale in this case, for instance
>
> random 6, 10
>
> and then convert the result via cpsoct.
>
> working with midi note numbers and then convert via cpsmidinn (if i recall
> the opcode correctly) does the same.
>
>         joachim
>
>
>
> On 04/11/17 02:04, chronopolis wrote:
>
>> say I have
>>
>> random 50, 16000
>>
>> but I want to represent the selection exponentially so that it corresponds
>> with frequency distribution.. how would one do that?
>>
>> I looked at 'exprand' but I'm not quite sure what kind of input it
>> processes. And from what I can tell 'scale' is linear?
>>
>>
>>
>> --
>> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.
>> html
>>
>> Csound mailing list
>> [log in to unmask]
>> 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
> [log in to unmask]
> 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
[log in to unmask]
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