Skip to content

Fix missing p5. prefix in Simple Melody App tutorial#1124

Open
aashu2006 wants to merge 1 commit intoprocessing:mainfrom
aashu2006:fix/oscillator-constructor-bug
Open

Fix missing p5. prefix in Simple Melody App tutorial#1124
aashu2006 wants to merge 1 commit intoprocessing:mainfrom
aashu2006:fix/oscillator-constructor-bug

Conversation

@aashu2006
Copy link
Contributor

@aashu2006 aashu2006 commented Feb 1, 2026

Problem

Line 298 in the Simple Melody App tutorial contains broken code that throws a runtime error:

// Current code (broken)
osc = new Oscillator(myFreq);  // ReferenceError: Oscillator is not defined

Solution

Added the missing p5. prefix:

// Fixed code
osc = new p5.Oscillator(myFreq);  // Works correctly

Why This Fix Is Needed

  • Breaks the tutorial for all users at this step
  • Inconsistent with other examples in the same tutorial
  • Prevents learners from completing the app

Testing

  • Tested code with new Oscillator() - confirms error occurs
  • Tested code with new p5.Oscillator() - confirms fix works
  • Verified consistency with rest of tutorial

Fixes a ReferenceError in the simple-melody-app tutorial where Oscillator was used without the p5 namespace, causing the example to fail at runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant