Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/plugins/score-lib-process/Process/Dataflow/Cable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ CableData Cable::toCableData() const
return c;
}

// Declared SCORE_LIB_PROCESS_EXPORT in CableData.hpp but was never defined —

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these sleop comments

// any caller (e.g. equality checks on saved-cable blobs) failed to link.
bool operator==(const CableData& lhs, const CableData& rhs)
{
return lhs.type == rhs.type && lhs.source == rhs.source && lhs.sink == rhs.sink;
}

CableType Cable::type() const
{
return m_type;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/score-lib-process/Process/Dataflow/Port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void ControlInlet::loadData(const QByteArray& arr, PortLoadDataFlags flags) noex
bool has_value{};

op >> m_cables >> m_address >> has_value;
if(!((uint32_t)flags & (uint32_t)PortLoadDataFlags::DontReloadValue))
if(!((uint32_t)flags & (uint32_t)PortLoadDataFlags::ReloadValue))
has_value = false;

if(has_value)
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/score-lib-process/Process/Dataflow/PortType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ enum class PortType
Geometry,
};

// Flags for ControlInlet::loadData (the in-memory saveData/loadData blob used by

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these slop comments

// undo/redo state capture and port re-matching — NOT document save/load, which
// goes through the value visitor). By default the saved control value is NOT
// applied (the caller re-derives it from its own source: a script's/plugin's
// own defaults, lilv state, loadPreset...). Pass ReloadValue when you want the
// blob's value applied (e.g. LoadPresetCommand::redo).
enum class PortLoadDataFlags
{
NoFlag = 0,
DontReloadValue = (1 << 0)
ReloadValue = (1 << 0)
};

SCORE_LIB_PROCESS_EXPORT
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/score-plugin-analysis/Analysis/GistState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct GistState
if(g1.getAudioFrameSize() != samples)
g1.setAudioFrameSize(samples);

g1.processAudioFrame(data(c0), samples);
g1.processAudioFrame(data(c1), samples);
ret[1] = (g1.*Func)();
}
}
Expand Down Expand Up @@ -300,7 +300,7 @@ struct GistState
if(g1.getAudioFrameSize() != samples)
g1.setAudioFrameSize(samples);

g1.processAudioFrame(data(c0), samples, gain, gate);
g1.processAudioFrame(data(c1), samples, gain, gate);
ret[1] = (g1.*Func)();
}
}
Expand Down
10 changes: 6 additions & 4 deletions src/plugins/score-plugin-curve/Curve/Segment/EasingSegment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ class EasingSegment final : public ::Curve::SegmentModel

double valueAt(double x) const override
{
return start().y()
+ (end().y() - start().y()) * (Easing_T{}(x)-start().x())
/ (end().x() - start().x());
// Evaluate the easing on the segment-local [0,1] ratio (matches updateData()
// + the ossia execution engine); applying Easing_T to the global x was only
// correct for a segment spanning [0,1].
const double ratio = (x - start().x()) / (end().x() - start().x());
return start().y() + (end().y() - start().y()) * Easing_T{}(ratio);
}

std::optional<double> verticalParameter() const override { return {}; }
Expand Down Expand Up @@ -160,7 +162,7 @@ inline void JSONWriter::write(Curve::EasingData& segmt)
{
}

SCORE_SERIALIZE_DATASTREAM_DECLARE(, Curve::EasingData)
SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_PLUGIN_CURVE_EXPORT, Curve::EasingData)
Q_DECLARE_METATYPE(Curve::EasingData)
W_REGISTER_ARGTYPE(Curve::EasingData)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,14 @@ double PowerSegment::valueAt(double x) const
}
else
{
return start().y()
+ (end().y() - start().y()) * (std::pow(x, gamma) - start().x())
/ (end().x() - start().x());
// Normalise x to the segment-local [0,1] ratio BEFORE applying the power,
// so the model sampling matches updateData() and the ossia execution engine
// (curve_segment_power evaluates pow(local_ratio, gamma)). The previous
// pow(x, gamma) on the global x was only correct for a segment spanning
// [0,1]; for any later segment of a multi-segment curve it disagreed with
// playback (visible via Automation/Tempo state-value queries).
const double ratio = (x - start().x()) / (end().x() - start().x());
return start().y() + (end().y() - start().y()) * std::pow(ratio, gamma);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ SCORE_PLUGIN_CURVE_EXPORT
Curve::SegmentData flatCurveSegment(double val, double min, double max);
}

SCORE_SERIALIZE_DATASTREAM_DECLARE(, Curve::PowerSegmentData)
SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_PLUGIN_CURVE_EXPORT, Curve::PowerSegmentData)
Q_DECLARE_METATYPE(Curve::PowerSegmentData)
W_REGISTER_ARGTYPE(Curve::PowerSegmentData)
5 changes: 3 additions & 2 deletions src/plugins/score-plugin-fx/Fx/Envelope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ struct Node
max = std::max(max, std::abs(sample));
rms += sample * sample;
}
rms = std::sqrt(rms);
rms /= chan.size();
// RMS = sqrt(mean(x^2)) = sqrt(sum / N). The previous sqrt(sum)/N was a
// factor of sqrt(N) too small.
rms = std::sqrt(rms / chan.size());

return std::make_pair(rms, max);
}
Expand Down
7 changes: 6 additions & 1 deletion src/plugins/score-plugin-fx/Fx/MathAudioFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ struct Node
{
channels[j][i] = self.cur_out[j];
}
std::swap(self.cur_in, self.prev_in);
// Copy (don't swap) so the exprtk "x"/"px" vector_views, bound once to
// cur_in/prev_in's heap buffers, keep pointing at the right buffers.
// std::swap exchanged the buffers underneath the views, so on every odd
// sample "x" read the previous input and "px" the current one. Matches
// the sibling MathMapping_generic (px = x). Sizes are equal -> no alloc.
self.prev_in = self.cur_in;
}
self.pa = self.a;
self.pb = self.b;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class LoadPresetWithCablesBackup final : public score::Command

auto cables = Dataflow::reloadPortsInNewProcess(
m_oldInlets, m_oldOutlets, m_oldCables, cmt,
Process::PortLoadDataFlags::DontReloadValue, ctx);
Process::PortLoadDataFlags::ReloadValue, ctx);

cmt.inletsChanged();
cmt.outletsChanged();
Expand Down
Loading
Loading