Hi, i’m trying to make a Plug-In synthesiser using the classes Synthesiser, SynthesiserVoice and SynthesiserSound.
I read the Documentation and it says that i need to create a SynthesiserVoice, a SynthesiserSound and then pass them respectively in the method of the class Synthesiser addVoice and addSound. I have a problem when i call addVoice method. I tried to use two ways to add a SynthesiserVoice that i created.
- In the first one i followed the example found in the Juce library.
synth.addVoice(new SynthVoice()); // SynthVoice is the class that inherits SynthesiserVoice
In this case the console report an error: Allocating an object of abstract class type SynthesiserVoice.
- Then i tried to declare a pointer of the SynthVoice type:
In this case i don’t have syntax errors but when i open the plug-in with the plugin Host it crashes.
Where is the problem? Why can it allocate the object of class derived from the SynthesiserVoice class in the Juce example using the constructor new SynthVoice()?