This patch allows editing of sf2 player quality settings when in draft
mode via the .lmmsrcxml file. This allows my computer to process more
midi channels simultaneously in real time.
On Fri, Apr 2, 2010 at 2:07 AM, Jonathan Aquilina
<[email protected]> wrote:
> why are you spamming the mailing list with soundcloud invites?
>
> On Fri, Apr 2, 2010 at 2:15 AM, Gyre via SoundCloud
> <[email protected]> wrote:
>>
>> Message from Gyre (Mike McGuire) via SoundCloud:
>>
>> If you'd like to stay up-to-date about my music, then follow me on
>> SoundCloud. Seriously, it's nice & fun :)
>>
>> Personal message from Gyre (Mike McGuire):
>> ................................ <p>Hey there, If you are on soundcloud,
>> or follow my music at all, would you kindly add me as a friend on
>> soundcloud. Your SUpport is much appreciated!</p>
>> ................................
>>
>> Sounds great! But wait, what is SoundCloud exactly? SoundCloud lets you
>> move your audio across the web, nice & easy. Select who you want to give
>> access to your music and share your tracks in public or private. Check out
>> www.soundcloud.com and let's move some music together, the cool-kids way.
>>
>> Your host,
>> The SoundCloud WeatherMan
>> ................................
>> Need help with anything? Check our Help Center or our support forums.
>> ................................
>>
>>
>> ------------------------------------------------------------------------------
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> _______________________________________________
>> LMMS-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/lmms-devel
>>
>
>
>
> --
> Jonathan Aquilina
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> LMMS-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/lmms-devel
>
>
From b9b5550789ce0dedcc5cac588a8e625549dfa598 Mon Sep 17 00:00:00 2001
From: Carmelo Piccione <struktu...@flighty.(none)>
Date: Tue, 23 Mar 2010 00:20:23 -0400
Subject: [PATCH 2/6] Undersampling quality setting added to mitigate overloading of fluidsynth.
Adds an undersampling parameter, similar to the oversampling
parameter but instead divides the output sample rate by a
divisor and sets the value as the sample rate of the sound synth.
---
include/AudioOutputContext.h | 52 +++++++++++++++++++++++++++++++++---
include/Mixer.h | 4 +-
plugins/sf2_player/sf2_player.cpp | 4 +-
src/core/Mixer.cpp | 6 +++-
src/gui/ExportProjectDialog.cpp | 2 +
5 files changed, 58 insertions(+), 10 deletions(-)
diff --git a/include/AudioOutputContext.h b/include/AudioOutputContext.h
index 5ed93c1..b7cd3a2 100644
--- a/include/AudioOutputContext.h
+++ b/include/AudioOutputContext.h
@@ -70,13 +70,22 @@ public:
/*! Lists all supported oversampling ratios. */
enum Oversampling
- {
+ {
Oversampling_None, /*!< No oversampling - fast */
Oversampling_2x, /*!< 2x oversampling - good quality */
Oversampling_4x, /*!< 4x oversampling - better quality */
- Oversampling_8x /*!< 8x oversampling - best quality but might break some filters */
+ Oversampling_8x, /*!< 8x oversampling - best quality but might break some filters */
} ;
-
+
+ /*! Lists all supported undersampling ratios. */
+ enum Undersampling
+ {
+ Undersampling_None,
+ Undersampling_2x,
+ Undersampling_4x,
+ Undersampling_8x
+ } ;
+
/*! \brief Constructs a QualitySettings object based on a given preset. */
QualitySettings( Preset m )
{
@@ -85,18 +94,21 @@ public:
case Preset_Draft:
m_interpolation = Interpolation_Linear;
m_oversampling = Oversampling_None;
+ m_undersampling = Undersampling_4x;
m_sampleExactControllers = false;
m_aliasFreeOscillators = false;
break;
case Preset_HighQuality:
m_interpolation = Interpolation_SincFastest;
m_oversampling = Oversampling_2x;
+ m_undersampling = Undersampling_None;
m_sampleExactControllers = true;
m_aliasFreeOscillators = false;
break;
case Preset_FinalMix:
m_interpolation = Interpolation_SincBest;
m_oversampling = Oversampling_8x;
+ m_undersampling = Undersampling_None;
m_sampleExactControllers = true;
m_aliasFreeOscillators = true;
break;
@@ -106,10 +118,11 @@ public:
}
/*! \brief Constructs a QualitySettings object based on specific quality settings. */
- QualitySettings( Interpolation _i, Oversampling _o, bool _sec,
+ QualitySettings( Interpolation _i, Oversampling _o, Undersampling _u, bool _sec,
bool _afo ) :
m_interpolation( _i ),
m_oversampling( _o ),
+ m_undersampling( _u ),
m_sampleExactControllers( _sec ),
m_aliasFreeOscillators( _afo )
{
@@ -119,7 +132,7 @@ public:
int sampleRateMultiplier() const
{
switch( oversampling() )
- {
+ {
case Oversampling_None: return 1;
case Oversampling_2x: return 2;
case Oversampling_4x: return 4;
@@ -127,6 +140,20 @@ public:
}
return 1;
}
+
+
+ /*! \brief Returns divisor for sound effects sample rate based on undersampling settings. */
+ int sfxSampleRateDivisor() const
+ {
+ switch( undersampling() )
+ {
+ case Undersampling_None: return 1;
+ case Undersampling_2x: return 2;
+ case Undersampling_4x: return 4;
+ case Undersampling_8x: return 8;
+ }
+ return 1;
+ }
/*! \brief Maps interpolation setting to libsamplerate constants. */
int libsrcInterpolation() const
@@ -163,12 +190,26 @@ public:
return m_oversampling;
}
+
+ /*! \brief Returns current undersampling setting. */
+ Undersampling undersampling() const
+ {
+ return m_undersampling;
+ }
+
/*! \brief Sets a new oversampling factor. */
void setOversampling( Oversampling oversampling )
{
m_oversampling = oversampling;
}
+
+ /*! \brief Sets a new oversampling factor. */
+ void setUndersampling( Undersampling undersampling )
+ {
+ m_undersampling = undersampling;
+ }
+
/*! \brief Returns whether to use sample exact controllers. */
bool sampleExactControllers() const
{
@@ -184,6 +225,7 @@ public:
private:
Interpolation m_interpolation;
Oversampling m_oversampling;
+ Undersampling m_undersampling;
bool m_sampleExactControllers;
bool m_aliasFreeOscillators;
diff --git a/include/Mixer.h b/include/Mixer.h
index b0eb11e..6f454d7 100644
--- a/include/Mixer.h
+++ b/include/Mixer.h
@@ -172,8 +172,8 @@ public:
sample_rate_t outputSampleRate() const;
sample_rate_t inputSampleRate() const;
sample_rate_t processingSampleRate() const;
-
-
+ sample_rate_t sfxSampleRate() const;
+
inline float masterGain() const
{
return m_masterGain;
diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp
index 8d36c69..c6e22e9 100644
--- a/plugins/sf2_player/sf2_player.cpp
+++ b/plugins/sf2_player/sf2_player.cpp
@@ -499,8 +499,8 @@ void sf2Instrument::updateSampleRate()
double tempRate;
// Set & get, returns the true sample rate
- fluid_settings_setnum( m_settings, (char *) "synth.sample-rate",
- engine::mixer()->processingSampleRate() );
+ fluid_settings_setnum( m_settings, (char *) "synth.sample-rate",
+ engine::mixer()->sfxSampleRate());
fluid_settings_getnum( m_settings, (char *) "synth.sample-rate",
&tempRate );
m_internalSampleRate = static_cast<int>( tempRate );
diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp
index 5e4c26a..3b4aa55 100644
--- a/src/core/Mixer.cpp
+++ b/src/core/Mixer.cpp
@@ -235,7 +235,11 @@ sample_rate_t Mixer::processingSampleRate() const
}
-
+sample_rate_t Mixer::sfxSampleRate() const
+{
+ return outputSampleRate() /
+ audioOutputContext()->qualitySettings().sfxSampleRateDivisor();
+}
bool Mixer::criticalXRuns() const
{
diff --git a/src/gui/ExportProjectDialog.cpp b/src/gui/ExportProjectDialog.cpp
index 3d898e9..ee4ec2c 100644
--- a/src/gui/ExportProjectDialog.cpp
+++ b/src/gui/ExportProjectDialog.cpp
@@ -152,6 +152,8 @@ void ExportProjectDialog::startBtnClicked()
ui->interpolationCB->currentIndex() ),
static_cast<AudioOutputContext::QualitySettings::Oversampling>(
ui->oversamplingCB->currentIndex() ),
+ AudioOutputContext::QualitySettings::Undersampling_None,
+
ui->sampleExactControllersCB->isChecked(),
ui->aliasFreeOscillatorsCB->isChecked() );
--
1.6.6.1
From 3760f6bcba18c81936b6a5044cdfe02b32c0e7a7 Mon Sep 17 00:00:00 2001
From: Carmelo Piccione <struktu...@flighty.(none)>
Date: Tue, 23 Mar 2010 22:26:06 -0400
Subject: [PATCH 3/6] made preset draft quality settings configurable.
interpolation, oversampling, undersampling, alias free
oscillators, and sample exact controllers are no longer hard
coded into the preset draft type- instead its set via
the lmms xml settings file.
---
include/AudioOutputContext.h | 59 ++++++++++++++++++++++++++++++++++++++---
1 files changed, 54 insertions(+), 5 deletions(-)
diff --git a/include/AudioOutputContext.h b/include/AudioOutputContext.h
index b7cd3a2..e81320e 100644
--- a/include/AudioOutputContext.h
+++ b/include/AudioOutputContext.h
@@ -29,6 +29,7 @@
#include <QtCore/QThread>
#include "Mixer.h"
+#include "config_mgr.h"
class AudioBackend;
@@ -92,11 +93,18 @@ public:
switch( m )
{
case Preset_Draft:
- m_interpolation = Interpolation_Linear;
- m_oversampling = Oversampling_None;
- m_undersampling = Undersampling_4x;
- m_sampleExactControllers = false;
- m_aliasFreeOscillators = false;
+ m_interpolation = parseInterpolation
+ (configManager::inst()->value("draftqualitysettings", "interpolation"));
+ m_oversampling =
+ parseOversamplingValue
+ (configManager::inst()->value("draftqualitysettings", "oversampleratedivisor"));
+ m_undersampling =
+ parseUndersamplingValue
+ (configManager::inst()->value("draftqualitysettings", "undersampleratedivisor"));
+ m_sampleExactControllers =
+ configManager::inst()->value("draftqualitysettings", "sampleexactcontrollers") == "true";
+ m_aliasFreeOscillators =
+ configManager::inst()->value("draftqualitysettings", "aliasfreeoscillators") == "true";
break;
case Preset_HighQuality:
m_interpolation = Interpolation_SincFastest;
@@ -154,7 +162,48 @@ public:
}
return 1;
}
+
+ Undersampling parseUndersamplingValue(const QString & value) const
+ {
+ if (value == "1")
+ return Undersampling_None;
+ else if (value == "2")
+ return Undersampling_2x;
+ else if (value == "4")
+ return Undersampling_4x;
+ else if (value == "8")
+ return Undersampling_8x;
+ return Undersampling_None;
+ }
+ Oversampling parseOversamplingValue(const QString & value) const
+ {
+ if (value == "1")
+ return Oversampling_None;
+ else if (value == "2")
+ return Oversampling_2x;
+ else if (value == "4")
+ return Oversampling_4x;
+ else if (value == "8")
+ return Oversampling_8x;
+ return Oversampling_None;
+ }
+
+
+ Interpolation parseInterpolation(const QString & value) const
+ {
+ if (value == "linear")
+ return Interpolation_Linear;
+ else if (value == "sincbest")
+ return Interpolation_SincBest;
+ else if (value == "sincfastest")
+ return Interpolation_SincFastest;
+ else if (value == "sincmedium")
+ return Interpolation_SincMedium;
+ else
+ return Interpolation_Linear;
+ }
+
/*! \brief Maps interpolation setting to libsamplerate constants. */
int libsrcInterpolation() const
{
--
1.6.6.1
From c603b822d80a968aff19b14a894c64474fc3472a Mon Sep 17 00:00:00 2001
From: Carmelo Piccione <struktu...@flighty.(none)>
Date: Tue, 23 Mar 2010 23:38:41 -0400
Subject: [PATCH 4/6] typo: divisor -> multiplier
---
include/AudioOutputContext.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/AudioOutputContext.h b/include/AudioOutputContext.h
index e81320e..d5e65c7 100644
--- a/include/AudioOutputContext.h
+++ b/include/AudioOutputContext.h
@@ -97,7 +97,7 @@ public:
(configManager::inst()->value("draftqualitysettings", "interpolation"));
m_oversampling =
parseOversamplingValue
- (configManager::inst()->value("draftqualitysettings", "oversampleratedivisor"));
+ (configManager::inst()->value("draftqualitysettings", "oversampleratemultiplier"));
m_undersampling =
parseUndersamplingValue
(configManager::inst()->value("draftqualitysettings", "undersampleratedivisor"));
--
1.6.6.1
From 1a944d113ca09a51100b1d3b2acec5b103113ca6 Mon Sep 17 00:00:00 2001
From: Carmelo Piccione <struktu...@flighty.(none)>
Date: Thu, 25 Mar 2010 20:42:13 -0400
Subject: [PATCH 5/6] use 1 rather than true.\n Switched to this since it is the convention in the rest of the xml of the file.
---
include/AudioOutputContext.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/AudioOutputContext.h b/include/AudioOutputContext.h
index d5e65c7..589a17e 100644
--- a/include/AudioOutputContext.h
+++ b/include/AudioOutputContext.h
@@ -102,9 +102,9 @@ public:
parseUndersamplingValue
(configManager::inst()->value("draftqualitysettings", "undersampleratedivisor"));
m_sampleExactControllers =
- configManager::inst()->value("draftqualitysettings", "sampleexactcontrollers") == "true";
+ configManager::inst()->value("draftqualitysettings", "sampleexactcontrollers") == "1";
m_aliasFreeOscillators =
- configManager::inst()->value("draftqualitysettings", "aliasfreeoscillators") == "true";
+ configManager::inst()->value("draftqualitysettings", "aliasfreeoscillators") == "1";
break;
case Preset_HighQuality:
m_interpolation = Interpolation_SincFastest;
--
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
LMMS-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmms-devel