Tutorial Part 2: Coding your plug-in, help

Hey all!

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.

Xcode 11.5
OSX 10.15.5
Juce 6.0.1

Did you remember to create the noteOnVel member variable in your processor header file? Described about half way through the tutorial:

public:
    float noteOnVel;
1 Like

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.

1 Like

I have the same issue…

“Unknown type name ‘uint8’; did you mean ‘uint’”

How did you solve this?
Thanks!

in juce6 you might need juce::uint8 ?

It is probably a typedef to uint8_t anyway…

1 Like

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”

1 Like

this was helpful to see jnicol. Thanks

1 Like

thanks. Been using Juce for one day and you solved the first hurdle I hit. :slight_smile:

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);
2 Likes

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. :wink:

If you like uninitialised variables, then yes, avoid auto :stuck_out_tongue:

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…