Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Score expressions

Date2008-01-30 00:54
From"Art Hunkins"
SubjectRe: [Cs-dev] Score expressions
With regard to ~ and random values:

1) how does initialization work (is seed required)?

2) do multiple instances of  ~ generate new values?

Art Hunkins

----- Original Message ----- 
From: "Anthony Kozar" 
To: "New Csound Developer list" 
Sent: Tuesday, January 29, 2008 5:02 PM
Subject: [Cs-dev] Score expressions


>I am revising the manual section "Evaluation of Expressions" to include 
>some
> information that was previously omitted.  I want to check that the 
> following
> is correct (particularly the parts about right to left evaluation and
> precedence of logical operators).
>
> -----------
>    In earlier versions of Csound the numbers presented in a score were 
> used
> as given.  There are occasions when some simple evaluation would be 
> easier.
> This need is increased when there are macros.  To assist in this area the
> syntax of arithmetic expressions within square brackets [ ] has been
> introduced.  Expressions built from the operations +, -, *,  /, %
> ("modulo"), and ^ ("power of") are allowed, together with grouping with 
> ( ).
> Unary minus and plus are also supported. The expressions can include
> numbers, and naturally macros whose values are numeric or arithmetic
> strings.  All calculations are made in floating point numbers. The usual
> precedence rules are followed when evaluating: expressions within
> parantheses ( ) are evaluated first and ^ is evaluated before *, /, and %
> which are evaluated before + and -.  Note that operations of the same
> precedence are evaluated from right to left, not the usual left to right.
>
>    In addition to arithmetic operations, the following bitwise logical
> operators are also available: & (AND), | (OR), and # (XOR, exclusive-OR).
> These operators round their operands to the nearest (long) integer before
> evaluating.  The logical operators have the same precedence as the *, /, 
> and
> % arithmetic operators.
>
>    Finally, the tilde symbol ~ can be used anywhere in an expression that 
> a
> number is permissible to provide a random value between zero (0) and one
> (1).
> ------------
>
> Anthony
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net