Repository navigation
Add oav-p5 to libraries - #1657
Open
frank890417 wants to merge 1 commit into
Open
frank890417 wants to merge 1 commit into
frank890417 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds oav-p5 to the libraries directory, in the
soundcategory.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…knob8are read likemouseXand hold values from 0 to 1,pad(n)holds the velocity while a pad is held (0 when released),noteandvelocityhold the last key, andnotePressed(note, velocity)is defined likekeyPressed(). 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
in
index.htmlafter p5 and beforesketch.js, or the one-line loader shown on the docs page as the first line ofsketch.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
soundbecause it is MIDI in, plus microphone and sound.hardwarewould 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.