Skip to content
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

Cant set oscillator pitch correctly #74

Open
steeley opened this issue Aug 6, 2022 · 2 comments
Open

Cant set oscillator pitch correctly #74

steeley opened this issue Aug 6, 2022 · 2 comments

Comments

@steeley
Copy link

steeley commented Aug 6, 2022

using the example_basics1_patching on osx with OF 0.11.2.
The pitch numbers don't appear to make any sense. Trying to set the frequency of an oscillator.

100.0f >> osc.in_pitch();

gives 2.62kHz

50.0f gives 150Hz

Clearly something very wrong here!

@npisanti
Copy link
Owner

in ofxPDSP anything with in_pitch() is scaled in semitones (by default using 440hz as reference, but that can be changed), and everything that uses in_freq() is scaled in hertz.

All the high level "modules" are composed by various DSP units and usually use pitch input, while the lower level blocks use freq inputs.

you can solve this either by using pitch values, by converting freq to pitch with the pdsp::f2p() function, or by making your own modules with freq inputs (that's more advanced stuff but you can start from the ones in the 'src/module` folder)

@steeley
Copy link
Author

steeley commented Aug 10, 2022

Ahh ok... sorry for the misunderstanding.
Ideally it would be nice for all things that produce a waveform to have both in_pitch() and in_freq() by default.
But I guess can use pdsp::f2p() to solve my immediate problem.

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

No branches or pull requests

2 participants