Instrument: also render sound for MIDI-based instruments when muted
In order to provide smooth muting functionality (i.e. immediate proper sound when unmuting) always render audio buffers for MIDI-based instruments. This is more important than potentially reduced CPU usage while muted. Closes #69.
This commit is contained in:
@@ -238,7 +238,7 @@ bool opl2instrument::handleMidiEvent( const midiEvent & _me,
|
||||
//
|
||||
int key;
|
||||
static int lastvoice=0;
|
||||
if( _me.m_type == MidiNoteOn && !isMuted() ) {
|
||||
if( _me.m_type == MidiNoteOn ) {
|
||||
// to get us in line with MIDI
|
||||
key = _me.key() +12;
|
||||
for(int i=lastvoice+1; i!=lastvoice; ++i,i%=9) {
|
||||
|
||||
@@ -313,15 +313,13 @@ void vestigeInstrument::play( sampleFrame * _buf )
|
||||
bool vestigeInstrument::handleMidiEvent( const midiEvent & _me,
|
||||
const midiTime & _time )
|
||||
{
|
||||
if( !isMuted() )
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->processMidiEvent( _me, _time );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
m_plugin->processMidiEvent( _me, _time );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ZynAddSubFx.cpp - ZynAddSubxFX-embedding plugin
|
||||
*
|
||||
* Copyright (c) 2008-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -343,14 +343,9 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf )
|
||||
bool ZynAddSubFxInstrument::handleMidiEvent( const midiEvent & _me,
|
||||
const midiTime & _time )
|
||||
{
|
||||
// do not send NoteOn events if muted
|
||||
if( _me.type() == MidiNoteOn && isMuted() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// do not forward external MIDI Control Change events if the according
|
||||
// LED is not checked
|
||||
else if( _me.type() == MidiControlChange &&
|
||||
if( _me.type() == MidiControlChange &&
|
||||
_me.sourcePort() != this &&
|
||||
m_forwardMidiCcModel.value() == false )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user