mirror of
https://github.com/yokemura/Magical8bitPlug2.git
synced 2025-05-24 23:00:21 -04:00
commit
f6116fe0b4
@ -20,18 +20,31 @@
|
||||
Magical8bitPlug2AudioProcessor::Magical8bitPlug2AudioProcessor()
|
||||
: parameters(
|
||||
*this, nullptr, Identifier("Params"),
|
||||
{
|
||||
//
|
||||
{//
|
||||
// Meta
|
||||
//
|
||||
std::make_unique<AudioParameterBool> ("isAdvancedPanelOpen_raw", "Advanced", false),
|
||||
std::make_unique<AudioParameterChoice> ("colorScheme", "Color Scheme", StringArray ({"YMCK", "YMCK Dark", "Japan", "Worldwide", "Monotone", "Mono Dark"}), 0),
|
||||
std::make_unique<AudioParameterBool>(ParameterID{"isAdvancedPanelOpen_raw", 1},
|
||||
"Advanced",
|
||||
false),
|
||||
std::make_unique<AudioParameterChoice>(ParameterID{"colorScheme", 1},
|
||||
"Color Scheme",
|
||||
StringArray({"YMCK", "YMCK Dark", "Japan", "Worldwide", "Monotone", "Mono Dark"}),
|
||||
0),
|
||||
//
|
||||
// Basic
|
||||
//
|
||||
std::make_unique<AudioParameterChoice> ("osc", "OSC Type", StringArray ({"Pulse/Square", "Triangle", "Noise"}), 0),
|
||||
std::make_unique<AudioParameterFloat> ("gain", "Gain", 0.0f, 1.0f, 0.5f),
|
||||
std::make_unique<AudioParameterFloat> ("maxPoly", "Max Poly", NormalisableRange<float> (1.0f, //min
|
||||
std::make_unique<AudioParameterChoice>(ParameterID{"osc", 1},
|
||||
"OSC Type",
|
||||
StringArray({"Pulse/Square", "Triangle", "Noise"}),
|
||||
0),
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"gain", 1},
|
||||
"Gain",
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.5f),
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"maxPoly", 1},
|
||||
"Max Poly",
|
||||
NormalisableRange<float>(1.0f, // min
|
||||
64.0f, // max
|
||||
1.0f, // step
|
||||
1.0f), // skew
|
||||
@ -39,26 +52,26 @@ Magical8bitPlug2AudioProcessor::Magical8bitPlug2AudioProcessor()
|
||||
//
|
||||
// ADSR
|
||||
//
|
||||
std::make_unique<AudioParameterFloat> ("attack", //ID
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"attack", 1},
|
||||
"Attack", // name
|
||||
NormalisableRange<float>(0.0f, // min
|
||||
5.0f, // max
|
||||
0.001f, // step
|
||||
0.5f), // skew
|
||||
0.0f), // default
|
||||
std::make_unique<AudioParameterFloat> ("decay", //ID
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"decay", 1},
|
||||
"Decay", // name
|
||||
NormalisableRange<float>(0.0f, // min
|
||||
5.0f, // max
|
||||
0.001f, // step
|
||||
0.5f), // skew
|
||||
0.0f), // default
|
||||
std::make_unique<AudioParameterFloat> ("suslevel", //ID
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"suslevel", 1},
|
||||
"Sustain", // name
|
||||
0.0f, // min
|
||||
1.0f, // max
|
||||
1.0f), // default
|
||||
std::make_unique<AudioParameterFloat> ("release", //ID
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"release", 1},
|
||||
"Release", // name
|
||||
NormalisableRange<float>(0.0f, // min
|
||||
5.0f, // max
|
||||
@ -68,38 +81,66 @@ Magical8bitPlug2AudioProcessor::Magical8bitPlug2AudioProcessor()
|
||||
//
|
||||
// Monophonic
|
||||
//
|
||||
std::make_unique<AudioParameterChoice> ("monophonicBehavior_raw", "Behavior", StringArray ({"Legato", "Arpeggio Up", "Arpeggio Down", "Non-legato"}), 0),
|
||||
std::make_unique<AudioParameterChoice> ("arpeggioIntervalType_raw", "Interval", StringArray ({"1 frame", "2 frames", "3 frames", "96th", "64th", "48th", "32nd", "24th", "Slider"}), 0),
|
||||
std::make_unique<AudioParameterFloat> ("arpeggioIntervalSliderValue", //ID
|
||||
std::make_unique<AudioParameterChoice>(ParameterID{"monophonicBehavior_raw", 1},
|
||||
"Behavior",
|
||||
StringArray({"Legato", "Arpeggio Up", "Arpeggio Down", "Non-legato"}),
|
||||
0),
|
||||
std::make_unique<AudioParameterChoice>(ParameterID{"arpeggioIntervalType_raw", 1},
|
||||
"Interval",
|
||||
StringArray({"1 frame", "2 frames", "3 frames", "96th", "64th", "48th", "32nd", "24th", "Slider"}),
|
||||
0),
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"arpeggioIntervalSliderValue", 1},
|
||||
"Interval", // name
|
||||
NormalisableRange<float>(0.001f, // min
|
||||
0.3f, // max
|
||||
0.001f, // step
|
||||
0.5f), // skew
|
||||
0.001f), // default
|
||||
std::make_unique<AudioParameterFloat> ("portamentoTime", "Portamento Time", 0.0f, 1.0f, 0.0f),
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"portamentoTime", 1},
|
||||
"Portamento Time",
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.0f),
|
||||
//
|
||||
// Bend
|
||||
//
|
||||
std::make_unique<AudioParameterInt> ("bendRange", "Bend Range", 0, 24, 2),
|
||||
std::make_unique<AudioParameterInt>(ParameterID{"bendRange", 1},
|
||||
"Bend Range",
|
||||
0,
|
||||
24,
|
||||
2),
|
||||
//
|
||||
// Vibrato
|
||||
//
|
||||
std::make_unique<AudioParameterFloat> ("vibratoRate", //ID
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"vibratoRate", 1},
|
||||
"Rate", // name
|
||||
NormalisableRange<float>(0.01f, // min
|
||||
1.0f, // max
|
||||
0.001f, // step
|
||||
0.5f), // skew
|
||||
0.15f), // default
|
||||
std::make_unique<AudioParameterFloat> ("vibratoDepth", "Depth", 0.0f, 2.0f, 0.0f),
|
||||
std::make_unique<AudioParameterFloat> ("vibratoDelay", "Delay", 0.0f, 1.0f, 0.3f),
|
||||
std::make_unique<AudioParameterBool> ("vibratoIgnoresWheel_raw", "Ignores Wheel", true),
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"vibratoDepth", 1},
|
||||
"Depth",
|
||||
0.0f,
|
||||
2.0f,
|
||||
0.0f),
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"vibratoDelay", 1},
|
||||
"Delay",
|
||||
0.0f,
|
||||
1.0f,
|
||||
0.3f),
|
||||
std::make_unique<AudioParameterBool>(ParameterID{"vibratoIgnoresWheel_raw", 1},
|
||||
"Ignores Wheel",
|
||||
true),
|
||||
//
|
||||
// Sweep
|
||||
//
|
||||
std::make_unique<AudioParameterInt> ("sweepInitialPitch", "Ini.Pitch", -24, 24, 0),
|
||||
std::make_unique<AudioParameterFloat> ("sweepTime", //ID
|
||||
std::make_unique<AudioParameterInt>(ParameterID{"sweepInitialPitch", 1},
|
||||
"Ini.Pitch",
|
||||
-24,
|
||||
24,
|
||||
0),
|
||||
std::make_unique<AudioParameterFloat>(ParameterID{"sweepTime", 1},
|
||||
"Time", // name
|
||||
NormalisableRange<float>(0.01f, // min
|
||||
5.0f, // max
|
||||
@ -109,25 +150,40 @@ Magical8bitPlug2AudioProcessor::Magical8bitPlug2AudioProcessor()
|
||||
//
|
||||
// For Pulse
|
||||
//
|
||||
std::make_unique<AudioParameterChoice> ("duty", "Duty", StringArray ({"12.5%", "25%", "50%"}), 0),
|
||||
std::make_unique<AudioParameterChoice>(ParameterID{"duty", 1},
|
||||
"Duty",
|
||||
StringArray({"12.5%", "25%", "50%"}),
|
||||
0),
|
||||
//
|
||||
// For Noise
|
||||
//
|
||||
std::make_unique<AudioParameterChoice> ("noiseAlgorithm_raw", "Algorithm", StringArray ({"4bit Pure Random", "1bit Long Cycle", "1bit Short Cycle"}), 0),
|
||||
std::make_unique<AudioParameterBool> ("restrictsToNESFrequency_raw", "Restricts to NES frequency", false),
|
||||
std::make_unique<AudioParameterChoice>(ParameterID{"noiseAlgorithm_raw", 1},
|
||||
"Algorithm", StringArray({"4bit Pure Random", "1bit Long Cycle", "1bit Short Cycle"}),
|
||||
0),
|
||||
std::make_unique<AudioParameterBool>(ParameterID{"restrictsToNESFrequency_raw", 1},
|
||||
"Restricts to NES frequency",
|
||||
false),
|
||||
//
|
||||
// Sequence
|
||||
//
|
||||
std::make_unique<AudioParameterBool> ("isVolumeSequenceEnabled_raw", "Enabled", false),
|
||||
std::make_unique<AudioParameterBool> ("isPitchSequenceEnabled_raw", "Enabled", false),
|
||||
std::make_unique<AudioParameterBool> ("isDutySequenceEnabled_raw", "Enabled", false),
|
||||
std::make_unique<AudioParameterChoice> ("pitchSequenceMode_raw", "Mode", StringArray ({"Coarse", "Fine"}), 0)
|
||||
}
|
||||
)
|
||||
, settingRefs (¶meters)
|
||||
, synth(*this)
|
||||
std::make_unique<AudioParameterBool>(ParameterID{"isVolumeSequenceEnabled_raw", 1},
|
||||
"Enabled",
|
||||
false),
|
||||
std::make_unique<AudioParameterBool>(ParameterID{"isPitchSequenceEnabled_raw", 1},
|
||||
"Enabled",
|
||||
false),
|
||||
std::make_unique<AudioParameterBool>(ParameterID{"isDutySequenceEnabled_raw", 1},
|
||||
"Enabled",
|
||||
false),
|
||||
std::make_unique<AudioParameterChoice>(ParameterID{"pitchSequenceMode_raw", 1},
|
||||
"Mode",
|
||||
StringArray({"Coarse", "Fine"}),
|
||||
0)
|
||||
}),
|
||||
settingRefs(¶meters), synth(*this)
|
||||
#ifndef JucePlugin_PreferredChannelConfigurations
|
||||
, AudioProcessor (BusesProperties()
|
||||
,
|
||||
AudioProcessor(BusesProperties()
|
||||
#if !JucePlugin_IsMidiEffect
|
||||
#if !JucePlugin_IsSynth
|
||||
.withInput("Input", AudioChannelSet::stereo(), true)
|
||||
@ -186,7 +242,8 @@ void Magical8bitPlug2AudioProcessor::setupVoice()
|
||||
double Magical8bitPlug2AudioProcessor::getCurrentBPM()
|
||||
{
|
||||
auto ph = getPlayHead();
|
||||
if (ph == NULL) {
|
||||
if (ph == NULL)
|
||||
{
|
||||
return 120.0;
|
||||
}
|
||||
juce::AudioPlayHead::CurrentPositionInfo result;
|
||||
@ -281,8 +338,7 @@ bool Magical8bitPlug2AudioProcessor::isBusesLayoutSupported (const BusesLayout&
|
||||
|
||||
// This is the place where you check if the layout is supported.
|
||||
// In this template code we only support mono or stereo.
|
||||
if (layouts.getMainOutputChannelSet() != AudioChannelSet::mono()
|
||||
&& layouts.getMainOutputChannelSet() != AudioChannelSet::stereo())
|
||||
if (layouts.getMainOutputChannelSet() != AudioChannelSet::mono() && layouts.getMainOutputChannelSet() != AudioChannelSet::stereo())
|
||||
return false;
|
||||
|
||||
// This checks if the input layout matches the output layout
|
||||
|
Loading…
Reference in New Issue
Block a user