Subclass Synthesiser

This commit is contained in:
Takeshi Yokemura 2021-05-18 07:53:18 +09:00
parent 857ac48b58
commit be1f0b4e3b
5 changed files with 51 additions and 1 deletions

View File

@ -68,6 +68,8 @@
file="Source/VibratoParamsComponent.h"/>
</GROUP>
<GROUP id="{630C27C7-03AA-CFC6-2FC4-4CE2DBE3640A}" name="Source">
<FILE id="LHv5E3" name="CustomSynth.cpp" compile="1" resource="0" file="Source/CustomSynth.cpp"/>
<FILE id="kpCPIX" name="CustomSynth.h" compile="0" resource="0" file="Source/CustomSynth.h"/>
<FILE id="H2Vgbj" name="FrameSequenceParseErrors.cpp" compile="1" resource="0"
file="Source/FrameSequenceParseErrors.cpp"/>
<FILE id="Gwt2vB" name="FrameSequenceParseErrors.h" compile="0" resource="0"

21
Source/CustomSynth.cpp Normal file
View File

@ -0,0 +1,21 @@
/*
==============================================================================
CustomSynth.cpp
Created: 17 May 2021 11:29:59pm
Author:
==============================================================================
*/
#include "CustomSynth.h"
CustomSynth::CustomSynth(Magical8bitPlug2AudioProcessor& p) : processor(p) {}
void CustomSynth::noteOn(int midiChannel, int midiNoteNumber, float velocity) {
Synthesiser::noteOn(midiChannel, midiNoteNumber, velocity);
}
void CustomSynth::noteOff(int midiChannel, int midiNoteNumber, float velocity, bool allowTailOff) {
Synthesiser::noteOff(midiChannel, midiNoteNumber, velocity, allowTailOff);
}

25
Source/CustomSynth.h Normal file
View File

@ -0,0 +1,25 @@
/*
==============================================================================
CustomSynth.h
Created: 17 May 2021 11:29:59pm
Author:
==============================================================================
*/
#pragma once
#include "../JuceLibraryCode/JuceHeader.h"
class Magical8bitPlug2AudioProcessor;
class CustomSynth : public Synthesiser {
public:
CustomSynth(Magical8bitPlug2AudioProcessor& p);
void noteOn(int midiChannel, int midiNoteNumber, float velocity) override;
void noteOff(int midiChannel, int midiNoteNumber, float velocity, bool allowTailOff) override;
private:
Magical8bitPlug2AudioProcessor& processor;
};

View File

@ -124,6 +124,7 @@ Magical8bitPlug2AudioProcessor::Magical8bitPlug2AudioProcessor()
}
)
, settingRefs (&parameters)
, synth(*this)
#ifndef JucePlugin_PreferredChannelConfigurations
, AudioProcessor (BusesProperties()
#if ! JucePlugin_IsMidiEffect

View File

@ -13,6 +13,7 @@
#include "../JuceLibraryCode/JuceHeader.h"
#include "Settings.h"
#include "Voices.h"
#include "CustomSynth.h"
//==============================================================================
@ -77,7 +78,7 @@ public:
private:
//==============================================================================
Synthesiser synth;
CustomSynth synth;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Magical8bitPlug2AudioProcessor)
};