aboutsummaryrefslogtreecommitdiff
path: root/vm.ttl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-23 11:11:39 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-23 11:11:39 +0100
commit3a9f0f747a5356b6ec304867db716f0e3ccb07ae (patch)
tree843e0d35a06ccbdbeab8464ec480457e16a251d2 /vm.ttl
parent6a701319a47ff5950f4ca918e744cf1fba088869 (diff)
downloadvm.lv2-3a9f0f747a5356b6ec304867db716f0e3ccb07ae.tar.xz
implement vm:opGoto.
* makes branching and looping possible.
Diffstat (limited to 'vm.ttl')
-rw-r--r--vm.ttl65
1 files changed, 63 insertions, 2 deletions
diff --git a/vm.ttl b/vm.ttl
index a8fdcc4..ad6432e 100644
--- a/vm.ttl
+++ b/vm.ttl
@@ -72,8 +72,8 @@ vm:opLoad
a rdfs:Datatype .
vm:opBreak
a rdfs:Datatype .
-#vm:opGoto
-# a rdfs:Datatype .
+vm:opGoto
+ a rdfs:Datatype .
vm:opRand
a rdfs:Datatype .
@@ -998,6 +998,67 @@ vm:add
]
] .
+vm:sumLoop
+ a pset:Preset ;
+ lv2:appliesTo vm:control ,
+ vm:cv ,
+ vm:atom ,
+ vm:audio ;
+ rdfs:label "Sum in a loop" ;
+ state:state [
+ vm:graph [
+ a atom:Tuple ;
+ rdf:value (
+ # Acc := 0.0
+ # for(Store0 := 7; Store0 >= 0; Store0 := Store0 - 1)
+ # Acc := Acc + Input(Store0)
+ 0.0
+ 7
+ 0 vm:opStore
+ 0 vm:opLoad # goto target
+ vm:opInput
+ vm:opAdd
+ 0 vm:opLoad
+ 1 vm:opSub
+ 0 vm:opStore
+ 4
+ 0 vm:opLoad
+ 0 vm:opGe
+ vm:opGoto
+ )
+ ]
+ ] .
+
+vm:sumLinear
+ a pset:Preset ;
+ lv2:appliesTo vm:control ,
+ vm:cv ,
+ vm:atom ,
+ vm:audio ;
+ rdfs:label "Sum" ;
+ state:state [
+ vm:graph [
+ a atom:Tuple ;
+ rdf:value (
+ 0 vm:opInput
+ 1 vm:opInput
+ vm:opAdd
+ 2 vm:opInput
+ vm:opAdd
+ 3 vm:opInput
+ vm:opAdd
+ 4 vm:opInput
+ vm:opAdd
+ 5 vm:opInput
+ vm:opAdd
+ 6 vm:opInput
+ vm:opAdd
+ 7 vm:opInput
+ vm:opAdd
+ )
+ ]
+ ] .
+
vm:sub
a pset:Preset ;
lv2:appliesTo vm:control ,