Csound Csound-dev Csound-tekno Search About

[Csnd] Init Pow Base with i(k)

Date2019-02-22 21:28
Frompablozoani
Subject[Csnd] Init Pow Base with i(k)
Hello Everybody,
I am having some trouble to find a way to use the following code with k-type
variables. 
The commented line ";k_freq ..." returns an error: PERF ERROR in instr 1
line 17: NaN in pow.
I guess the intention is clear, to take the first value of the k_base
variable for start the process.
If i change the base to just a number (as the non commented line above)
everything works fine.
Also i am not sure about the i(x) code, i couldn't find it in the manual.
Regards





sr 			= 		96000
ksmps 		= 		1
nchnls 		= 		2
0dbfs 		= 		1
			seed		0
instr 1
k_base		=		$M_E
k_minexp		=		0
k_maxexp		=		2.5

k_freq		init		$M_E^i(k_maxexp) ;;; <- works
;k_freq		init		i(k_base)^i(k_maxexp) ;;; <- does not work

k_rand_freq	=	
(k_base^((randomh:k(0,1,k_freq,3)*(k_maxexp-k_minexp))+k_minexp))
k_freq		=		k_rand_freq
			printk2	k_freq
a_mod		poscil	1, k_freq/2
			outch	1, noise(a_mod,0), 2, noise(a_mod,0)
endin


a	0	0	0
t	0	60
i	1	0	10
e





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-02-22 21:39
FromTarmo Johannes
SubjectRe: [Csnd] Init Pow Base with i(k)
Hi,

Try
k_base          int             $M_E
Etc

= is evaluated in k-time thus k-bass haa no value yet on i it pass yet.

Tarmo


Saatja pablozoani <pablozoani@hotmail.com kirjutas kuupäeval R, 22. veebruar 2019 23:33 järgmist:
Hello Everybody,
I am having some trouble to find a way to use the following code with k-type
variables.
The commented line ";k_freq ..." returns an error: PERF ERROR in instr 1
line 17: NaN in pow.
I guess the intention is clear, to take the first value of the k_base
variable for start the process.
If i change the base to just a number (as the non commented line above)
everything works fine.
Also i am not sure about the i(x) code, i couldn't find it in the manual.
Regards

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr                      =               96000
ksmps           =               1
nchnls          =               2
0dbfs           =               1
                        seed            0
instr 1
k_base          =               $M_E
k_minexp                =               0
k_maxexp                =               2.5

k_freq          init            $M_E^i(k_maxexp) ;;; <- works
;k_freq         init            i(k_base)^i(k_maxexp) ;;; <- does not work

k_rand_freq     =       
(k_base^((randomh:k(0,1,k_freq,3)*(k_maxexp-k_minexp))+k_minexp))
k_freq          =               k_rand_freq
                        printk2 k_freq
a_mod           poscil  1, k_freq/2
                        outch   1, noise(a_mod,0), 2, noise(a_mod,0)
endin
</CsInstruments>
<CsScore>
a       0       0       0
t       0       60
i       1       0       10
e
</CsScore>
</CsoundSynthesizer>



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-02-22 21:40
FromTarmo Johannes
SubjectRe: [Csnd] Init Pow Base with i(k)
init 
I meant
T

Saatja Tarmo Johannes <trmjhnns@gmail.com kirjutas kuupäeval R, 22. veebruar 2019 23:39 järgmist:
Hi,

Try
k_base          int             $M_E
Etc

= is evaluated in k-time thus k-bass haa no value yet on i it pass yet.

Tarmo


Saatja pablozoani <pablozoani@hotmail.com kirjutas kuupäeval R, 22. veebruar 2019 23:33 järgmist:
Hello Everybody,
I am having some trouble to find a way to use the following code with k-type
variables.
The commented line ";k_freq ..." returns an error: PERF ERROR in instr 1
line 17: NaN in pow.
I guess the intention is clear, to take the first value of the k_base
variable for start the process.
If i change the base to just a number (as the non commented line above)
everything works fine.
Also i am not sure about the i(x) code, i couldn't find it in the manual.
Regards

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr                      =               96000
ksmps           =               1
nchnls          =               2
0dbfs           =               1
                        seed            0
instr 1
k_base          =               $M_E
k_minexp                =               0
k_maxexp                =               2.5

k_freq          init            $M_E^i(k_maxexp) ;;; <- works
;k_freq         init            i(k_base)^i(k_maxexp) ;;; <- does not work

k_rand_freq     =       
(k_base^((randomh:k(0,1,k_freq,3)*(k_maxexp-k_minexp))+k_minexp))
k_freq          =               k_rand_freq
                        printk2 k_freq
a_mod           poscil  1, k_freq/2
                        outch   1, noise(a_mod,0), 2, noise(a_mod,0)
endin
</CsInstruments>
<CsScore>
a       0       0       0
t       0       60
i       1       0       10
e
</CsScore>
</CsoundSynthesizer>



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-02-22 22:48
FromPablo Zoani Heffele
SubjectRe: [Csnd] Init Pow Base with i(k)
Hello Tarmo!
It works amazing, thanks. That way i need to write the base 2 times:
k_base = $M_E
k_base init $M_E

Is there a way you can write the kvalue just once? So one can use (for example) oscilators:
k_base = poscil(x)
So just to take the first value for initializing
Regards
PZH



De: Tarmo Johannes
Enviado: viernes 22 de febrero 18:40
Asunto: Re: [Csnd] Init Pow Base with i(k)
Para: csound@listserv.heanet.ie


init 
I meant
T

Saatja Tarmo Johannes <trmjhnns@gmail.com kirjutas kuupäeval R, 22. veebruar 2019 23:39 järgmist:
Hi,

Try
k_base          int             $M_E
Etc

= is evaluated in k-time thus k-bass haa no value yet on i it pass yet.

Tarmo


Saatja pablozoani <pablozoani@hotmail.com kirjutas kuupäeval R, 22. veebruar 2019 23:33 järgmist:
Hello Everybody,
I am having some trouble to find a way to use the following code with k-type
variables.
The commented line ";k_freq ..." returns an error: PERF ERROR in instr 1
line 17: NaN in pow.
I guess the intention is clear, to take the first value of the k_base
variable for start the process.
If i change the base to just a number (as the non commented line above)
everything works fine.
Also i am not sure about the i(x) code, i couldn't find it in the manual.
Regards

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr                      =               96000
ksmps           =               1
nchnls          =               2
0dbfs           =               1
                        seed            0
instr 1
k_base          =               $M_E
k_minexp                =               0
k_maxexp                =               2.5

k_freq          init            $M_E^i(k_maxexp) ;;; <- works
;k_freq         init            i(k_base)^i(k_maxexp) ;;; <- does not work

k_rand_freq     =       
(k_base^((randomh:k(0,1,k_freq,3)*(k_maxexp-k_minexp))+k_minexp))
k_freq          =               k_rand_freq
                        printk2 k_freq
a_mod           poscil  1, k_freq/2
                        outch   1, noise(a_mod,0), 2, noise(a_mod,0)
endin
</CsInstruments>
<CsScore>
a       0       0       0
t       0       60
i       1       0       10
e
</CsScore>
</CsoundSynthesizer>



--
Csound mailing list
Send bugs reports to
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