Csound Csound-dev Csound-tekno Search About

[Csnd] Macro maths

Date2018-08-14 13:26
Fromfauveboy
Subject[Csnd] Macro maths
I'm trying to convert a beat into seconds to send to diskin2 iskiptim
argument. I've used the following code 


#define track5 #"ChimesAbiV1Synth3.wav"#
#define beat2time # ((60000.0 / 89.0) / 1000.0) #


then my score states 

i1 2 1 $track5 1 0 $beat2time
i1 3 1 $track5 1 $beat2time $beat2time 


i've used the print value for the values in the p fields using $beat2time
and the value seems to be 0.000. I'm expecting 0.674, why is this happening?





--
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

Date2018-08-14 13:32
FromJohn ff
SubjectRe: [Csnd] Macro maths
Put the calculations on square brackets.

define beat2time # [((60000.0 / 89.0) / 1000.0)] #


Sent from TypeApp
On 14 Aug 2018, at 13:26, fauveboy <joel.ramsbottom@hotmail.co.uk> wrote:
I'm trying to convert a beat into seconds to send to diskin2 iskiptim
argument. I've used the following code


#define track5 #"ChimesAbiV1Synth3.wav"#
#define beat2time # ((60000.0 / 89.0) / 1000.0) #


then my score states

i1 2 1 $track5 1 0 $beat2time
i1 3 1 $track5 1 $beat2time $beat2time


i've used the print value for the values in the p fields using $beat2time
and the value seems to be 0.000. I'm expecting 0.674, why is this happening?





--
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

Date2018-08-14 14:04
Fromfauveboy
SubjectRe: [Csnd] Macro maths
is that the same for maths in the score such as:

i1 3 1 $track5 1 [$beat2time * 2] [$beat2time * 4]



--
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

Date2018-08-14 14:14
FromDave Seidel
SubjectRe: [Csnd] Macro maths
Yes, all maths expressions in scores must be surrounded by square brackets.

On Tue, Aug 14, 2018 at 9:04 AM fauveboy <joel.ramsbottom@hotmail.co.uk> wrote:
is that the same for maths in the score such as:

i1 3 1 $track5 1 [$beat2time * 2] [$beat2time * 4]



--
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

Date2018-08-14 14:19
Fromfauveboy
SubjectRe: [Csnd] Macro maths
but with the last score statement the compiler says:

score error: illegal character [(5b) in [] expression
     section 1: at position B2
WARNING: Internal error in print_input_backtrace()



--
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

Date2018-08-14 14:25
FromJohn ff
SubjectRe: [Csnd] Macro maths
Is there a space between the ] and the [ just cannot tell on this device

Nested brackets was a recent fix btw

Sent from TypeApp
On 14 Aug 2018, at 14:20, fauveboy <joel.ramsbottom@hotmail.co.uk> wrote:
but with the last score statement the compiler says:

score error: illegal character [(5b) in [] expression
section 1: at position B2
WARNING: Internal error in print_input_backtrace()



--
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

Date2018-08-14 14:34
Fromfauveboy
SubjectRe: [Csnd] Macro maths
Theres definitely a gap



--
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

Date2018-08-14 15:01
Fromjpff
SubjectRe: [Csnd] Macro maths
Could you send a complete csd and the output?  I am having truble working 
out what you are actually doing, messages seem to change things etc

On Tue, 14 Aug 2018, fauveboy wrote:

> Theres definitely a gap
>
>
>
> --
> 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

Date2018-08-15 10:42
Fromfauveboy
SubjectRe: [Csnd] Macro maths
brakets.csd   

What is currently odd is that file i've up loaded I've written onto Raspbian
lite which is where I get the error I quoted earlier:

core error: illegal character [(5b) in [] expression 
     section 1: at position B2 
WARNING: Internal error in print_input_backtrace() 

running the same file via CsoundQT on OSX the compiler doesnt have the
complaint?

although as a side note I am getting pops at the launch of the sample
despite having an envelope there?




--
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

Date2018-08-15 12:13
FromJohn ff
SubjectRe: [Csnd] Macro maths
Your score has nested square brackets which were not supported until recently. 

Remove the [] from the definition and place in brackets for the call without the multiply.

Sorry if that is not clear but do not know how to view your code and reply to mail

Will give better version when I get to a real computer.

⁣Sent from TypeApp ​

On Aug 15, 2018, 10:43, at 10:43, fauveboy  wrote:
>brakets.csd
>  
>
>What is currently odd is that file i've up loaded I've written onto
>Raspbian
>lite which is where I get the error I quoted earlier:
>
>core error: illegal character [(5b) in [] expression 
>     section 1: at position B2 
>WARNING: Internal error in print_input_backtrace() 
>
>running the same file via CsoundQT on OSX the compiler doesnt have the
>complaint?
>
>although as a side note I am getting pops at the launch of the sample
>despite having an envelope there?
>
>
>
>
>--
>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

Date2018-08-15 12:21
Fromjpff
SubjectRe: [Csnd] Macro maths
This is the score I mean


#define beat2time # ((60000.0 / 89.0) / 1000.0) #
#define track5 #"ChimestemtoPi/ChimAbiV1Synth3.wav"#

t 0 89

i1 2 2 $track5 1 0 [$beat2time]

i1 4 3 $track5 1 [$beat2time*2.0] [$beat2time*4.0]



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-08-15 13:06
Fromfauveboy
SubjectRe: [Csnd] Macro maths
removing the brackets from the definition seems to run the program



--
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

Date2018-08-15 13:07
Fromjpff
SubjectRe: [Csnd] Macro maths
About the click; cannot run your code at present but I do not see why the 
linseg you use is not starting from zero and returning to zero in the 
space of p3 time.  I would expect your

kenv linseg 0.01, 0.05, 1, p3, 1, 0.05, 0.05

to read

kenv linseg 0.0, 0.05, 1, p3-0.1, 1, 0.05, 0.0

that is starting from zero, raising to 1 in 0.05s, staying there for p3 
minus the time in rise and fall, and then decaying to zero.

==John ff

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