p5.sound's midiToFreq() allows microtonality (decimal MIDI notes)
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 38/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- documentation
Research direction
Start at the p5.sound midiToFreq() reference page linked in the issue and review how its General MIDI description presents accepted values. Done means adding a note that decimal MIDI values produce microtonal frequencies without rounding; no specific source file or test is named in the issue.
Written by the indexing model from the issue text.
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
1.11.1
Web browser and version
Firefox 133.0.3
Operating system
Windows 11
Steps to reproduce this
Steps:
- Decimal numbers in midiToFreq() return microtonal values, because they're not rounded first.
- This is actually a pretty cool feature, and allows some creative possibilites (microtonal music!), but it might be unexpected for some because the reference implies the value should be an integer MIDI note number:
General MIDI treats notes as integers where middle C is 60, C# is 61, D is 62 etc. Useful for generating musical frequencies with oscillators.
Rather than 'fix' this, adding a note to the reference description along the lines of 'Decimal values return microtonal frequencies.' Might clarify that those values won't be rounded to equal temperament tuning, but keep a pretty cool, if unexpected, feature?
Snippet:
console.log(midiToFreq(60)); // returns 261.6255653005986 (Hz) = C4
console.log(midiToFreq(60.5)); // returns 269.2917795270241 = C4 quarter-sharp!
console.log(midiToFreq(61)); // returns 277.1826309768721 = C#4
I'd be happy to add this note to the reference if it's accepted.
- Dominant language
- JavaScript
- Stars
- 60
- Forks
- 26
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 7
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from processing/p5.sound.js
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
processing/p5.sound.js#113 · 1 comment · 1 reaction ·
-
p5.sound.js version 2 releaseMay be free again @ksen0 claimed this 133 days ago, and no pull request is open. Open
processing/p5.sound.js#86 · 1 comment · 2 assignees ·
-
enhancement good first issue
Difficulty 3/5 1-2 days Newbie friendliness 62/100
processing/p5.sound.js#57 · 8 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
processing/p5.sound.js#56 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
processing/p5.sound.js#52 · 3 comments ·
All issues in processing/p5.sound.js
Similar issues
-
task
Difficulty 1/5 Under an hour Newbie friendliness 83/100
TAMULib/fw-registry#550 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
-
NWCWalletService.subscribe: response is never published if the handler finishes after unsubscribe (regression in 8.1.0)Possibly taken @ajaysehwal claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
bigskysoftware/htmx#4151 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100