Skip to content

Commit b256067

Browse files
committed
Minor fixes
1 parent 18e826f commit b256067

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

plugins/BitInvader/BitInvader.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ void BitInvader::loadSettings(const QDomElement& el)
117117
{
118118
m_graph.clear();
119119
m_sampleLength.loadSettings(el, "sampleLength");
120-
auto sampleLength = static_cast<int>(m_sampleLength.value());
121120

122121
// Load sample shape
123122
int size = 0;
@@ -126,7 +125,7 @@ void BitInvader::loadSettings(const QDomElement& el)
126125

127126
m_graph.setLength(size / sizeof(float));
128127
m_graph.setSamples(reinterpret_cast<float*>(dst));
129-
m_graph.setLength(sampleLength);
128+
m_graph.setLength(static_cast<int>(m_sampleLength.value()));
130129
delete[] dst;
131130

132131
m_interpolation.loadSettings(el, "interpolation");
@@ -162,7 +161,7 @@ void BitInvader::normalize()
162161
const auto len = m_normalizeMode.value() == m_normalizeMode.findText("Length only")
163162
? static_cast<std::size_t>(m_sampleLength.value())
164163
: wavetableSize;
165-
auto samples = std::span<const float>{ m_graph.samples(), len };
164+
const auto samples = std::span<const float>{ m_graph.samples(), len };
166165

167166
if (m_normalizeMode.value() == m_normalizeMode.findText("Legacy"))
168167
{

plugins/BitInvader/BitInvader.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ namespace lmms
4242
namespace gui { class BitInvaderView; }
4343

4444
//! @brief The phase of a note, represented as an index into a wavetable.
45+
//! The phase is normalized such that it has a range of [0, n), where n
46+
//! is the current length of the wavetable. It can therefore be
47+
//! truncated to obtain a valid index into that wavetable.
4548
using BitInvaderIndex = float;
4649

4750
class BitInvader : public Instrument
@@ -67,9 +70,7 @@ protected slots:
6770
private:
6871
FloatModel m_sampleLength;
6972
graphModel m_graph;
70-
7173
BoolModel m_interpolation;
72-
7374
ComboBoxModel m_normalizeMode;
7475

7576
float m_normalizeFactor; //!< Factor by which to amplify output such that the output is normalized

0 commit comments

Comments
 (0)