Open
Description
p5.js version
2.x
What is your operating system?
Mac OS
Web browser and version
Firefox
Actual Behavior
Currently, if you switch the p5 version to 2.0 and then run the default sketch, you get this error in the browser console:

This is coming from the old p5.sound, made for 1.x. However, there isn't a way to easily switch it to the new p5.sound. Turning it off and on again uses the old p5.sound still, since we currently try to restore whatever the original version was in a sketch:

Definitely not obvious, but if you turn off p5.sound, save, and reload, and then turn it back on, THEN it turns on the new p5.sound which works with 2.0.
Expected Behavior
I'm not sure what the best way forward here is, I'd appreciate your input @ksen0 and @raclim! Some options I can think of:
- Auto-update from old p5.sound to new p5.sound when you switch to 2.0
- Downside: either there's no easy way to switch back to the old p5.sound if you go back to 1.x, or our existing logic keeping track of the last version of p5.sound you had needs to change to handle this special case
- Auto-disable p5.sound when you switch to 2.0 and remove the feature where we keep track of the previous p5.sound version
- This would mean toggling back on p5.sound would use the new version when you're in 2.x
- If you change back to 1.x and then turn on p5.sound again, you'd get the default version of old p5.sound and not whichever specific version you were previously using
Steps to reproduce
- Switch p5 version to 2.0
- p5.sound is still the old version in index.html
Metadata
Metadata
Assignees
Type
Projects
Status
In Progress