Skip to content

Commit

Permalink
improve getter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
DBraun committed Jul 24, 2024
1 parent 1d30ae0 commit 5963ae0
Show file tree
Hide file tree
Showing 6 changed files with 293 additions and 73 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,17 @@ If you'd like to build the ChucKDesigner plugins yourself, these are the instruc

### Python interface to ChucK Audio CHOP

The ChucK Audio CHOP's functions:
The ChucK Audio CHOP's getter methods:

* `.get_float(name: str) -> float`
* `.get_int(name: str) -> int`
* `.get_string(name: str) -> str`
* `.get_float_array(name: str) -> List[float]`
* `.get_int_array(name: str) -> List[int]`

Note that these getters return results with a one-frame delay. They will return `None` the first time they're called. If `None` is returned on later calls, it means that the requested global variable wasn't found.

The ChucK Audio CHOP's setter methods:

* `.set_float(name: str, val: float)`
* `.set_int(name: str, val: int)`
Expand All @@ -83,6 +93,8 @@ The ChucK Audio CHOP's functions:
* `.broadcast_event(name: str)`
* `.set_log_level(level: int)` **0 is None and 10 is "Crazy"**

### Example

Suppose the ChucK Audio CHOP has compiled this code:

```chuck
Expand Down
Loading

0 comments on commit 5963ae0

Please sign in to comment.