/[svn]/linuxsampler/trunk/src/scriptvm/examples/expressions.txt
ViewVC logotype

Contents of /linuxsampler/trunk/src/scriptvm/examples/expressions.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3078 - (show annotations) (download)
Thu Jan 5 18:11:00 2017 UTC (7 years, 2 months ago) by schoenebeck
File MIME type: text/plain
File size: 2767 byte(s)
- Just minor update to NKSP example.

1 on init
2 declare $i
3 declare @s := "foo" & " bar"
4 message(@s)
5
6 message("4 + 3 is " & 4 + 3)
7 message("10 mod 8 -> " & 10 mod 8)
8
9 message("Relation 3 < 4 -> " & 3 < 4)
10 message("Relation 3 > 4 -> " & 3 > 4)
11 message("Relation 3 <= 4 -> " & 3 <= 4)
12 message("Relation 3 >= 4 -> " & 3 >= 4)
13 message("Relation 3 # 4 -> " & 3 # 4)
14 message("Relation 3 = 4 -> " & 3 = 4)
15
16 message("Logical operation 1 and 2 = " & 1 and 2)
17 message("Logical operation 1 and 3 = " & 1 and 3)
18 message("Logical operation 1 and 0 = " & 1 and 0)
19 message("Logical operation 1 or 2 = " & 1 or 2)
20 message("Logical operation 1 or 1 = " & 1 or 1)
21 message("Logical operation 1 or 0 = " & 1 or 0)
22 message("Logical operation 0 or 0 = " & 0 or 0)
23
24 message("Logical operation not 1 = " & not 1)
25 message("Logical operation not 2 = " & not 2)
26 message("Logical operation not 0 = " & not 0)
27
28 message("Bitwise operation 1 .and. 2 = " & 1 .and. 2)
29 message("Bitwise operation 1 .and. 3 = " & 1 .and. 3)
30 message("Bitwise operation 1 .and. 0 = " & 1 .and. 0)
31 message("Bitwise operation 1 .or. 2 = " & 1 .or. 2)
32 message("Bitwise operation 1 .or. 1 = " & 1 .or. 1)
33 message("Bitwise operation 1 .or. 0 = " & 1 .or. 0)
34 message("Bitwise operation 0 .or. 0 = " & 0 .or. 0)
35
36 message("Bitwise operation .not. 1 = " & .not. 1)
37 message("Bitwise operation .not. 2 = " & .not. 2)
38 message("Bitwise operation .not. 0 = " & .not. 0)
39 message("Bitwise operation .not. -1 = " & .not. -1)
40
41 message("sh_left(1,0) = " & sh_left(1,0))
42 message("sh_left(1,1) = " & sh_left(1,1))
43 message("sh_left(1,2) = " & sh_left(1,2))
44 message("sh_left(1,3) = " & sh_left(1,3))
45 message("sh_left(1,4) = " & sh_left(1,4))
46
47 message("sh_right(128,0) = " & sh_right(128,0))
48 message("sh_right(128,1) = " & sh_right(128,1))
49 message("sh_right(128,2) = " & sh_right(128,2))
50 message("sh_right(128,3) = " & sh_right(128,3))
51
52 message("abs(-3) = " & abs(-3))
53
54 message("min(2,3) = " & min(2,3))
55 message("min(1,11) = " & min(1,11))
56 message("min(-30,4) = " & min(-30,4))
57
58 message("max(2,3) = " & max(2,3))
59 message("max(1,11) = " & max(1,11))
60 message("max(-30,4) = " & max(-30,4))
61
62 message("inc(" & $i & ") = " & inc($i))
63 message("inc(" & $i & ") = " & inc($i))
64 message("inc(" & $i & ") = " & inc($i))
65 message("dec(" & $i & ") = " & dec($i))
66 message("dec(" & $i & ") = " & dec($i))
67 message("dec(" & $i & ") = " & dec($i))
68
69 message("in_range(1,4,9) = " & in_range(1,4,9))
70 message("in_range(5,4,9) = " & in_range(5,4,9))
71 message("in_range(9,4,9) = " & in_range(9,4,9))
72 message("in_range(10,4,9) = " & in_range(10,4,9))
73
74 message("random(-5,5) = " & random(-5,5))
75 message("random(-5,5) = " & random(-5,5))
76 message("random(-5,5) = " & random(-5,5))
77
78 end on

  ViewVC Help
Powered by ViewVC