Merge remote-tracking branch 'upstream/master' into dynamic-effect-dialog
Merge master from upstream to get past the problems related to the submodule for resid once and for all. See #6916.
This commit is contained in:
@@ -177,7 +177,8 @@ void CompressorEffect::calcRange()
|
||||
|
||||
void CompressorEffect::resizeRMS()
|
||||
{
|
||||
m_rmsTimeConst = exp(-1.f / (m_compressorControls.m_rmsModel.value() * 0.001f * m_sampleRate));
|
||||
const float rmsValue = m_compressorControls.m_rmsModel.value();
|
||||
m_rmsTimeConst = (rmsValue > 0) ? exp(-1.f / (rmsValue * 0.001f * m_sampleRate)) : 0;
|
||||
}
|
||||
|
||||
void CompressorEffect::calcLookaheadLength()
|
||||
|
||||
@@ -497,10 +497,12 @@ void CompressorControlDialog::redrawKnee()
|
||||
float actualRatio = m_controls->m_limiterModel.value() ? 0 : m_controls->m_effect->m_ratioVal;
|
||||
|
||||
// Calculate endpoints for the two straight lines
|
||||
float kneePoint1 = m_controls->m_effect->m_thresholdVal - m_controls->m_effect->m_kneeVal;
|
||||
float kneePoint2X = m_controls->m_effect->m_thresholdVal + m_controls->m_effect->m_kneeVal;
|
||||
float kneePoint2Y = (m_controls->m_effect->m_thresholdVal + (-m_controls->m_effect->m_thresholdVal * (actualRatio * (m_controls->m_effect->m_kneeVal / -m_controls->m_effect->m_thresholdVal))));
|
||||
float ratioPoint = m_controls->m_effect->m_thresholdVal + (-m_controls->m_effect->m_thresholdVal * actualRatio);
|
||||
const float thresholdVal = m_controls->m_effect->m_thresholdVal;
|
||||
const float kneeVal = m_controls->m_effect->m_kneeVal;
|
||||
float kneePoint1 = thresholdVal - kneeVal;
|
||||
float kneePoint2X = thresholdVal + kneeVal;
|
||||
float kneePoint2Y = thresholdVal + kneeVal * actualRatio;
|
||||
float ratioPoint = thresholdVal + (-thresholdVal * actualRatio);
|
||||
|
||||
// Draw two straight lines
|
||||
m_p.drawLine(0, m_kneeWindowSizeY, dbfsToXPoint(kneePoint1), dbfsToYPoint(kneePoint1));
|
||||
@@ -510,7 +512,7 @@ void CompressorControlDialog::redrawKnee()
|
||||
}
|
||||
|
||||
// Draw knee section
|
||||
if (m_controls->m_effect->m_kneeVal)
|
||||
if (kneeVal)
|
||||
{
|
||||
m_p.setPen(QPen(m_kneeColor2, 3));
|
||||
|
||||
@@ -522,8 +524,8 @@ void CompressorControlDialog::redrawKnee()
|
||||
{
|
||||
newPoint[0] = linearInterpolate(kneePoint1, kneePoint2X, (i + 1) / (float)COMP_KNEE_LINES);
|
||||
|
||||
const float temp = newPoint[0] - m_controls->m_effect->m_thresholdVal + m_controls->m_effect->m_kneeVal;
|
||||
newPoint[1] = (newPoint[0] + (actualRatio - 1) * temp * temp / (4 * m_controls->m_effect->m_kneeVal));
|
||||
const float temp = newPoint[0] - thresholdVal + kneeVal;
|
||||
newPoint[1] = (newPoint[0] + (actualRatio - 1) * temp * temp / (4 * kneeVal));
|
||||
|
||||
m_p.drawLine(dbfsToXPoint(prevPoint[0]), dbfsToYPoint(prevPoint[1]), dbfsToXPoint(newPoint[0]), dbfsToYPoint(newPoint[1]));
|
||||
|
||||
@@ -768,4 +770,4 @@ void CompressorControlDialog::resetCompressorView()
|
||||
}
|
||||
|
||||
|
||||
} // namespace lmms::gui
|
||||
} // namespace lmms::gui
|
||||
|
||||
@@ -4,22 +4,22 @@ BUILD_PLUGIN(ladspaeffect LadspaEffect.cpp LadspaControls.cpp LadspaControlDialo
|
||||
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ladspa")
|
||||
|
||||
IF(WANT_CAPS)
|
||||
IF(LMMS_HAVE_CAPS)
|
||||
ADD_SUBDIRECTORY(caps)
|
||||
ENDIF(WANT_CAPS)
|
||||
ENDIF()
|
||||
|
||||
IF(WANT_TAP)
|
||||
IF(LMMS_HAVE_TAP)
|
||||
ADD_SUBDIRECTORY(tap)
|
||||
ENDIF(WANT_TAP)
|
||||
ENDIF()
|
||||
|
||||
IF(WANT_SWH)
|
||||
IF(LMMS_HAVE_SWH)
|
||||
ADD_SUBDIRECTORY(swh)
|
||||
ENDIF(WANT_SWH)
|
||||
ENDIF()
|
||||
|
||||
IF(WANT_CMT)
|
||||
IF(LMMS_HAVE_CMT)
|
||||
ADD_SUBDIRECTORY(cmt)
|
||||
ENDIF(WANT_CMT)
|
||||
ENDIF()
|
||||
|
||||
IF(WANT_CALF)
|
||||
IF(LMMS_HAVE_CALF)
|
||||
ADD_SUBDIRECTORY(calf)
|
||||
ENDIF(WANT_CALF)
|
||||
ENDIF()
|
||||
|
||||
@@ -1,51 +1,14 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
INCLUDE_DIRECTORIES(resid)
|
||||
if(NOT LMMS_HAVE_SID)
|
||||
return()
|
||||
endif()
|
||||
|
||||
BUILD_PLUGIN(sid
|
||||
SidInstrument.cpp
|
||||
SidInstrument.h
|
||||
resid/envelope.h
|
||||
resid/extfilt.h
|
||||
resid/filter.h
|
||||
resid/pot.h
|
||||
resid/siddefs.h
|
||||
resid/sid.h
|
||||
resid/spline.h
|
||||
resid/voice.h
|
||||
resid/wave.h
|
||||
resid/envelope.cc
|
||||
resid/extfilt.cc
|
||||
resid/filter.cc
|
||||
resid/pot.cc
|
||||
resid/sid.cc
|
||||
resid/version.cc
|
||||
resid/voice.cc
|
||||
resid/wave6581_PS_.cc
|
||||
resid/wave6581_PST.cc
|
||||
resid/wave6581_P_T.cc
|
||||
resid/wave6581__ST.cc
|
||||
resid/wave8580_PS_.cc
|
||||
resid/wave8580_PST.cc
|
||||
resid/wave8580_P_T.cc
|
||||
resid/wave8580__ST.cc
|
||||
resid/wave.cc
|
||||
MOCFILES SidInstrument.h
|
||||
EMBEDDED_RESOURCES *.png)
|
||||
|
||||
# Parse VERSION
|
||||
FILE(READ "resid/CMakeLists.txt" lines)
|
||||
STRING(REGEX MATCH "set\\(MAJOR_VER [A-Za-z0-9_]*\\)" MAJOR_RAW ${lines})
|
||||
STRING(REGEX MATCH "set\\(MINOR_VER [A-Za-z0-9_]*\\)" MINOR_RAW ${lines})
|
||||
STRING(REGEX MATCH "set\\(PATCH_VER [A-Za-z0-9_]*\\)" PATCH_RAW ${lines})
|
||||
SEPARATE_ARGUMENTS(MAJOR_RAW)
|
||||
SEPARATE_ARGUMENTS(MINOR_RAW)
|
||||
SEPARATE_ARGUMENTS(PATCH_RAW)
|
||||
LIST(GET MAJOR_RAW 1 MAJOR_RAW)
|
||||
LIST(GET MINOR_RAW 1 MINOR_RAW)
|
||||
LIST(GET PATCH_RAW 1 PATCH_RAW)
|
||||
STRING(REPLACE ")" "" MAJOR_VER "${MAJOR_RAW}")
|
||||
STRING(REPLACE ")" "" MINOR_VER "${MINOR_RAW}")
|
||||
STRING(REPLACE ")" "" PATCH_VER "${PATCH_RAW}")
|
||||
|
||||
TARGET_COMPILE_DEFINITIONS(sid PRIVATE VERSION="${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}")
|
||||
add_subdirectory(resid)
|
||||
target_link_libraries(sid resid)
|
||||
|
||||
@@ -239,7 +239,7 @@ f_cnt_t SidInstrument::desiredReleaseFrames() const
|
||||
|
||||
|
||||
|
||||
static int sid_fillbuffer(unsigned char* sidreg, SID *sid, int tdelta, short *ptr, int samples)
|
||||
static int sid_fillbuffer(unsigned char* sidreg, reSID::SID *sid, int tdelta, short *ptr, int samples)
|
||||
{
|
||||
int tdelta2;
|
||||
int result;
|
||||
@@ -302,9 +302,9 @@ void SidInstrument::playNote( NotePlayHandle * _n,
|
||||
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
SID *sid = new SID();
|
||||
sid->set_sampling_parameters( clockrate, SAMPLE_FAST, samplerate );
|
||||
sid->set_chip_model( MOS8580 );
|
||||
auto sid = new reSID::SID();
|
||||
sid->set_sampling_parameters(clockrate, reSID::SAMPLE_FAST, samplerate);
|
||||
sid->set_chip_model(reSID::MOS8580);
|
||||
sid->enable_filter( true );
|
||||
sid->reset();
|
||||
_n->m_pluginData = sid;
|
||||
@@ -312,7 +312,7 @@ void SidInstrument::playNote( NotePlayHandle * _n,
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
const f_cnt_t offset = _n->noteOffset();
|
||||
|
||||
SID *sid = static_cast<SID *>( _n->m_pluginData );
|
||||
auto sid = static_cast<reSID::SID*>(_n->m_pluginData);
|
||||
int delta_t = clockrate * frames / samplerate + 4;
|
||||
// avoid variable length array for msvc compat
|
||||
auto buf = reinterpret_cast<short*>(_working_buffer + offset);
|
||||
@@ -325,20 +325,20 @@ void SidInstrument::playNote( NotePlayHandle * _n,
|
||||
|
||||
if( (ChipModel)m_chipModel.value() == ChipModel::MOS6581 )
|
||||
{
|
||||
sid->set_chip_model( MOS6581 );
|
||||
sid->set_chip_model(reSID::MOS6581);
|
||||
}
|
||||
else
|
||||
{
|
||||
sid->set_chip_model( MOS8580 );
|
||||
sid->set_chip_model(reSID::MOS8580);
|
||||
}
|
||||
|
||||
// voices
|
||||
reg8 data8 = 0;
|
||||
reg8 data16 = 0;
|
||||
reg8 base = 0;
|
||||
reSID::reg8 data8 = 0;
|
||||
reSID::reg16 data16 = 0;
|
||||
size_t base = 0;
|
||||
float freq = 0.0;
|
||||
float note = 0.0;
|
||||
for( reg8 i = 0 ; i < 3 ; ++i )
|
||||
for (size_t i = 0; i < 3; ++i)
|
||||
{
|
||||
base = i*7;
|
||||
// freq ( Fn = Fout / Fclk * 16777216 ) + coarse detuning
|
||||
@@ -436,7 +436,7 @@ void SidInstrument::playNote( NotePlayHandle * _n,
|
||||
|
||||
void SidInstrument::deleteNotePluginData( NotePlayHandle * _n )
|
||||
{
|
||||
delete static_cast<SID *>( _n->m_pluginData );
|
||||
delete static_cast<reSID::SID*>(_n->m_pluginData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Submodule plugins/Sid/resid deleted from 02afcc5cef
68
plugins/Sid/resid/CMakeLists.txt
Normal file
68
plugins/Sid/resid/CMakeLists.txt
Normal file
@@ -0,0 +1,68 @@
|
||||
# These are the defaults
|
||||
set(RESID_INLINING 1)
|
||||
set(RESID_INLINE inline)
|
||||
set(RESID_BRANCH_HINTS 1)
|
||||
set(NEW_8580_FILTER 0)
|
||||
|
||||
set(HAVE_BOOL 1)
|
||||
set(HAVE_LOG1P 1)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GCC|Clang")
|
||||
set(HAVE_BUILTIN_EXPECT 1)
|
||||
else()
|
||||
set(HAVE_BUILTIN_EXPECT 0)
|
||||
endif()
|
||||
|
||||
configure_file(resid/siddefs.h.in resid/siddefs.h @ONLY)
|
||||
|
||||
add_library(resid_objects OBJECT
|
||||
resid/sid.cc
|
||||
resid/voice.cc
|
||||
resid/wave.cc
|
||||
resid/envelope.cc
|
||||
resid/filter.cc
|
||||
resid/dac.cc
|
||||
resid/extfilt.cc
|
||||
resid/pot.cc
|
||||
resid/version.cc
|
||||
)
|
||||
|
||||
target_include_directories(resid_objects PUBLIC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/resid"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/resid"
|
||||
)
|
||||
target_compile_definitions(resid_objects PUBLIC VERSION="1.0")
|
||||
|
||||
set(RESID_WAVES
|
||||
wave6581_PST
|
||||
wave6581_PS_
|
||||
wave6581_P_T
|
||||
wave6581__ST
|
||||
wave8580_PST
|
||||
wave8580_PS_
|
||||
wave8580_P_T
|
||||
wave8580__ST
|
||||
)
|
||||
|
||||
set(RESID_SAMP2SRC_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/resid/samp2src.pl)
|
||||
foreach(WAVE_DATA IN LISTS RESID_WAVES)
|
||||
set(WAVE_DATA_IN ${CMAKE_CURRENT_SOURCE_DIR}/resid/${WAVE_DATA}.dat)
|
||||
set(WAVE_SRC_OUT ${CMAKE_CURRENT_BINARY_DIR}/resid/${WAVE_DATA}.h)
|
||||
set(WAVE_COMMAND
|
||||
"${PERL_EXECUTABLE}"
|
||||
"${RESID_SAMP2SRC_SCRIPT}"
|
||||
"${WAVE_DATA}"
|
||||
"${WAVE_DATA_IN}"
|
||||
"${WAVE_SRC_OUT}"
|
||||
)
|
||||
add_custom_command(OUTPUT ${WAVE_SRC_OUT} COMMAND ${WAVE_COMMAND} VERBATIM)
|
||||
target_sources(resid_objects PUBLIC ${WAVE_SRC_OUT})
|
||||
endforeach()
|
||||
|
||||
# TODO CMake 3.12: Use target_link_libraries() to propagate usage requirements directly to sid plugin
|
||||
add_library(resid INTERFACE)
|
||||
|
||||
target_sources(resid INTERFACE $<TARGET_OBJECTS:resid_objects>)
|
||||
|
||||
get_target_property(resid_includes resid_objects INCLUDE_DIRECTORIES)
|
||||
target_include_directories(resid INTERFACE ${resid_includes})
|
||||
1
plugins/Sid/resid/resid
Submodule
1
plugins/Sid/resid/resid
Submodule
Submodule plugins/Sid/resid/resid added at ef72462f5f
@@ -87,6 +87,7 @@ MalletsInstrument::MalletsInstrument( InstrumentTrack * _instrument_track ):
|
||||
m_strikeModel( true, this, tr( "Bowed" ) ),
|
||||
m_presetsModel(this),
|
||||
m_spreadModel(0, 0, 255, 1, this, tr( "Spread" )),
|
||||
m_randomModel(0.0f, 0.0f, 1.0f, 0.01f, this, tr("Randomness")),
|
||||
m_versionModel( MALLETS_PRESET_VERSION, 0, MALLETS_PRESET_VERSION, this, "" ),
|
||||
m_isOldVersionModel( false, this, "" ),
|
||||
m_filesMissing( !QDir( ConfigManager::inst()->stkDir() ).exists() ||
|
||||
@@ -155,6 +156,7 @@ void MalletsInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
m_presetsModel.saveSettings( _doc, _this, "preset" );
|
||||
m_spreadModel.saveSettings( _doc, _this, "spread" );
|
||||
m_randomModel.saveSettings(_doc, _this, "randomness");
|
||||
m_versionModel.saveSettings( _doc, _this, "version" );
|
||||
m_isOldVersionModel.saveSettings( _doc, _this, "oldversion" );
|
||||
}
|
||||
@@ -189,6 +191,7 @@ void MalletsInstrument::loadSettings( const QDomElement & _this )
|
||||
|
||||
m_presetsModel.loadSettings( _this, "preset" );
|
||||
m_spreadModel.loadSettings( _this, "spread" );
|
||||
m_randomModel.loadSettings(_this, "randomness");
|
||||
m_isOldVersionModel.loadSettings( _this, "oldversion" );
|
||||
|
||||
// To maintain backward compatibility
|
||||
@@ -284,7 +287,7 @@ void MalletsInstrument::playNote( NotePlayHandle * _n,
|
||||
}
|
||||
|
||||
int p = m_presetsModel.value();
|
||||
|
||||
|
||||
const float freq = _n->frequency();
|
||||
if (!_n->m_pluginData)
|
||||
{
|
||||
@@ -293,6 +296,29 @@ void MalletsInstrument::playNote( NotePlayHandle * _n,
|
||||
m_isOldVersionModel.value() ? 100.0 : 200.0;
|
||||
const float vel = _n->getVolume() / velocityAdjust;
|
||||
|
||||
const float random = m_randomModel.value();
|
||||
float hardness = m_hardnessModel.value();
|
||||
float position = m_positionModel.value();
|
||||
float modulator = m_modulatorModel.value();
|
||||
float crossfade = m_crossfadeModel.value();
|
||||
|
||||
if (p < 9)
|
||||
{
|
||||
hardness += random * static_cast<float>(fast_rand() % 128) - 64.0;
|
||||
hardness = std::clamp(hardness, 0.0f, 128.0f);
|
||||
|
||||
position += random * static_cast<float>(fast_rand() % 64) - 32.0;
|
||||
position = std::clamp(position, 0.0f, 64.0f);
|
||||
}
|
||||
else if (p == 9)
|
||||
{
|
||||
modulator += random * static_cast<float>(fast_rand() % 128) - 64.0;
|
||||
modulator = std::clamp(modulator, 0.0f, 128.0f);
|
||||
|
||||
crossfade += random * static_cast<float>(fast_rand() % 128) - 64.0;
|
||||
crossfade = std::clamp(crossfade, 0.0f, 128.0f);
|
||||
}
|
||||
|
||||
// critical section as STK is not thread-safe
|
||||
static QMutex m;
|
||||
m.lock();
|
||||
@@ -301,8 +327,8 @@ void MalletsInstrument::playNote( NotePlayHandle * _n,
|
||||
_n->m_pluginData = new MalletsSynth( freq,
|
||||
vel,
|
||||
m_stickModel.value(),
|
||||
m_hardnessModel.value(),
|
||||
m_positionModel.value(),
|
||||
hardness,
|
||||
position,
|
||||
m_vibratoGainModel.value(),
|
||||
m_vibratoFreqModel.value(),
|
||||
p,
|
||||
@@ -315,8 +341,8 @@ void MalletsInstrument::playNote( NotePlayHandle * _n,
|
||||
vel,
|
||||
p,
|
||||
m_lfoDepthModel.value(),
|
||||
m_modulatorModel.value(),
|
||||
m_crossfadeModel.value(),
|
||||
modulator,
|
||||
crossfade,
|
||||
m_lfoSpeedModel.value(),
|
||||
m_adsrModel.value(),
|
||||
(uint8_t) m_spreadModel.value(),
|
||||
@@ -412,6 +438,11 @@ MalletsInstrumentView::MalletsInstrumentView( MalletsInstrument * _instrument,
|
||||
m_spreadKnob->move( 190, 140 );
|
||||
m_spreadKnob->setHintText( tr( "Spread:" ), "" );
|
||||
|
||||
m_randomKnob = new Knob(KnobType::Vintage32, this);
|
||||
m_randomKnob->setLabel(tr("Random"));
|
||||
m_randomKnob->move(190, 190);
|
||||
m_randomKnob->setHintText(tr("Random:"), "");
|
||||
|
||||
// try to inform user about missing Stk-installation
|
||||
if( _instrument->m_filesMissing && getGUI() != nullptr )
|
||||
{
|
||||
@@ -467,7 +498,7 @@ QWidget * MalletsInstrumentView::setupModalBarControls( QWidget * _parent )
|
||||
m_stickKnob->setLabel( tr( "Stick mix" ) );
|
||||
m_stickKnob->move( 190, 90 );
|
||||
m_stickKnob->setHintText( tr( "Stick mix:" ), "" );
|
||||
|
||||
|
||||
return( widget );
|
||||
}
|
||||
|
||||
@@ -565,6 +596,7 @@ void MalletsInstrumentView::modelChanged()
|
||||
// m_strikeLED->setModel( &inst->m_strikeModel );
|
||||
m_presetsCombo->setModel( &inst->m_presetsModel );
|
||||
m_spreadKnob->setModel( &inst->m_spreadModel );
|
||||
m_randomKnob->setModel(&inst->m_randomModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ private:
|
||||
|
||||
ComboBoxModel m_presetsModel;
|
||||
FloatModel m_spreadModel;
|
||||
FloatModel m_randomModel;
|
||||
IntModel m_versionModel;
|
||||
BoolModel m_isOldVersionModel;
|
||||
|
||||
@@ -255,6 +256,7 @@ private:
|
||||
|
||||
ComboBox * m_presetsCombo;
|
||||
Knob * m_spreadKnob;
|
||||
Knob * m_randomKnob;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user