mirror of
https://codeberg.org/armin/rmx-19.git
synced 2026-10-11 16:51:55 +02:00
remove audio-thread file logging; guard arp against null before use
This commit is contained in:
parent
bc6cea9662
commit
b29e263000
1 changed files with 2 additions and 24 deletions
|
|
@ -3,16 +3,6 @@
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
static inline void dbgNote (const char* ev, int note, float vel)
|
|
||||||
{
|
|
||||||
juce::File (juce::File::getSpecialLocation (juce::File::userHomeDirectory)
|
|
||||||
.getChildFile ("rmx19_notes.log"))
|
|
||||||
.appendText (juce::String ("t=") + juce::String ((juce::int64) juce::Time::getMillisecondCounter())
|
|
||||||
+ " " + ev + " n=" + juce::String (note)
|
|
||||||
+ (vel >= 0.0f ? juce::String (" v=") + juce::String (vel, 2) : juce::String())
|
|
||||||
+ "\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
class RMX19AudioProcessor::FxEngine
|
class RMX19AudioProcessor::FxEngine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -369,8 +359,9 @@ void RMX19AudioProcessor::processMidi (juce::MidiBuffer& midi, const VParams& p)
|
||||||
(void) p;
|
(void) p;
|
||||||
constexpr double bendSemis = 2.0;
|
constexpr double bendSemis = 2.0;
|
||||||
bool arpOn = false;
|
bool arpOn = false;
|
||||||
|
// arp is only allocated by prepareToPlay(); treat it as off until then.
|
||||||
if (auto* par = apvts.getRawParameterValue ("arpon"))
|
if (auto* par = apvts.getRawParameterValue ("arpon"))
|
||||||
arpOn = par->load() >= 0.5f;
|
arpOn = (arp != nullptr) && par->load() >= 0.5f;
|
||||||
|
|
||||||
for (const auto meta : midi)
|
for (const auto meta : midi)
|
||||||
{
|
{
|
||||||
|
|
@ -383,7 +374,6 @@ void RMX19AudioProcessor::processMidi (juce::MidiBuffer& midi, const VParams& p)
|
||||||
arp->noteOn (msg.getNoteNumber(), msg.getFloatVelocity());
|
arp->noteOn (msg.getNoteNumber(), msg.getFloatVelocity());
|
||||||
else
|
else
|
||||||
engine.noteOn (msg.getNoteNumber(), msg.getFloatVelocity());
|
engine.noteOn (msg.getNoteNumber(), msg.getFloatVelocity());
|
||||||
dbgNote ("ON", msg.getNoteNumber(), msg.getFloatVelocity());
|
|
||||||
}
|
}
|
||||||
else if (msg.isNoteOff())
|
else if (msg.isNoteOff())
|
||||||
{
|
{
|
||||||
|
|
@ -391,7 +381,6 @@ void RMX19AudioProcessor::processMidi (juce::MidiBuffer& midi, const VParams& p)
|
||||||
arp->noteOff (msg.getNoteNumber());
|
arp->noteOff (msg.getNoteNumber());
|
||||||
else
|
else
|
||||||
engine.noteOff (msg.getNoteNumber());
|
engine.noteOff (msg.getNoteNumber());
|
||||||
dbgNote ("OFF", msg.getNoteNumber(), -1.0f);
|
|
||||||
}
|
}
|
||||||
else if (msg.isPitchWheel())
|
else if (msg.isPitchWheel())
|
||||||
{
|
{
|
||||||
|
|
@ -596,17 +585,6 @@ void RMX19AudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::
|
||||||
outMeter = juce::jmax (peak, outMeter * std::exp (-blockSec / 0.25f));
|
outMeter = juce::jmax (peak, outMeter * std::exp (-blockSec / 0.25f));
|
||||||
|
|
||||||
cpu = 0.7f * cpu + 0.3f * (float) (juce::Time::getMillisecondCounter() - start);
|
cpu = 0.7f * cpu + 0.3f * (float) (juce::Time::getMillisecondCounter() - start);
|
||||||
|
|
||||||
// real-time health check (offline probe + debug): flag blocks near the limit
|
|
||||||
const float blockMs = (numSamples == 0) ? 0.0f
|
|
||||||
: (float) numSamples / (float) std::max (1.0, getSampleRate()) * 1000.0f;
|
|
||||||
const float usedMs = (float) (juce::Time::getMillisecondCounter() - start);
|
|
||||||
if (usedMs > 0.5f * blockMs)
|
|
||||||
juce::File (juce::File::getSpecialLocation (juce::File::userHomeDirectory)
|
|
||||||
.getChildFile ("rmx19_notes.log"))
|
|
||||||
.appendText (juce::String ("OVER t=") + juce::String ((juce::int64) juce::Time::getMillisecondCounter())
|
|
||||||
+ " used=" + juce::String (usedMs, 2)
|
|
||||||
+ "ms budget=" + juce::String (blockMs, 2) + "ms\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMX19AudioProcessor::selectPatch (int i)
|
void RMX19AudioProcessor::selectPatch (int i)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue