p5.sound.js icon indicating copy to clipboard operation
p5.sound.js copied to clipboard

Add example sketches for all p5.Amplitude methods in p5.Sound reference

Open perminder-17 opened this issue 6 months ago • 5 comments

Increasing Access

The p5.Sound reference pages currently lack live examples. This issue is specifically for the p5.Amplitude class. Without examples, it’s hard for users to see how each method behaves in a sketch.

Add one or more simple example sketches demonstrating each of the following p5.Amplitude methods:

  • [ ] getLevel()
  • [ ] setInput()
  • [ ] smooth()
  • [ ] toggleNormalize()

You can consult the API details here for guidance: https://p5js.org/reference/p5.sound/p5.Amplitude/

Feel free to add one example or multiple examples for any of these methods and submit a PR..

Most appropriate sub-area of p5.js?

Reference

Feature request details

A pull request that updates the p5.sound reference documentation with at least one working code example per method, so that users can immediately copy, paste, and run each sketch to learn how p5.Amplitude works.

perminder-17 avatar Jul 13 '25 23:07 perminder-17

Hey @perminder-17, I would be interested in contributing to this issue with relevant examples for the docs. Can you please assign it to me?

0xs1r4t avatar Jul 15 '25 17:07 0xs1r4t

Hi @0xs1r4t, I’m assigning this issue to you. Are you interested in documenting all four functions i.e. getLevel(), setInput(), smooth(), and toggleNormalize() or would you prefer to contribute to a specific one? Let me know your preference.

perminder-17 avatar Jul 16 '25 21:07 perminder-17

@perminder-17, I would be interested in documenting all four functions. I noticed that one example exists for both setInput() and getLevel(), but not for toggleNormalize() and smooth(). Should I just add examples for the later two, or should I also rework the examples for the earlier two functions?

0xs1r4t avatar Jul 17 '25 08:07 0xs1r4t

@perminder-17, I would be interested in documenting all four functions. I noticed that one example exists for both setInput() and getLevel(), but not for toggleNormalize() and smooth(). Should I just add examples for the later two, or should I also rework the examples for the earlier two functions?

I guess you are correct about the functions setInput() and getLevel() the examples are already documented but the issue is with the beta site which works on 2.x versions. https://beta.p5js.org/reference/p5.sound/

Have a look here, and you can see only few are documented. If you feel to rework and add more description, feel free to add them or you can probably focus more on adding example sketches and descriptions.

perminder-17 avatar Jul 17 '25 10:07 perminder-17

Oh okay cool, I'll which one works best and then create a PR.

0xs1r4t avatar Jul 17 '25 10:07 0xs1r4t