Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Feature/new owl attribute format #26

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions interpreters/pd2hv/PdReceiveObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -76,6 +77,16 @@ def __init__(self, obj_type, obj_args=None, pos_x=0, pos_y=0):
self.__attributes["max"]))
self.__extern_type = None

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~"]:
if len(self._inlet_connections.get("0",[])) > 0:
Expand Down
11 changes: 11 additions & 0 deletions interpreters/pd2hv/PdSendObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ def __init__(self, obj_type, obj_args=None, pos_x=0, pos_y=0):
except:
pass

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
self.__extern_type = "param" # make sure output code is generated

def validate_configuration(self):
if len(self.obj_args) == 0:
self.add_warning(
Expand Down
2 changes: 1 addition & 1 deletion interpreters/pd2hv/libs/pd/bendout.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion interpreters/pd2hv/libs/pd/ctlout.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion interpreters/pd2hv/libs/pd/noteout.pd
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion interpreters/pd2hv/libs/pd/pgmout.pd
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion interpreters/pd2hv/libs/pd/touchout.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down