Skip to content

Overview of modified/deprecated functions from previous p5.sound? #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ffd8 opened this issue Dec 17, 2024 · 12 comments
Open

Overview of modified/deprecated functions from previous p5.sound? #45

ffd8 opened this issue Dec 17, 2024 · 12 comments

Comments

@ffd8
Copy link

ffd8 commented Dec 17, 2024

Congrats @ogbabydiesal and all involved in this revamp of p5.sound! I had last followed the refresh in 2023, but hadn't been following updates until the processing.org announcement today. I have a few small/big questions:

  • is there an overview of the major deprecated/removed/modified functions from previous p5.sound? I've read the Medium announcement, checked the references, checked editor examples, but can't find a sort of migration explainer for updating. While attempting to implement latest p5.sound into P5LIVE, the technique used for audio-reactivity the past 6 years stopped working, because I think plenty of changes occurred to both p5.audioIn(), p5.FFT() (audioIn complains about missing methods like getLevel() and FFT complains about setInput() and logAverages()... would be very helpful if the FES for any broken p5.sound functions pointed to that resource, since it's likely to happen a lot for any sketches older than 2024. Here's my audio-reactive template – any insights for updating it would be appreciated.

  • name is the same to before, however the versioning was reset, currently at 0.10.0 – guessing this will be an issue as it develops or reaches a 1.0 status? The last release of the old p5.sound made it to 1.0.1 (or 1.0.3?). Using 2.0.0+ would make it more clear that functions have been dropped entirely and others work differently than before?

  • would be helpful if the minified version included a similar timestamp/version header for keeping track of which version one adds to a project:
    /** [p5.sound] Version: 1.0.1 - 2021-05-25 */

  • FYI, finding false references, which is likely known. I was attempting to read up on the difference of how the p5.FFT would work – wished there were more tiny demos for some of the methods that previous version had, then when trying to get the overview, saw that things like polySynth() are still active, yet causes an error as the method doesn't exist (which tells me new p5.sound is used on refs page). Maybe there's plans to reimplement polySynth and others?

  • an overview of all classes and what they're used for, similar to top of [old references for p5.sound(https://archive.p5js.org/reference/#/libraries/p5.sound) would be super helpful for students and total beginners. Maybe it's an aspect of the new website, or something to add to the lib.

Edit: just realized some functions like audioIn() have drastically different behaviors that could cause some big speaker/sound/feedback issues when loading any prior sketches. In the previous version, using the mic didn't sent it to the output, ie with monitoring – it was silent. Just realized new version instantly plays out what comes in from the mic (haha heard weiird scratching sounds when hand brushed passed mic):

mic = new p5.AudioIn()
mic.start() // old version was no prob, new version causes feedback

Thanks for taking aspects into consideration, particularly a guide for migrating to this version.

@ogbabydiesal
Copy link
Collaborator

hey @ffd8

  • overview of deprecated features (grayed out) can be found here, we should probably make this more visible somewhere!: https://docs.google.com/spreadsheets/d/1djPAqeMPHvbevpk_b_VBPjgAEZzjwQd0Pye04EIzvMI/edit?gid=1571497897#gid=1571497897
    one of the goals in the revamp was to deprecate some duplicate functionality, so while audioIn() has the getLevel() method, so does the amp class which is dedicated for that purpose. However, one might make the case that it is an important feature of the p5.sound.js library as a beginner friendly audio visualization tool 🤔, would be easy to add back in... forFFT() I figured setInput() was duplicating functionality in the connect disconnect method, and logAverages() would be a more advanced feature that would warrant someone reaching for Tone.js -
  • makes sense about versioning I'll defer to @limzykenneth and @davepagurek on this topic
  • for the minified versioning same as above
  • yes I noticed this the other day as well, the references for the old library are still up and I have to go through and remove them, no more polysynth
  • i believe the documentation will look as it did in the old site, with a description of each class and it's methods with example sketch
  • as for the AudioIn() feedback issue, good catch, I'll revert that back to original functionality!

let's chat about the deprecated methods in FFT and AudioIn some more

@davepagurek
Copy link
Collaborator

Btw there's an issue here processing/p5.js-website#636 you can follow for the old methods still showing up on the site!

@ogbabydiesal
Copy link
Collaborator

AudioIn() now has the original microphone behavior, not connected to the output speakers by default ;)

@SableRaf
Copy link

Hey @ogbabydiesal and thanks for all your hard work!

I couldn't help myself turning your spreadsheet into a table—I'm a bit obsessed with spreadsheets 😅—You can find my version here (see screenshot below).

Note: I wasn't sure what the greyed out rows meant so I made it a checkbox (unchecked rows get greyed out via conditional formatting).

Happy to give you edit access if you'd like to use it!

image

@ogbabydiesal
Copy link
Collaborator

gorgeous table @SableRaf this is epic! i would fill out some details and use it going forward if you give edit access - going to close this issue and make separate issues for some of the items in original post by @ffd8

@SableRaf
Copy link

@ogbabydiesal Thanks for the kind words 😊 I gave you edit access. Feel free to make changes and fix anything I misunderstood. And let me know if you need help with any of it.

@ogbabydiesal
Copy link
Collaborator

hi @SableRaf going to feature your beautiful table more prominently in a survey to p5.sound.js users if that's ok with you

@SableRaf
Copy link

@ogbabydiesal Please go ahead! Happy you found it helpful.

@ogbabydiesal
Copy link
Collaborator

thanks @SableRaf going to show it at the contributor meetup tomorrow in ny
https://www.eventbrite.com/e/p5js-contributors-meetup-nyc-tickets-1235327721469?aff=oddtdtcreator

@ksen0 ksen0 reopened this Mar 18, 2025
@ksen0
Copy link
Member

ksen0 commented Mar 18, 2025

Hi @ogbabydiesal ! Sorry to reopen this, but it seemed better (I hope) than opening a whole other thread on a similar/overlapping topic.

I'm wondering what's the story with PolySynth in particular? I don't see it in the spreadsheet; but I do see that it exists in tone.js quite directly. Was the idea that new p5.sound.js users could make more use of tone.js functions directly, or what would be the way they can access that functionality?

@ogbabydiesal
Copy link
Collaborator

hi @ksen0 - the new p5.sound.js library has a more narrow set of classes from the tone.js library and that of the original p5.sound.js library - combining tone.js and p5.sound.js classes and connecting them in the same audio graph is technically possible but not documented - i think the thinking was that if the p5.sound.js features were not enough then you would just use tone.js entirely.

That would be a fun example sketch though (bringing extra tone.js features into a p5.sound.js audio graph) - and there is an example sketch of how to combine p5.sound.js with Cycling74's RNBO on a common web audio graph.

polysynth should have been included the spreadsheet (as it was in the original library) as deprecated but we can certainly discuss if it should be implemented in this new library.

does that answer the question?

@ffd8
Copy link
Author

ffd8 commented Apr 18, 2025

@ogbabydiesal @SableRaf thanks for detailed infos from this thread – somehow lost track of it.. until picking up conversation just now with @ogbabydiesal on another platform. I'll try to make a short list of wish they were here functions as separate issues – there's really minimal ones like getLevel() which could simply be turned into an alias for amp.getLevel() so that old code/tutorials/print still works. Then there's others like the pan on an oscillator – which doesn't note if it will return? I'm an oscilloscope/vector-head and having ability to hard pan an oscillator (-1 or 1) is super useulf/fun for X-Y mode on oscilloscope explorations.

@ksen0 ksen0 moved this to In Progress in p5.sound.js Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

5 participants