From b2d3e312b63e5353e5e9eebe519e1f95d3268331 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 1 Oct 2019 15:59:14 +0200 Subject: [PATCH 1/5] added @hv_param to MIDI out messages --- README.md | 3 --- interpreters/pd2hv/libs/pd/bendout.pd | 2 +- interpreters/pd2hv/libs/pd/ctlout.pd | 2 +- interpreters/pd2hv/libs/pd/noteout.pd | 2 +- interpreters/pd2hv/libs/pd/pgmout.pd | 2 +- interpreters/pd2hv/libs/pd/touchout.pd | 2 +- 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9e16a900..f4cbf19c 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ `hvcc` is a python-based dataflow audio programming language compiler that generates C/C++ code and a variety of specific framework wrappers. -#### IMPORTANT! -This repo is currently **unsupported** and looking for a maintainer. The original authors will not respond to messages or issues. Bugs will not be fixed. Features will not be added. You are on your own. Good luck. - ## Background The original need for `hvcc` arose from running against performance limitations while creating interactive music and sound products for the iPhone. [Pure Data](https://puredata.info) (libpd) was the only real choice for a design tool as it was embeddable and provided a high enough abstraction level that musicians or sound designers could be creative. diff --git a/interpreters/pd2hv/libs/pd/bendout.pd b/interpreters/pd2hv/libs/pd/bendout.pd index 99d1d103..fe84be46 100644 --- a/interpreters/pd2hv/libs/pd/bendout.pd +++ b/interpreters/pd2hv/libs/pd/bendout.pd @@ -4,7 +4,7 @@ #X obj 97 146 f \$1; #X obj 97 168 clip 0 15; #X obj 114 106 loadbang; -#X obj 52 233 s __hv_bendout; +#X obj 52 233 s __hv_bendout @hv_param; #X obj 52 40 inlet bend; #X connect 0 0 5 0; #X connect 1 0 2 0; diff --git a/interpreters/pd2hv/libs/pd/ctlout.pd b/interpreters/pd2hv/libs/pd/ctlout.pd index ac05290d..b5a44411 100644 --- a/interpreters/pd2hv/libs/pd/ctlout.pd +++ b/interpreters/pd2hv/libs/pd/ctlout.pd @@ -2,7 +2,7 @@ #X obj 59 267 pack f f f; #X obj 155 76 loadbang; #X obj 116 156 inlet channel; -#X obj 59 299 s __hv_ctlout; +#X obj 59 299 s __hv_ctlout @hv_param; #X obj 59 46 inlet value; #X obj 116 203 f \$2; #X obj 87 76 inlet cc; diff --git a/interpreters/pd2hv/libs/pd/noteout.pd b/interpreters/pd2hv/libs/pd/noteout.pd index 4e406178..9ba51298 100644 --- a/interpreters/pd2hv/libs/pd/noteout.pd +++ b/interpreters/pd2hv/libs/pd/noteout.pd @@ -1,6 +1,6 @@ #N canvas 1122 327 278 331 10; #X obj 59 217 pack f f f; -#X obj 59 249 s __hv_noteout; +#X obj 59 249 s __hv_noteout @hv_param; #X obj 59 46 inlet note; #X obj 87 76 inlet vel; #X obj 126 133 loadbang; diff --git a/interpreters/pd2hv/libs/pd/pgmout.pd b/interpreters/pd2hv/libs/pd/pgmout.pd index b8ab539d..4b33a130 100644 --- a/interpreters/pd2hv/libs/pd/pgmout.pd +++ b/interpreters/pd2hv/libs/pd/pgmout.pd @@ -1,5 +1,5 @@ #N canvas 1122 327 232 295 10; -#X obj 52 233 s __hv_pgmout; +#X obj 52 233 s __hv_pgmout @hv_param; #X obj 52 201 pack f f; #X obj 97 74 inlet channel; #X obj 97 146 f \$1; diff --git a/interpreters/pd2hv/libs/pd/touchout.pd b/interpreters/pd2hv/libs/pd/touchout.pd index 3871da19..0cc0bb18 100644 --- a/interpreters/pd2hv/libs/pd/touchout.pd +++ b/interpreters/pd2hv/libs/pd/touchout.pd @@ -5,7 +5,7 @@ #X obj 97 168 clip 0 15; #X obj 114 106 loadbang; #X obj 52 40 inlet touch; -#X obj 52 233 s __hv_touchout; +#X obj 52 233 s __hv_touchout @hv_param; #X connect 0 0 6 0; #X connect 1 0 2 0; #X connect 2 0 3 0; From 9672d54de7b71844b80aff29e44bb047a8f95159 Mon Sep 17 00:00:00 2001 From: yann Date: Tue, 1 Oct 2019 14:47:44 +0000 Subject: [PATCH 2/5] Added support for @owl_channel annotation --- interpreters/pd2hv/PdReceiveObject.py | 5 +++++ interpreters/pd2hv/PdSendObject.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/interpreters/pd2hv/PdReceiveObject.py b/interpreters/pd2hv/PdReceiveObject.py index dde9d76d..9b494eb3 100644 --- a/interpreters/pd2hv/PdReceiveObject.py +++ b/interpreters/pd2hv/PdReceiveObject.py @@ -65,6 +65,7 @@ def __init__(self, obj_type, obj_args=None, pos_x=0, pos_y=0): except: pass + if not (self.__attributes["min"] <= self.__attributes["default"]): self.add_error("Default parameter value is less than the minimum. Receiver will not be exported: {0:g} < {1:g}".format( self.__attributes["default"], @@ -76,6 +77,10 @@ def __init__(self, obj_type, obj_args=None, pos_x=0, pos_y=0): self.__attributes["max"])) self.__extern_type = None + if '@owl_channel' in self.obj_args: + i = self.obj_args.index('@owl_channel') + self.__attributes["owl_channel"] = self.obj_args[i+1] + def validate_configuration(self): if self.obj_type in ["r~", "receive~"]: if len(self._inlet_connections.get("0",[])) > 0: diff --git a/interpreters/pd2hv/PdSendObject.py b/interpreters/pd2hv/PdSendObject.py index 7db47730..dbd02424 100644 --- a/interpreters/pd2hv/PdSendObject.py +++ b/interpreters/pd2hv/PdSendObject.py @@ -38,6 +38,10 @@ def __init__(self, obj_type, obj_args=None, pos_x=0, pos_y=0): except: pass + if '@owl_channel' in self.obj_args: + i = self.obj_args.index('@owl_channel') + self.__attributes["owl_channel"] = self.obj_args[i+1] + def validate_configuration(self): if len(self.obj_args) == 0: self.add_warning( From 23773c7c6352f240718d8c4d0bbd83ba7862e85b Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 14 Oct 2019 01:46:13 +0200 Subject: [PATCH 3/5] shortened attribute to @owl and added optional min, max, default values --- interpreters/pd2hv/PdReceiveObject.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/interpreters/pd2hv/PdReceiveObject.py b/interpreters/pd2hv/PdReceiveObject.py index 9b494eb3..21f1815b 100644 --- a/interpreters/pd2hv/PdReceiveObject.py +++ b/interpreters/pd2hv/PdReceiveObject.py @@ -77,9 +77,15 @@ def __init__(self, obj_type, obj_args=None, pos_x=0, pos_y=0): self.__attributes["max"])) self.__extern_type = None - if '@owl_channel' in self.obj_args: - i = self.obj_args.index('@owl_channel') - self.__attributes["owl_channel"] = self.obj_args[i+1] + if '@owl' in self.obj_args: + i = self.obj_args.index('@owl') + if len(self.obj_args) > i+1: + self.__attributes["owl_param"] = self.obj_args[i+1] + else: + self.add_error("@owl annotation missing parameter designator") + self.__attributes["owl_min"] = float(self.obj_args[i+2]) if len(self.obj_args) > i+2 else 0 + self.__attributes["owl_max"] = float(self.obj_args[i+3]) if len(self.obj_args) > i+3 else 1 + self.__attributes["owl_default"] = float(self.obj_args[i+4]) if len(self.obj_args) > i+4 else 0.5 def validate_configuration(self): if self.obj_type in ["r~", "receive~"]: From 9c56a7a918fcb87ecb0bd3ec7a542bbe113237cf Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 14 Oct 2019 03:19:25 +0200 Subject: [PATCH 4/5] use new owl annotation format, output min, max and default values --- interpreters/pd2hv/PdSendObject.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/interpreters/pd2hv/PdSendObject.py b/interpreters/pd2hv/PdSendObject.py index dbd02424..75189da2 100644 --- a/interpreters/pd2hv/PdSendObject.py +++ b/interpreters/pd2hv/PdSendObject.py @@ -38,9 +38,15 @@ def __init__(self, obj_type, obj_args=None, pos_x=0, pos_y=0): except: pass - if '@owl_channel' in self.obj_args: - i = self.obj_args.index('@owl_channel') - self.__attributes["owl_channel"] = self.obj_args[i+1] + if '@owl' in self.obj_args: + i = self.obj_args.index('@owl') + if len(self.obj_args) > i+1: + self.__attributes["owl_param"] = self.obj_args[i+1] + else: + self.add_error("@owl annotation missing parameter designator") + self.__attributes["owl_min"] = float(self.obj_args[i+2]) if len(self.obj_args) > i+2 else 0 + self.__attributes["owl_max"] = float(self.obj_args[i+3]) if len(self.obj_args) > i+3 else 1 + self.__attributes["owl_default"] = float(self.obj_args[i+4]) if len(self.obj_args) > i+4 else 0.5 def validate_configuration(self): if len(self.obj_args) == 0: From d26624fb11cb95885623029e0efddc484f035233 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 14 Oct 2019 12:45:47 +0200 Subject: [PATCH 5/5] mark @owl send as extern to ensure code is generated --- interpreters/pd2hv/PdSendObject.py | 1 + 1 file changed, 1 insertion(+) diff --git a/interpreters/pd2hv/PdSendObject.py b/interpreters/pd2hv/PdSendObject.py index 75189da2..91e17725 100644 --- a/interpreters/pd2hv/PdSendObject.py +++ b/interpreters/pd2hv/PdSendObject.py @@ -47,6 +47,7 @@ def __init__(self, obj_type, obj_args=None, pos_x=0, pos_y=0): self.__attributes["owl_min"] = float(self.obj_args[i+2]) if len(self.obj_args) > i+2 else 0 self.__attributes["owl_max"] = float(self.obj_args[i+3]) if len(self.obj_args) > i+3 else 1 self.__attributes["owl_default"] = float(self.obj_args[i+4]) if len(self.obj_args) > i+4 else 0.5 + self.__extern_type = "param" # make sure output code is generated def validate_configuration(self): if len(self.obj_args) == 0: