From 8455284f124cf4d3807afd6d157cd6c9eb56b0f8 Mon Sep 17 00:00:00 2001 From: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Date: Wed, 25 Feb 2026 22:36:45 -0600 Subject: [PATCH] Updated SignalSmith to SoundSmith --- .../{SignalSmith.xml => SoundSmith.xml} | 8 ++-- modules/{signalsmith => soundsmith}/SCsub | 14 +++--- modules/{signalsmith => soundsmith}/config.py | 0 .../register_types.cpp | 8 ++-- .../register_types.h | 4 +- .../soundsmith_module.cpp} | 46 +++++++++---------- .../soundsmith_module.h} | 10 ++-- 7 files changed, 45 insertions(+), 45 deletions(-) rename doc/classes/{SignalSmith.xml => SoundSmith.xml} (87%) rename modules/{signalsmith => soundsmith}/SCsub (65%) rename modules/{signalsmith => soundsmith}/config.py (100%) rename modules/{signalsmith => soundsmith}/register_types.cpp (92%) rename modules/{signalsmith => soundsmith}/register_types.h (94%) rename modules/{signalsmith/signalsmith_module.cpp => soundsmith/soundsmith_module.cpp} (83%) rename modules/{signalsmith/signalsmith_module.h => soundsmith/soundsmith_module.h} (94%) diff --git a/doc/classes/SignalSmith.xml b/doc/classes/SoundSmith.xml similarity index 87% rename from doc/classes/SignalSmith.xml rename to doc/classes/SoundSmith.xml index 61c46d7f47f..2bb7edae08a 100644 --- a/doc/classes/SignalSmith.xml +++ b/doc/classes/SoundSmith.xml @@ -1,10 +1,10 @@ - + - Performs time-stretching and pitch-shifting on raw audio buffers using Signalsmith. + Performs time-stretching and pitch-shifting on raw audio buffers using Soundsmith. - SignalSmith is a low-level audio processing utility which wraps the Signalsmith time-stretching library. It operates on raw interleaved floating-point PCM audio buffers and allows independent control of playback tempo and pitch. + SoundSmith is a low-level audio processing utility which wraps the Soundsmith time-stretching library. It operates on raw interleaved floating-point PCM audio buffers and allows independent control of playback tempo and pitch. @@ -15,7 +15,7 @@ - Loads an MP3 file, applies time-stretching and pitch-shifting using the Signalsmith engine, and returns a streamable AudioStreamWAV. + Loads an MP3 file, applies time-stretching and pitch-shifting using the Soundsmith engine, and returns a streamable AudioStreamWAV. The `tempo` parameter controls playback speed without affecting pitch. A value of `1.0` preserves the original speed. The `pitch` parameter is a transpose factor. A value of `1.0` preserves pitch, `2.0` raises pitch by one octave, and `0.5` lowers pitch by one octave. diff --git a/modules/signalsmith/SCsub b/modules/soundsmith/SCsub similarity index 65% rename from modules/signalsmith/SCsub rename to modules/soundsmith/SCsub index e28965f4204..067735a84f4 100644 --- a/modules/signalsmith/SCsub +++ b/modules/soundsmith/SCsub @@ -3,9 +3,9 @@ from misc.utility.scons_hints import * Import("env") -signalsmith_env = env.Clone() +soundsmith_env = env.Clone() -signalsmith_env.Append( +soundsmith_env.Append( CPPPATH=[ "#thirdparty", "#thirdparty/minimp3", @@ -18,12 +18,12 @@ is_gcc = ("gcc" in cxx or "g++" in cxx) and not is_clang is_msvc = ("cl" in cxx) and not is_clang if is_gcc: - signalsmith_env.Append(CCFLAGS=["-Wno-class-memaccess"]) - signalsmith_env.Append(CCFLAGS=["-Wno-shadow"]) + soundsmith_env.Append(CCFLAGS=["-Wno-class-memaccess"]) + soundsmith_env.Append(CCFLAGS=["-Wno-shadow"]) # silence "hides previous declaration/member" warnings if is_msvc: - signalsmith_env.Append( + soundsmith_env.Append( CCFLAGS=[ "/wd4456", # hides previous local declaration "/wd4458", # hides class member @@ -32,7 +32,7 @@ if is_msvc: module_sources = [ "register_types.cpp", - "signalsmith_module.cpp", + "soundsmith_module.cpp", ] -signalsmith_env.add_source_files(env.modules_sources, module_sources) +soundsmith_env.add_source_files(env.modules_sources, module_sources) diff --git a/modules/signalsmith/config.py b/modules/soundsmith/config.py similarity index 100% rename from modules/signalsmith/config.py rename to modules/soundsmith/config.py diff --git a/modules/signalsmith/register_types.cpp b/modules/soundsmith/register_types.cpp similarity index 92% rename from modules/signalsmith/register_types.cpp rename to modules/soundsmith/register_types.cpp index a28b0312572..e8f65e992d9 100644 --- a/modules/signalsmith/register_types.cpp +++ b/modules/soundsmith/register_types.cpp @@ -32,17 +32,17 @@ #include "register_types.h" #include "core/object/class_db.h" -#include "signalsmith_module.h" +#include "soundsmith_module.h" -void initialize_signalsmith_module(ModuleInitializationLevel p_level) { +void initialize_soundsmith_module(ModuleInitializationLevel p_level) { if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; } - ClassDB::register_class(); + ClassDB::register_class(); } -void uninitialize_signalsmith_module(ModuleInitializationLevel p_level) { +void uninitialize_soundsmith_module(ModuleInitializationLevel p_level) { if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; } diff --git a/modules/signalsmith/register_types.h b/modules/soundsmith/register_types.h similarity index 94% rename from modules/signalsmith/register_types.h rename to modules/soundsmith/register_types.h index 5ead1a2a912..47c68aad542 100644 --- a/modules/signalsmith/register_types.h +++ b/modules/soundsmith/register_types.h @@ -34,5 +34,5 @@ #include "modules/register_module_types.h" -void initialize_signalsmith_module(ModuleInitializationLevel p_level); -void uninitialize_signalsmith_module(ModuleInitializationLevel p_level); +void initialize_soundsmith_module(ModuleInitializationLevel p_level); +void uninitialize_soundsmith_module(ModuleInitializationLevel p_level); diff --git a/modules/signalsmith/signalsmith_module.cpp b/modules/soundsmith/soundsmith_module.cpp similarity index 83% rename from modules/signalsmith/signalsmith_module.cpp rename to modules/soundsmith/soundsmith_module.cpp index dfa8b14329b..fd49cce454e 100644 --- a/modules/signalsmith/signalsmith_module.cpp +++ b/modules/soundsmith/soundsmith_module.cpp @@ -1,5 +1,5 @@ /**************************************************************************/ -/* signalsmith_module.cpp */ +/* soundsmith_module.cpp */ /**************************************************************************/ /* This file is part of: */ /* REDOT ENGINE */ @@ -30,7 +30,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "signalsmith_module.h" +#include "soundsmith_module.h" #include "core/io/file_access.h" #include "core/os/memory.h" @@ -43,25 +43,25 @@ #include #include -void SignalSmith::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_sample_rate", "rate"), &SignalSmith::set_sample_rate); - ClassDB::bind_method(D_METHOD("set_channels", "channels"), &SignalSmith::set_channels); - ClassDB::bind_method(D_METHOD("set_pitch", "pitch"), &SignalSmith::set_pitch); - ClassDB::bind_method(D_METHOD("set_tempo", "tempo"), &SignalSmith::set_tempo); - ClassDB::bind_method(D_METHOD("get_last_sample_rate"), &SignalSmith::get_last_sample_rate); - ClassDB::bind_method(D_METHOD("get_last_channels"), &SignalSmith::get_last_channels); - ClassDB::bind_method(D_METHOD("reset"), &SignalSmith::reset); - ClassDB::bind_method(D_METHOD("process", "input"), &SignalSmith::process); - ClassDB::bind_method(D_METHOD("change_tempo", "path", "tempo", "pitch"), &SignalSmith::change_tempo, DEFVAL(1.0f)); +void SoundSmith::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_sample_rate", "rate"), &SoundSmith::set_sample_rate); + ClassDB::bind_method(D_METHOD("set_channels", "channels"), &SoundSmith::set_channels); + ClassDB::bind_method(D_METHOD("set_pitch", "pitch"), &SoundSmith::set_pitch); + ClassDB::bind_method(D_METHOD("set_tempo", "tempo"), &SoundSmith::set_tempo); + ClassDB::bind_method(D_METHOD("get_last_sample_rate"), &SoundSmith::get_last_sample_rate); + ClassDB::bind_method(D_METHOD("get_last_channels"), &SoundSmith::get_last_channels); + ClassDB::bind_method(D_METHOD("reset"), &SoundSmith::reset); + ClassDB::bind_method(D_METHOD("process", "input"), &SoundSmith::process); + ClassDB::bind_method(D_METHOD("change_tempo", "path", "tempo", "pitch"), &SoundSmith::change_tempo, DEFVAL(1.0f)); } -SignalSmith::SignalSmith() { +SoundSmith::SoundSmith() { stretch.presetDefault(channels, sample_rate); } -SignalSmith::~SignalSmith() {} +SoundSmith::~SoundSmith() {} -void SignalSmith::set_sample_rate(int p_rate) { +void SoundSmith::set_sample_rate(int p_rate) { if (p_rate < 1) { return; } @@ -70,7 +70,7 @@ void SignalSmith::set_sample_rate(int p_rate) { stretch.presetDefault(channels, sample_rate); } -void SignalSmith::set_channels(int p_channels) { +void SoundSmith::set_channels(int p_channels) { if (p_channels < 1) { return; } @@ -79,7 +79,7 @@ void SignalSmith::set_channels(int p_channels) { stretch.presetDefault(channels, sample_rate); } -void SignalSmith::set_pitch(float p_pitch) { +void SoundSmith::set_pitch(float p_pitch) { if (!(p_pitch > 0.0f)) { return; } @@ -87,7 +87,7 @@ void SignalSmith::set_pitch(float p_pitch) { stretch.setTransposeFactor(p_pitch); } -void SignalSmith::set_tempo(float p_tempo) { +void SoundSmith::set_tempo(float p_tempo) { if (!(p_tempo > 0.0f)) { return; } @@ -95,19 +95,19 @@ void SignalSmith::set_tempo(float p_tempo) { tempo = p_tempo; } -int SignalSmith::get_last_sample_rate() const { +int SoundSmith::get_last_sample_rate() const { return sample_rate; } -int SignalSmith::get_last_channels() const { +int SoundSmith::get_last_channels() const { return channels; } -void SignalSmith::reset() { +void SoundSmith::reset() { stretch.reset(); } -PackedFloat32Array SignalSmith::process(const PackedFloat32Array &input) { +PackedFloat32Array SoundSmith::process(const PackedFloat32Array &input) { PackedFloat32Array output; if (channels < 1) { @@ -189,7 +189,7 @@ PackedFloat32Array SignalSmith::process(const PackedFloat32Array &input) { return output; } -Ref SignalSmith::change_tempo(const String &path, float p_tempo, float p_pitch) { +Ref SoundSmith::change_tempo(const String &path, float p_tempo, float p_pitch) { Ref out; Ref mp3 = AudioStreamMP3::load_from_file(path); diff --git a/modules/signalsmith/signalsmith_module.h b/modules/soundsmith/soundsmith_module.h similarity index 94% rename from modules/signalsmith/signalsmith_module.h rename to modules/soundsmith/soundsmith_module.h index 1803c1f455f..091f6c60edb 100644 --- a/modules/signalsmith/signalsmith_module.h +++ b/modules/soundsmith/soundsmith_module.h @@ -1,5 +1,5 @@ /**************************************************************************/ -/* signalsmith_module.h */ +/* soundsmith_module.h */ /**************************************************************************/ /* This file is part of: */ /* REDOT ENGINE */ @@ -38,8 +38,8 @@ #include "signalsmith-stretch/signalsmith-stretch.h" #include -class SignalSmith : public RefCounted { - GDCLASS(SignalSmith, RefCounted); +class SoundSmith : public RefCounted { + GDCLASS(SoundSmith, RefCounted); private: signalsmith::stretch::SignalsmithStretch stretch; @@ -51,8 +51,8 @@ class SignalSmith : public RefCounted { static void _bind_methods(); public: - SignalSmith(); - ~SignalSmith(); + SoundSmith(); + ~SoundSmith(); void set_sample_rate(int p_rate); void set_channels(int p_channels);