I’m sure this is a noob question so I apologize, I’m currently trying to follow the Tutorial: Create a basic Audio/MIDI plugin, Part 2: Coding your plug-in, and i’m running into some issues,
I believe I have everything coded correctly but seem to get the following errors,
No member named ‘noteOnVel’ in ‘juce::AudioProcessor’
Unknown type name ‘uint8’; did you mean ‘uint’?
Editor placeholder in source file (this is on sliderValueChanged(juce::Slider *slider))
Sorry if this is a super easy one that i just missed.
Did you remember to create the noteOnVel member variable in your processor header file? Described about half way through the tutorial:
Hey! I actually had put that in the wrong header file! now the only error I get is
call to ‘noteOn’ is ambiguous.
There are two versions of the noteOn method. One accepts a float for the velocity parameter and the other accepts a uint8. Possibly it isn’t clear to the compiler which version you’re calling. I notice that in the tutorial noteOnVel is cast to uint8 before being passed to noteOn, so make sure you’re doing that too.
I have the same issue…
“Unknown type name ‘uint8’; did you mean ‘uint’”
How did you solve this?
in juce6 you might need
It is probably a typedef to
Ah yep, that was it. Cheers!
juce::uint8 was a HUGE help! however still getting the “No member named noteOnVel” error, seems like most of the confusion is from differences in juce 6
GOT IT! Apparently now you need to do “audioProcessor.noteOnVel” rather than the old way of simply “processor.noteOnVel”
this was helpful to see jnicol. Thanks
thanks. Been using Juce for one day and you solved the first hurdle I hit.
FYI: Error is still there.
uint8 newVel = (uint8)noteOnVel;
It must be:
juce::uint8 newVel = (juce::uint8)noteOnVel;
Or even better
auto newVel = juce::uint8 (noteOnVel);
Or even better in that case, don’t use a local variable at all! Notice that i’m this kind of old school pitiful guy that still resists to the generalized usage of auto.
If you like uninitialised variables, then yes, avoid auto
And local variables have an advantage, they can serve as implicit comments to explain, what you assigned to it. Granted in this example it doesn‘t tell much…