mirror of
https://github.com/yokemura/Magical8bitPlug2.git
synced 2025-05-24 23:00:21 -04:00
Remove unused codes
This commit is contained in:
parent
97aadde9ab
commit
7efbf2a409
@ -293,67 +293,13 @@ bool Magical8bitPlug2AudioProcessor::isBusesLayoutSupported (const BusesLayout&
|
|||||||
|
|
||||||
void Magical8bitPlug2AudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
|
void Magical8bitPlug2AudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
|
||||||
{
|
{
|
||||||
|
synth.renderNextBlock (buffer, midiMessages, 0, buffer.getNumSamples());
|
||||||
synth.renderNextBlock (buffer, midiMessages, 0, buffer.getNumSamples()); // [5]
|
|
||||||
|
|
||||||
/*
|
|
||||||
buffer.clear();
|
|
||||||
MidiBuffer processedMidi;
|
|
||||||
int time;
|
|
||||||
MidiMessage m;
|
|
||||||
for (MidiBuffer::Iterator i (midiMessages); i.getNextEvent (m, time);)
|
|
||||||
{
|
|
||||||
if (m.isNoteOn())
|
|
||||||
{
|
|
||||||
uint8 newVel = (uint8)noteOnVel;
|
|
||||||
m = MidiMessage::noteOn(m.getChannel(), m.getNoteNumber(), newVel);
|
|
||||||
}
|
|
||||||
else if (m.isNoteOff())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else if (m.isAftertouch())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else if (m.isPitchWheel())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
processedMidi.addEvent (m, time);
|
|
||||||
}
|
|
||||||
midiMessages.swapWith (processedMidi);
|
|
||||||
|
|
||||||
|
|
||||||
ScopedNoDenormals noDenormals;
|
|
||||||
auto totalNumInputChannels = getTotalNumInputChannels();
|
|
||||||
auto totalNumOutputChannels = getTotalNumOutputChannels();
|
|
||||||
|
|
||||||
// In case we have more outputs than inputs, this code clears any output
|
|
||||||
// channels that didn't contain input data, (because these aren't
|
|
||||||
// guaranteed to be empty - they may contain garbage).
|
|
||||||
// This is here to avoid people getting screaming feedback
|
|
||||||
// when they first compile a plugin, but obviously you don't need to keep
|
|
||||||
// this code if your algorithm always overwrites all the output channels.
|
|
||||||
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
|
|
||||||
buffer.clear (i, 0, buffer.getNumSamples());
|
|
||||||
|
|
||||||
// This is the place where you'd normally do the guts of your plugin's
|
|
||||||
// audio processing...
|
|
||||||
// Make sure to reset the state if your inner loop is processing
|
|
||||||
// the samples and the outer loop is handling the channels.
|
|
||||||
// Alternatively, you can process the samples with the channels
|
|
||||||
// interleaved by keeping the same state.
|
|
||||||
for (int channel = 0; channel < totalNumInputChannels; ++channel)
|
|
||||||
{
|
|
||||||
auto* channelData = buffer.getWritePointer (channel);
|
|
||||||
|
|
||||||
// ..do something to the data...
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
bool Magical8bitPlug2AudioProcessor::hasEditor() const
|
bool Magical8bitPlug2AudioProcessor::hasEditor() const
|
||||||
{
|
{
|
||||||
return true; // (change this to false if you choose to not supply an editor)
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioProcessorEditor* Magical8bitPlug2AudioProcessor::createEditor()
|
AudioProcessorEditor* Magical8bitPlug2AudioProcessor::createEditor()
|
||||||
|
@ -16,9 +16,7 @@
|
|||||||
// The base for pulse/triangle (Abstract)
|
// The base for pulse/triangle (Abstract)
|
||||||
//
|
//
|
||||||
//---------------------------------------------
|
//---------------------------------------------
|
||||||
TonalVoice::TonalVoice (SettingRefs* sRefs) : BaseVoice (sRefs) {
|
TonalVoice::TonalVoice (SettingRefs* sRefs) : BaseVoice (sRefs) {}
|
||||||
// testArpeggioNotes();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TonalVoice::startNote (int midiNoteNumber, float velocity, SynthesiserSound*, int currentPitchBendPosition)
|
void TonalVoice::startNote (int midiNoteNumber, float velocity, SynthesiserSound*, int currentPitchBendPosition)
|
||||||
{
|
{
|
||||||
@ -102,18 +100,14 @@ void TonalVoice::controllerMoved (int type, int amount)
|
|||||||
|
|
||||||
void TonalVoice::setLegatoMode(double time) {
|
void TonalVoice::setLegatoMode(double time) {
|
||||||
portamentoTime = time;
|
portamentoTime = time;
|
||||||
// currentNumNoteBuffer = 1;
|
|
||||||
// noteBuffer[0] = noteNumber;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The interface says "add" but the implementation is just using the latest value.
|
||||||
|
// It is because the original intension was to keep all the pressing keys and choose the apropriate one with certain algorithm
|
||||||
void TonalVoice::addLegatoNote (int midiNoteNumber, float velocity) {
|
void TonalVoice::addLegatoNote (int midiNoteNumber, float velocity) {
|
||||||
if (currentNumNoteBuffer >= 10) {
|
if (currentNumNoteBuffer >= 10) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Push to last
|
|
||||||
// noteBuffer[currentNumNoteBuffer] = midiNoteNumber;
|
|
||||||
// currentNumNoteBuffer++;
|
|
||||||
|
|
||||||
int previousNoteNo = noteNumber;
|
int previousNoteNo = noteNumber;
|
||||||
BaseVoice::changeNote(midiNoteNumber, velocity);
|
BaseVoice::changeNote(midiNoteNumber, velocity);
|
||||||
@ -126,20 +120,6 @@ void TonalVoice::addLegatoNote (int midiNoteNumber, float velocity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TonalVoice::removeLegatoNote(int midiNoteNumber) {
|
int TonalVoice::removeLegatoNote(int midiNoteNumber) {
|
||||||
// if (currentNumNoteBuffer==0) {
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// int i;
|
|
||||||
// for (i=0; i<currentNumNoteBuffer; i++) {
|
|
||||||
// if (noteBuffer[i] == midiNoteNumber) break;
|
|
||||||
// }
|
|
||||||
// if (i == currentNumNoteBuffer) { // not found
|
|
||||||
// return currentNumNoteBuffer;
|
|
||||||
// }
|
|
||||||
// shiftNoteBuffer(i);
|
|
||||||
// currentNumNoteBuffer--;
|
|
||||||
|
|
||||||
if (midiNoteNumber == noteNumber) {
|
if (midiNoteNumber == noteNumber) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -73,73 +73,4 @@ struct TonalVoice : public BaseVoice // The base for Pulse and Triangle
|
|||||||
bool isArpeggioEnabled() {
|
bool isArpeggioEnabled() {
|
||||||
return arpeggioFrameLength > 0;
|
return arpeggioFrameLength > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void testArpeggioNotes() {
|
|
||||||
startNote(100, 1, NULL, 0);
|
|
||||||
|
|
||||||
setArpeggioMode(1.0);
|
|
||||||
jassert(isArpeggioEnabled());
|
|
||||||
jassert(arpeggioNotes[0] == 100);
|
|
||||||
jassert(currentNumArpeggioNotes == 1);
|
|
||||||
|
|
||||||
addArpeggioNoteAscending(90);
|
|
||||||
jassert(arpeggioNotes[0] == 90);
|
|
||||||
jassert(arpeggioNotes[1] == 100);
|
|
||||||
jassert(currentNumArpeggioNotes == 2);
|
|
||||||
|
|
||||||
addArpeggioNoteAscending(95);
|
|
||||||
jassert(arpeggioNotes[0] == 90);
|
|
||||||
jassert(arpeggioNotes[1] == 95);
|
|
||||||
jassert(arpeggioNotes[2] == 100);
|
|
||||||
jassert(currentNumArpeggioNotes == 3);
|
|
||||||
|
|
||||||
jassert(removeArpeggioNote(92) == 3);
|
|
||||||
jassert(arpeggioNotes[0] == 90);
|
|
||||||
jassert(arpeggioNotes[1] == 95);
|
|
||||||
jassert(arpeggioNotes[2] == 100);
|
|
||||||
|
|
||||||
jassert(removeArpeggioNote(100) == 2);
|
|
||||||
jassert(arpeggioNotes[0] == 90);
|
|
||||||
jassert(arpeggioNotes[1] == 95);
|
|
||||||
|
|
||||||
jassert(removeArpeggioNote(90) == 1);
|
|
||||||
jassert(arpeggioNotes[0] == 95);
|
|
||||||
|
|
||||||
jassert(removeArpeggioNote(95) == 0);
|
|
||||||
|
|
||||||
|
|
||||||
startNote(100, 1, NULL, 0);
|
|
||||||
|
|
||||||
setArpeggioMode(1.0);
|
|
||||||
jassert(isArpeggioEnabled());
|
|
||||||
jassert(arpeggioNotes[0] == 100);
|
|
||||||
jassert(currentNumArpeggioNotes == 1);
|
|
||||||
|
|
||||||
addArpeggioNoteDescending(90);
|
|
||||||
jassert(arpeggioNotes[0] == 100);
|
|
||||||
jassert(arpeggioNotes[1] == 90);
|
|
||||||
jassert(currentNumArpeggioNotes == 2);
|
|
||||||
|
|
||||||
addArpeggioNoteDescending(95);
|
|
||||||
jassert(arpeggioNotes[0] == 100);
|
|
||||||
jassert(arpeggioNotes[1] == 95);
|
|
||||||
jassert(arpeggioNotes[2] == 90);
|
|
||||||
jassert(currentNumArpeggioNotes == 3);
|
|
||||||
|
|
||||||
jassert(removeArpeggioNote(92) == 3);
|
|
||||||
jassert(arpeggioNotes[0] == 100);
|
|
||||||
jassert(arpeggioNotes[1] == 95);
|
|
||||||
jassert(arpeggioNotes[2] == 90);
|
|
||||||
|
|
||||||
jassert(removeArpeggioNote(100) == 2);
|
|
||||||
jassert(arpeggioNotes[0] == 95);
|
|
||||||
jassert(arpeggioNotes[1] == 90);
|
|
||||||
|
|
||||||
jassert(removeArpeggioNote(90) == 1);
|
|
||||||
jassert(arpeggioNotes[0] == 95);
|
|
||||||
|
|
||||||
jassert(removeArpeggioNote(95) == 0);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user