Easiest way to change waveform?

Hi!! I just started JUCE this week. I have a long history in C++ and other languages. JUCE poses a problem as there is not yet a lot of documentation about it.

I really want to be able to change waveform or use multiple, with user selection, like a classic 3xOsc.

PluginProcessor.cpp::
http://pastebin.com/0xiEVVAK

PluginEditor.cpp::
http://pastebin.com/iKQEm0j4

If anyone has ANY tips for me I will be so grateful. I have been working really hard on getting used to this and I would really appreciate any help anyone can give!!

Last question, how would I be able to change the frequency (pitch) of the sound mid-playing it?

thank you very much! from Olly :smiley:

Maybe your definition of “a lot” is different to mine, or maybe you just didn’t find this page:

https://www.juce.com/tutorials

Surely one of the many plugin tutorials or examples there will set you on the right path with this?

JUCE doesn’t have an oscillator class/function, so that’s the first problem you will have to solve. The code you posted just uses the standard library sin() function to produce a single sine wave.

I just read through all of those tutorials. Not one of them presents how to make a wave other than sine or noise, and how to control with a midikeyboard gui

As @Xenakios said… JUCE doesn’t have a class to create Oscillators for you… You’ll have to code that yourself.

Check out the Pirkle Synth Book

You can also check out the dRowAudio JUCE STK module.

Rail

1 Like

Thanks for the reference.
One question, I made a plugin which generates a sine wave on the GUI midi keyboard touch. How do I have input from the midi in a host? Like drawing notes in Logic or FL Studio. I tried and there is no output

The demo plug-in should respond to incoming MIDI if it’s assigned in the host to the track.

Rail

In a plugin the MIDI data arrives in the AudioProcessor::processBlock() method rather than in the MidiInputCallback, because as Rail said it needs to be routed bz the host.