Skip to content

Add oav-p5 to libraries - #1657

Open
frank890417 wants to merge 1 commit into
processing:mainfrom
frank890417:add-oav-p5
Open

frank890417 wants to merge 1 commit into
processing:mainfrom
frank890417:add-oav-p5

Conversation

@frank890417

Copy link
Copy Markdown

Adds oav-p5 to the libraries directory, in the sound category.

oav-p5 is the p5.js add-on of open-audiovisual (MIT). With one script on the page, a sketch reads a MIDI controller the way it reads the mouse: knob1 … knob8 are read like mouseX and hold values from 0 to 1, pad(n) holds the velocity while a pad is held (0 when released), note and velocity hold the last key, and notePressed(note, velocity) is defined like keyPressed(). With no MIDI device, the 🎹 button opens an on-screen controller that drives the same variables. The same file can also read the microphone (micLevel, bass, beatDetected()) and start a sampled instrument, a drum machine or a canvas recording when a sketch asks for them.

Getting started

<script src="https://openaudiovisual.com/p5/oav-p5.js"></script>

in index.html after p5 and before sketch.js, or the one-line loader shown on the docs page as the first line of sketch.js. It is not on npm; the file is served from openaudiovisual.com.

Tested (the test was run with Claude Code, see the disclosure below) in the p5.js Web Editor, in an unsaved sketch, with p5 2.3.4 and 1.11.13 and both ways of loading it: the on-screen controller opens, turning knob 1 changes the background, notePressed() is called with the note and velocity, and the console shows no errors.

Image: 1500×1000 PNG, a screenshot of example 15 running with the on-screen controller open.

Category: I picked sound because it is MIDI in, plus microphone and sound. hardware would also fit; happy to change it.

AI disclosure: I used Claude (Claude Code) to read the contribution guide, draft this entry and its description, take the screenshot, and run the Web Editor test above. I am the author of oav-p5, and I checked the entry and this description before opening the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant