From 9635232b45bc4470097f4df3003be4f282f0b944 Mon Sep 17 00:00:00 2001 From: mikobuntu Date: Thu, 17 Jul 2014 20:10:25 +0100 Subject: [PATCH 01/20] Update globals.h --- plugins/zynaddsubfx/zynaddsubfx/src/globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/globals.h b/plugins/zynaddsubfx/zynaddsubfx/src/globals.h index d98e8babd..279dda525 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/globals.h +++ b/plugins/zynaddsubfx/zynaddsubfx/src/globals.h @@ -80,7 +80,7 @@ /* * Number of part's insertion effects */ -#define NUM_PART_EFX 3 +#define NUM_PART_EFX 8 /* * Maximum number of the instrument on a part From 2a6d6c2a7e2e56c5917e50dba288faec31cd1e60 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Fri, 7 Nov 2014 12:23:39 -0800 Subject: [PATCH 02/20] Fix Apple/Clang compilation for fmaf() --- include/interpolation.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/interpolation.h b/include/interpolation.h index 113058e4f..6ec234036 100644 --- a/include/interpolation.h +++ b/include/interpolation.h @@ -81,7 +81,11 @@ inline float cosinusInterpolate( float v0, float v1, float x ) { const float f = ( 1.0f - cosf( x * F_PI ) ) * 0.5f; #ifdef FP_FAST_FMAF - return fmaf( f, v1-v0, v0 ); + #ifndef __clang__ + return fmaf( f, v1-v0, v0 ); + #else + return fma( f, v1-v0, v0 ); + #endif #else return f * (v1-v0) + v0; #endif @@ -94,8 +98,11 @@ inline float linearInterpolate( float v0, float v1, float x ) // take advantage of fma function if present in hardware #ifdef FP_FAST_FMAF - return fmaf( x, v1-v0, v0 ); -#else + #ifndef __clang__ + return fmaf( x, v1-v0, v0 ); + #else + return fma( x, v1-v0, v0 ); + #endif return x * (v1-v0) + v0; #endif } From 4e5d4b95a0562f59f2ada3cd0c846e6f1a7a25ad Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Fri, 7 Nov 2014 12:39:00 -0800 Subject: [PATCH 03/20] Typo, add missing "else" --- include/interpolation.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/interpolation.h b/include/interpolation.h index 6ec234036..5dd98ea3f 100644 --- a/include/interpolation.h +++ b/include/interpolation.h @@ -103,6 +103,7 @@ inline float linearInterpolate( float v0, float v1, float x ) #else return fma( x, v1-v0, v0 ); #endif +#else return x * (v1-v0) + v0; #endif } From 828dd625fadac57a545d5561cabcf7a87b4f8cb3 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sun, 30 Nov 2014 23:00:28 -0500 Subject: [PATCH 04/20] Bump version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2c1be51d..5fbbd979a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ INCLUDE(FindPkgConfig) SET(VERSION_MAJOR "1") SET(VERSION_MINOR "0") -SET(VERSION_PATCH "98") +SET(VERSION_PATCH "99") #SET(VERSION_SUFFIX "") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") IF(VERSION_SUFFIX) From c3c550139689f5e973396716d09e7a1c4a901c9d Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Mon, 1 Dec 2014 21:28:29 +0200 Subject: [PATCH 05/20] Master kill switch for journalling, useful when closing program. --- include/ProjectJournal.h | 2 +- src/core/JournallingObject.cpp | 17 +++++++++++------ src/core/ProjectJournal.cpp | 12 ++++++++++++ src/core/engine.cpp | 1 + 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index 20ff70959..5cb7920f6 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -74,7 +74,7 @@ public: } void clearJournal(); - + void stopAllJournalling(); JournallingObject * journallingObject( const jo_id_t _id ) { if( m_joIDs.contains( _id ) ) diff --git a/src/core/JournallingObject.cpp b/src/core/JournallingObject.cpp index 4e5b20aad..90d597365 100644 --- a/src/core/JournallingObject.cpp +++ b/src/core/JournallingObject.cpp @@ -70,14 +70,19 @@ void JournallingObject::addJournalCheckPoint() QDomElement JournallingObject::saveState( QDomDocument & _doc, QDomElement & _parent ) { - QDomElement _this = SerializingObject::saveState( _doc, _parent ); + if( isJournalling() ) + { + QDomElement _this = SerializingObject::saveState( _doc, _parent ); - QDomElement journalNode = _doc.createElement( "journallingObject" ); - journalNode.setAttribute( "id", id() ); - journalNode.setAttribute( "metadata", true ); - _this.appendChild( journalNode ); + QDomElement journalNode = _doc.createElement( "journallingObject" ); + journalNode.setAttribute( "id", id() ); + journalNode.setAttribute( "metadata", true ); + _this.appendChild( journalNode ); - return _this; + return _this; + } else { + return QDomElement(); + } } diff --git a/src/core/ProjectJournal.cpp b/src/core/ProjectJournal.cpp index c04f81d26..511df4059 100644 --- a/src/core/ProjectJournal.cpp +++ b/src/core/ProjectJournal.cpp @@ -168,5 +168,17 @@ void ProjectJournal::clearJournal() } } +void ProjectJournal::stopAllJournalling() +{ + for( JoIdMap::Iterator it = m_joIDs.begin(); it != m_joIDs.end(); ++it) + { + if( it.value() != NULL ) + { + it.value()->setJournalling(false); + } + } + setJournalling(false); +} + diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 4931b571d..f7864e46f 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -115,6 +115,7 @@ void engine::init( const bool _has_gui ) void engine::destroy() { + s_projectJournal->stopAllJournalling(); s_mixer->stopProcessing(); deleteHelper( &s_projectNotes ); From e7e8e79630d646def6382aff0980c96ee1635bef Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 4 Dec 2014 02:39:26 +0000 Subject: [PATCH 06/20] Changed default delay time to 0.5 seconds from 2.0. --- plugins/delay/delaycontrols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/delay/delaycontrols.cpp b/plugins/delay/delaycontrols.cpp index cc0aadbb5..afcb0f76d 100644 --- a/plugins/delay/delaycontrols.cpp +++ b/plugins/delay/delaycontrols.cpp @@ -32,7 +32,7 @@ DelayControls::DelayControls( DelayEffect* effect ): EffectControls( effect ), m_effect ( effect ), - m_delayTimeModel( 2.0, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Delay Samples" )) , + m_delayTimeModel( 0.5, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Delay Samples" )) , m_feedbackModel(0.0f,0.0f,1.0f,0.01f,this,tr( "Feedback" ) ), m_lfoTimeModel(2.0, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Lfo Frequency" ) ), m_lfoAmountModel(0.0, 0.0, 2.0, 0.0001, 2000.0, this, tr ( "Lfo Amount" ) ) From fc6374a07b576c3921c4f68acd83968e5337f887 Mon Sep 17 00:00:00 2001 From: mikobuntu Date: Thu, 4 Dec 2014 19:49:40 +0000 Subject: [PATCH 07/20] reverted changes to globals.h --- plugins/zynaddsubfx/zynaddsubfx/src/globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/globals.h b/plugins/zynaddsubfx/zynaddsubfx/src/globals.h index 279dda525..d98e8babd 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/globals.h +++ b/plugins/zynaddsubfx/zynaddsubfx/src/globals.h @@ -80,7 +80,7 @@ /* * Number of part's insertion effects */ -#define NUM_PART_EFX 8 +#define NUM_PART_EFX 3 /* * Maximum number of the instrument on a part From 762b667b4753e7db8452da68a849654b9b38dfca Mon Sep 17 00:00:00 2001 From: mikobuntu Date: Thu, 4 Dec 2014 19:56:54 +0000 Subject: [PATCH 08/20] Added TR909-RimShot preset to Kicker :///home/mikobuntu/lmms/presets/Kicker/RimShot4.xpf --- data/presets/Kicker/TR909-RimShot.xpf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 data/presets/Kicker/TR909-RimShot.xpf diff --git a/data/presets/Kicker/TR909-RimShot.xpf b/data/presets/Kicker/TR909-RimShot.xpf new file mode 100644 index 000000000..415fd0cee --- /dev/null +++ b/data/presets/Kicker/TR909-RimShot.xpf @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + From 8c0ab4dfecfd861d00e3af06af3874eddc1284eb Mon Sep 17 00:00:00 2001 From: mikobuntu Date: Thu, 4 Dec 2014 20:55:39 +0000 Subject: [PATCH 09/20] Fixed naming of Kicker preset (RimShot to TR909-RimShot) --- data/presets/Kicker/TR909-RimShot.xpf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/presets/Kicker/TR909-RimShot.xpf b/data/presets/Kicker/TR909-RimShot.xpf index 415fd0cee..e8626db29 100644 --- a/data/presets/Kicker/TR909-RimShot.xpf +++ b/data/presets/Kicker/TR909-RimShot.xpf @@ -2,7 +2,7 @@ - + From cefee3a72100d77074ef85aa77fe287d3f992708 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 6 Dec 2014 18:28:19 +0000 Subject: [PATCH 10/20] added s postfix to knob values where applicable. --- plugins/delay/delaycontrolsdialog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/delay/delaycontrolsdialog.cpp b/plugins/delay/delaycontrolsdialog.cpp index badc9f84f..88f253f78 100644 --- a/plugins/delay/delaycontrolsdialog.cpp +++ b/plugins/delay/delaycontrolsdialog.cpp @@ -44,27 +44,30 @@ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) : sampleDelayKnob->setVolumeKnob( false ); sampleDelayKnob->setModel( &controls->m_delayTimeModel ); sampleDelayKnob->setLabel( tr( "Delay" ) ); - sampleDelayKnob->setHintText( tr( "Delay Time Seconds:" ) + " ", "" ); + sampleDelayKnob->setHintText( tr( "Delay Time" ) , " s" ); + knob * feedbackKnob = new knob( knobBright_26, this ); feedbackKnob->move( 63,10 ); feedbackKnob->setVolumeKnob( true) ; feedbackKnob->setModel( &controls->m_feedbackModel); feedbackKnob->setLabel( tr( "Regen" ) ); - feedbackKnob->setHintText( tr ( "Feedback Amount:" ) + " ", "" ); + feedbackKnob->setHintText( tr ( "Feedback Amount:" ) , "" ); TempoSyncKnob * lfoFreqKnob = new TempoSyncKnob( knobBright_26, this ); lfoFreqKnob->move( 106,10 ); lfoFreqKnob->setVolumeKnob( false ); lfoFreqKnob->setModel( &controls->m_lfoTimeModel ); lfoFreqKnob->setLabel( tr( "Rate" ) ); - lfoFreqKnob->setHintText( tr ( "Lfo Seconds:" ) + " ", "" ); + lfoFreqKnob->setHintText( tr ( "Lfo" ) + " ", " s" ); + TempoSyncKnob * lfoAmtKnob = new TempoSyncKnob( knobBright_26, this ); lfoAmtKnob->move( 150,10 ); lfoAmtKnob->setVolumeKnob( false ); lfoAmtKnob->setModel( &controls->m_lfoAmountModel ); lfoAmtKnob->setLabel( tr( "Lfo" ) ); - lfoAmtKnob->setHintText( tr ( "Lfo Amt:" ) + " ", "" ); + lfoAmtKnob->setHintText( tr ( "Lfo Amt:" ) , " s" ); + } From 4a2a60255c39039c6ef49e7ca92e175a3b790f44 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 6 Dec 2014 18:34:24 +0000 Subject: [PATCH 11/20] Added postfix "s" to knobs where relevant, cleaned up unintentional white space --- plugins/delay/delaycontrolsdialog.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/delay/delaycontrolsdialog.cpp b/plugins/delay/delaycontrolsdialog.cpp index 88f253f78..019d7208a 100644 --- a/plugins/delay/delaycontrolsdialog.cpp +++ b/plugins/delay/delaycontrolsdialog.cpp @@ -46,7 +46,6 @@ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) : sampleDelayKnob->setLabel( tr( "Delay" ) ); sampleDelayKnob->setHintText( tr( "Delay Time" ) , " s" ); - knob * feedbackKnob = new knob( knobBright_26, this ); feedbackKnob->move( 63,10 ); feedbackKnob->setVolumeKnob( true) ; @@ -59,8 +58,7 @@ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) : lfoFreqKnob->setVolumeKnob( false ); lfoFreqKnob->setModel( &controls->m_lfoTimeModel ); lfoFreqKnob->setLabel( tr( "Rate" ) ); - lfoFreqKnob->setHintText( tr ( "Lfo" ) + " ", " s" ); - + lfoFreqKnob->setHintText( tr ( "Lfo" ) , " s" ); TempoSyncKnob * lfoAmtKnob = new TempoSyncKnob( knobBright_26, this ); lfoAmtKnob->move( 150,10 ); From decac202980c1f545053d7c65ace34d96933f743 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 6 Dec 2014 19:47:39 +0000 Subject: [PATCH 12/20] Replaced whitespace in knob definitions, for consistancy --- plugins/delay/delaycontrolsdialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/delay/delaycontrolsdialog.cpp b/plugins/delay/delaycontrolsdialog.cpp index 019d7208a..00c46b105 100644 --- a/plugins/delay/delaycontrolsdialog.cpp +++ b/plugins/delay/delaycontrolsdialog.cpp @@ -44,28 +44,28 @@ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) : sampleDelayKnob->setVolumeKnob( false ); sampleDelayKnob->setModel( &controls->m_delayTimeModel ); sampleDelayKnob->setLabel( tr( "Delay" ) ); - sampleDelayKnob->setHintText( tr( "Delay Time" ) , " s" ); + sampleDelayKnob->setHintText( tr( "Delay Time" ) + " ", " s" ); knob * feedbackKnob = new knob( knobBright_26, this ); feedbackKnob->move( 63,10 ); feedbackKnob->setVolumeKnob( true) ; feedbackKnob->setModel( &controls->m_feedbackModel); feedbackKnob->setLabel( tr( "Regen" ) ); - feedbackKnob->setHintText( tr ( "Feedback Amount:" ) , "" ); + feedbackKnob->setHintText( tr ( "Feedback Amount" ) + " " , "" ); TempoSyncKnob * lfoFreqKnob = new TempoSyncKnob( knobBright_26, this ); lfoFreqKnob->move( 106,10 ); lfoFreqKnob->setVolumeKnob( false ); lfoFreqKnob->setModel( &controls->m_lfoTimeModel ); lfoFreqKnob->setLabel( tr( "Rate" ) ); - lfoFreqKnob->setHintText( tr ( "Lfo" ) , " s" ); + lfoFreqKnob->setHintText( tr ( "Lfo") + " ", " s" ); TempoSyncKnob * lfoAmtKnob = new TempoSyncKnob( knobBright_26, this ); lfoAmtKnob->move( 150,10 ); lfoAmtKnob->setVolumeKnob( false ); lfoAmtKnob->setModel( &controls->m_lfoAmountModel ); lfoAmtKnob->setLabel( tr( "Lfo" ) ); - lfoAmtKnob->setHintText( tr ( "Lfo Amt:" ) , " s" ); + lfoAmtKnob->setHintText( tr ( "Lfo Amt" ) + " " , " s" ); } From 2e8534955b5064da736b19ed08c6b0bd6358cbca Mon Sep 17 00:00:00 2001 From: Vesa Date: Sun, 7 Dec 2014 22:29:23 +0200 Subject: [PATCH 13/20] Fix FX mixer race condition Conflicts: src/core/FxMixer.cpp --- src/core/FxMixer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index 37a91b7d4..d47f34c8b 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -103,7 +103,6 @@ void FxChannel::incrementDeps() { m_queued = true; MixerWorkerThread::addJob( this ); - m_dependenciesMet = 0; } } @@ -164,8 +163,8 @@ void FxChannel::doProcessing( sampleFrame * _buf ) { m_peakLeft = m_peakRight = 0.0f; } - - // increment dependency counter of all receivers + + // increment dependency counter of all receivers processed(); } @@ -358,7 +357,7 @@ FxRoute * FxMixer::createRoute( FxChannel * from, FxChannel * to, float amount ) // add us to fxmixer's list engine::fxMixer()->m_fxRoutes.append( route ); m_sendsMutex.unlock(); - + return route; } @@ -527,6 +526,7 @@ void FxMixer::masterMix( sampleFrame * _buf ) m_fxChannels[i]->m_queued = false; // also reset hasInput m_fxChannels[i]->m_hasInput = false; + m_fxChannels[i]->m_dependenciesMet = 0; } } @@ -600,7 +600,7 @@ void FxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this ) ch->m_sends[si]->amount()->saveSettings( _doc, sendsDom, "amount" ); } } -} +} // make sure we have at least num channels void FxMixer::allocateChannelsTo(int num) From 56d0910533efbcf8589a1e1fca967dbeefbba026 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 8 Dec 2014 12:20:47 -0500 Subject: [PATCH 14/20] Cleanup fmaf() usage, move to lmms_math.h --- include/interpolation.h | 24 +++--------------------- include/lmms_math.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/include/interpolation.h b/include/interpolation.h index 5dd98ea3f..cbe274d42 100644 --- a/include/interpolation.h +++ b/include/interpolation.h @@ -32,6 +32,7 @@ #include #include "lmms_constants.h" +#include "lmms_math.h" inline float hermiteInterpolate( float x0, float x1, float x2, float x3, float frac_pos ) @@ -80,32 +81,13 @@ inline float cubicInterpolate( float v0, float v1, float v2, float v3, float x ) inline float cosinusInterpolate( float v0, float v1, float x ) { const float f = ( 1.0f - cosf( x * F_PI ) ) * 0.5f; -#ifdef FP_FAST_FMAF - #ifndef __clang__ - return fmaf( f, v1-v0, v0 ); - #else - return fma( f, v1-v0, v0 ); - #endif -#else - return f * (v1-v0) + v0; -#endif -// return( v0*f + v1*( 1.0f-f ) ); + return fastFmaf( f, v1-v0, v0 ); } inline float linearInterpolate( float v0, float v1, float x ) { -// take advantage of fma function if present in hardware - -#ifdef FP_FAST_FMAF - #ifndef __clang__ - return fmaf( x, v1-v0, v0 ); - #else - return fma( x, v1-v0, v0 ); - #endif -#else - return x * (v1-v0) + v0; -#endif + return fastFmaf( x, v1-v0, v0 ); } diff --git a/include/lmms_math.h b/include/lmms_math.h index 47136ae94..c82d32ac5 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -130,7 +130,40 @@ static inline int fast_rand() return( (unsigned)( next / 65536 ) % 32768 ); } +//! @brief Takes advantage of fmal() function if present in hardware +static inline long fastFmal( long a, long b, long c) { +#ifdef FP_FAST_FMAF + #ifdef __clang__ + return fma(a, b, c); + #else + return fmal(a, b, c); + #endif +#else + return a * ( b - c ) + c; +#endif +} +//! @brief Takes advantage of fmaf() function if present in hardware +static inline float fastFmaf( float a, float b, float c) { +#ifdef FP_FAST_FMAF + #ifdef __clang__ + return fma(a, b, c); + #else + return fmaf(a, b, c); + #endif +#else + return a * ( b - c ) + c; +#endif +} + +//! @brief Takes advantage of fma() function if present in hardware +static inline int fastFma( int a, int b, int c) { +#ifdef FP_FAST_FMAF + return fma(a, b, c); +#else + return a * ( b - c ) + c; +#endif +} // source: http://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/ static inline double fastPow( double a, double b ) From 591acbf73264620de26bb90ec32a5c183be98c0d Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 8 Dec 2014 12:22:33 -0500 Subject: [PATCH 15/20] fastFmaf() formatting fixes --- include/lmms_math.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/lmms_math.h b/include/lmms_math.h index c82d32ac5..8c7d07cb0 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -136,7 +136,7 @@ static inline long fastFmal( long a, long b, long c) { #ifdef __clang__ return fma(a, b, c); #else - return fmal(a, b, c); + return fmal( a, b, c ); #endif #else return a * ( b - c ) + c; @@ -147,9 +147,9 @@ static inline long fastFmal( long a, long b, long c) { static inline float fastFmaf( float a, float b, float c) { #ifdef FP_FAST_FMAF #ifdef __clang__ - return fma(a, b, c); + return fma( a, b, c ); #else - return fmaf(a, b, c); + return fmaf( a, b, c ); #endif #else return a * ( b - c ) + c; @@ -159,7 +159,7 @@ static inline float fastFmaf( float a, float b, float c) { //! @brief Takes advantage of fma() function if present in hardware static inline int fastFma( int a, int b, int c) { #ifdef FP_FAST_FMAF - return fma(a, b, c); + return fma( a, b, c ); #else return a * ( b - c ) + c; #endif From 76d766fe252f55668ab7d1a21bb889d2de8e110c Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 8 Dec 2014 12:30:16 -0500 Subject: [PATCH 16/20] fmaf() code cleanup, typos --- include/lmms_math.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/lmms_math.h b/include/lmms_math.h index 8c7d07cb0..393a16d8b 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -131,7 +131,7 @@ static inline int fast_rand() } //! @brief Takes advantage of fmal() function if present in hardware -static inline long fastFmal( long a, long b, long c) { +static inline long fastFmal( long a, long b, long c ) { #ifdef FP_FAST_FMAF #ifdef __clang__ return fma(a, b, c); @@ -139,12 +139,12 @@ static inline long fastFmal( long a, long b, long c) { return fmal( a, b, c ); #endif #else - return a * ( b - c ) + c; + return a * b + c; #endif } //! @brief Takes advantage of fmaf() function if present in hardware -static inline float fastFmaf( float a, float b, float c) { +static inline float fastFmaf( float a, float b, float c ) { #ifdef FP_FAST_FMAF #ifdef __clang__ return fma( a, b, c ); @@ -152,16 +152,16 @@ static inline float fastFmaf( float a, float b, float c) { return fmaf( a, b, c ); #endif #else - return a * ( b - c ) + c; + return a * b + c; #endif } //! @brief Takes advantage of fma() function if present in hardware -static inline int fastFma( int a, int b, int c) { +static inline int fastFma( int a, int b, int c ) { #ifdef FP_FAST_FMAF return fma( a, b, c ); #else - return a * ( b - c ) + c; + return a * b + c; #endif } From 5a0dfdd3c0b63704130f6ed287ccd8e3521c73e6 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 8 Dec 2014 12:45:31 -0500 Subject: [PATCH 17/20] minor fmaf() formatting fix. --- include/lmms_math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lmms_math.h b/include/lmms_math.h index 393a16d8b..ac8ab6fdc 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -134,7 +134,7 @@ static inline int fast_rand() static inline long fastFmal( long a, long b, long c ) { #ifdef FP_FAST_FMAF #ifdef __clang__ - return fma(a, b, c); + return fma( a, b, c ); #else return fmal( a, b, c ); #endif From 7431e772294a6d5455cfd1a6d45750bd26ac4d4e Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 8 Dec 2014 14:42:19 -0500 Subject: [PATCH 18/20] More fmal() fixes --- include/lmms_math.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lmms_math.h b/include/lmms_math.h index ac8ab6fdc..156303136 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -131,7 +131,7 @@ static inline int fast_rand() } //! @brief Takes advantage of fmal() function if present in hardware -static inline long fastFmal( long a, long b, long c ) { +static inline long double fastFmal( long double a, long double b, long double c ) { #ifdef FP_FAST_FMAF #ifdef __clang__ return fma( a, b, c ); @@ -157,7 +157,7 @@ static inline float fastFmaf( float a, float b, float c ) { } //! @brief Takes advantage of fma() function if present in hardware -static inline int fastFma( int a, int b, int c ) { +static inline double fastFma( double a, double b, double c ) { #ifdef FP_FAST_FMAF return fma( a, b, c ); #else From bbe337bd03299a37b27320f3995f27739733aa60 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 9 Dec 2014 08:28:00 -0500 Subject: [PATCH 19/20] Use correct FMA_ macros --- include/lmms_math.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lmms_math.h b/include/lmms_math.h index 156303136..3d23abcd3 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -132,7 +132,7 @@ static inline int fast_rand() //! @brief Takes advantage of fmal() function if present in hardware static inline long double fastFmal( long double a, long double b, long double c ) { -#ifdef FP_FAST_FMAF +#ifdef FP_FAST_FMAL #ifdef __clang__ return fma( a, b, c ); #else @@ -158,7 +158,7 @@ static inline float fastFmaf( float a, float b, float c ) { //! @brief Takes advantage of fma() function if present in hardware static inline double fastFma( double a, double b, double c ) { -#ifdef FP_FAST_FMAF +#ifdef FP_FAST_FMA return fma( a, b, c ); #else return a * b + c; From 4a6257a47c8c2d44f817ac447e2656a9283a242e Mon Sep 17 00:00:00 2001 From: Vesa Date: Wed, 10 Dec 2014 01:28:14 +0200 Subject: [PATCH 20/20] Fix master channel peak display Fix #1427 Conflicts: src/core/FxMixer.cpp src/gui/FxMixerView.cpp --- src/core/FxMixer.cpp | 3 --- src/gui/FxMixerView.cpp | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index d47f34c8b..7a21acb92 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -514,9 +514,6 @@ void FxMixer::masterMix( sampleFrame * _buf ) const float v = m_fxChannels[0]->m_volumeModel.value(); MixHelpers::addSanitizedMultiplied( _buf, m_fxChannels[0]->m_buffer, v, fpp ); - m_fxChannels[0]->m_peakLeft *= engine::mixer()->masterGain(); - m_fxChannels[0]->m_peakRight *= engine::mixer()->masterGain(); - // clear all channel buffers and // reset channel process state for( int i = 0; i < numChannels(); ++i) diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index bd7df6e2f..8948e8474 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -480,6 +480,11 @@ void FxMixerView::clear() void FxMixerView::updateFaders() { FxMixer * m = engine::fxMixer(); + + // apply master gain + m->m_fxChannels[0]->m_peakLeft *= engine::mixer()->masterGain(); + m->m_fxChannels[0]->m_peakRight *= engine::mixer()->masterGain(); + for( int i = 0; i < m_fxChannelViews.size(); ++i ) { const float opl = m_fxChannelViews[i]->m_fader->getPeak_L();