Skip to content

Connecting Signals to other inputs does not always work appropriately #56

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
infovore opened this issue May 11, 2025 · 2 comments
Open

Comments

@infovore
Copy link

This demo passes an oscillator as the param to osc.amp, the idea being it acts as a low-frequency oscillator to modulate amplitude. It works correctly.

Passing the LFO to osc.freq instead (osc.freq(lfo) in the setup method) - which the documentation says is possible, Or, pass in an object such as an oscillator to modulate the frequency with an audio signal. - leads to this error:

RangeError: Value must be within [0, 3.4028234663852886e+38], got: NaN

which is related to rampTo.

Of course, that's possibly trying to set an osccilator to a range between 1 and -1 - fairly standard - so I thought I'd use Oscillator.add and...

osc.add is not a function. Neither is getFreq, for that matter. I'm lost; I have p5 2.0.1, sound 0.2.0, and the listed examples work correctly... but it's unclear at the minute if the error is in code, documentation, or both.

@ogbabydiesal
Copy link
Collaborator

ogbabydiesal commented May 28, 2025

there is currently no osc.add function or getFreq in the new library, the documentation you are referring to is probably for the previous p5.sound.js library, and it seems that both of the libraries (new and old) documentation are shuffled together and that this is something that is being worked on.

i can imagine something like osc.add coming back - and maybe not getFreq but maybe so!

@infovore
Copy link
Author

Yeah: I realised pretty quickly that the documentation is shuffled together, but it did not make life easy.

However - osc.freq, which I believe is part of the new library... still doesn't behave as its documentation says it does.

@ksen0 ksen0 moved this to Bug/Investigation 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: Bug/Investigation
Development

No branches or pull requests

2 participants