https://github.com/munshkr/hydra-p5
A simpler P5 intergration for Hydra
https://github.com/munshkr/hydra-p5
hydra hydra-synth p5js
Last synced: 4 months ago
JSON representation
A simpler P5 intergration for Hydra
- Host: GitHub
- URL: https://github.com/munshkr/hydra-p5
- Owner: munshkr
- License: gpl-3.0
- Created: 2022-10-22T12:16:22.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-19T15:20:49.000Z (over 2 years ago)
- Last Synced: 2025-03-28T05:51:04.381Z (6 months ago)
- Topics: hydra, hydra-synth, p5js
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# hydra-p5
A simpler P5 intergration for Hydra
## Usage
```javascript
await loadScript("https://unpkg.com/hydra-p5")p5src(s0)
.setup((p) => {
// this runs only once, but re-executes
// when evaluating the whole block...
})
.draw((p) => {
// this runs on every frame
p.clear()
p.rect(p.mouseX, p.mouseY, 300, 300)
})
// now you can keep using hydra like a normal source...
.modulate(noise())
.out()
```There is an experimental `drawP` and `setupP` that allows you to use P5 in
"global" mode inside their callback functions:```javascript
p5src(s0)
.drawP(_ => {
clear()
rect(mouseX, mouseY, 300, 300)
})
.out()
```
## ContributingBug reports and pull requests are welcome on GitHub at the [issues
page](https://github.com/munshkr/hydra-p5). This project is intended to be a safe,
welcoming space for collaboration, and contributors are expected to adhere to
the [Contributor Covenant](http://contributor-covenant.org) code of conduct.## License
This project is licensed under GPL 3+. Refer to [LICENSE.txt](LICENSE.txt)