Csound Csound-dev Csound-tekno Search About

[Cs-dev] The Manual, Expressions and Carry

Date2009-07-28 18:25
FromJacob Joaquin
Subject[Cs-dev] The Manual, Expressions and Carry
I just ran a test to see whether or not a score expression or the it produces
is carried.  From my test, I can only assume that expressions are
preprocessed before the carry statement.  Perhaps the manual could note this
in either the page about expressions and/or on the carry page.

Also, having a page in the manual the describes the order in which
preprocessors are processed would be very helpful.

Here is my test script:


__begin__
#!/usr/bin/env csound -g -odac

Tests if expressions are carried, or if the values they produce are
carried.

Conclusion:

Only the values are carried.  To evalute an expression for each
i-event, you must explicitly write the expression and not use the carry
preprocessor.



sr     = 44100
kr     = 4410
ksmps  = 10
nchnls = 1

0dbfs = 1.0

instr 1
    iamp = p4
    ifreq = p5
    
    asig oscils iamp, ifreq, 0
    out asig
endin
    


i 1 0 0.125 1 [~ * 440 + 440]
i 1 + .     . .
i 1 + .     . .
i 1 + .     . [~ * 440 + 440]
i 1 + .     . .
i 1 + .     . .
i 1 + .     . [~ * 440 + 440]
i 1 + .     . .
i 1 + .     . .

e


__end__

Best,
Jake
-- 
View this message in context: http://www.nabble.com/The-Manual%2C-Expressions-and-Carry-tp24704167p24704167.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-07-28 18:29
FromJacob Joaquin
SubjectRe: [Cs-dev] The Manual, Expressions and Carry
btw, I'd be willing to author the manual page about the order in which
preprocessors are processed.  All I need to know is the order.

Best,
Jake



Jacob Joaquin wrote:
> 
> I just ran a test to see whether or not a score expression or the it
> produces is carried.  From my test, I can only assume that expressions are
> preprocessed before the carry statement.  Perhaps the manual could note
> this in either the page about expressions and/or on the carry page.
> 
> Also, having a page in the manual the describes the order in which
> preprocessors are processed would be very helpful.
> 
> Here is my test script:
> 
> 
> __begin__
> #!/usr/bin/env csound -g -odac
> 
> Tests if expressions are carried, or if the values they produce are
> carried.
> 
> Conclusion:
> 
> Only the values are carried.  To evalute an expression for each
> i-event, you must explicitly write the expression and not use the carry
> preprocessor.
> 
> 
> 
> sr     = 44100
> kr     = 4410
> ksmps  = 10
> nchnls = 1
> 
> 0dbfs = 1.0
> 
> instr 1
>     iamp = p4
>     ifreq = p5
>     
>     asig oscils iamp, ifreq, 0
>     out asig
> endin
>     
> 
> 
> i 1 0 0.125 1 [~ * 440 + 440]
> i 1 + .     . .
> i 1 + .     . .
> i 1 + .     . [~ * 440 + 440]
> i 1 + .     . .
> i 1 + .     . .
> i 1 + .     . [~ * 440 + 440]
> i 1 + .     . .
> i 1 + .     . .
> 
> e
> 
> 
> __end__
> 
> Best,
> Jake
> 

-- 
View this message in context: http://www.nabble.com/The-Manual%2C-Expressions-and-Carry-tp24704167p24704248.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-07-28 21:33
FromJacob Joaquin
SubjectRe: [Cs-dev] The Manual, Expressions and Carry
I believe I found an error with the carry examples in the manual.  e.g. it
says:

i1   0    .5        100
i .  +
i

will result in:

i1   0         .5        100
i1   .5        .5        100
i1   1         .5        100

However, I ran this through scsort, and this is what was output:

i 1 0.000000 0.000000 0.500000 0.500000 100
i 1 0.000000 0.000000 0.500000 0.500000 100
i 1 0.500000 0.500000 0.500000 0.500000 100

Notice the first two lines are duplicates.  If I add a carry in the third
line for pfield 1, such as:

i1   0    .5        100
i .  +
i .

the result is:

i 1 0.000000 0.000000 0.500000 0.500000 100
i 1 0.500000 0.500000 0.500000 0.500000 100
i 1 1.000000 1.000000 0.500000 0.500000 100

which I believe is the intended output of the first example.

Best,
Jake




Jacob Joaquin wrote:
> 
> I just ran a test to see whether or not a score expression or the it
> produces is carried.  From my test, I can only assume that expressions are
> preprocessed before the carry statement.  Perhaps the manual could note
> this in either the page about expressions and/or on the carry page.
> 
> 

-- 
View this message in context: http://www.nabble.com/The-Manual%2C-Expressions-and-Carry-tp24704167p24707348.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net