Skip to content

Commit

Permalink
Integrate Superparasites Clouds Firmware (off by default) (#7436)
Browse files Browse the repository at this point in the history
This commit implements the superparasites firmware as an
option for clouds. The firmware comes from patrick dowling
at https://github.com/patrickdowling/superparasites

In this commit, the firmware is activatable at build time
but is still off by default, so the synth is unchanged
unless you opt in in libs/eurorack/CMakeLists with the option.

Closes patrickdowling/superparasites#6
Addresses #7359
  • Loading branch information
baconpaul committed Jan 13, 2024
1 parent 29bf1fe commit d73bcfd
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 6 deletions.
26 changes: 24 additions & 2 deletions libs/eurorack/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
project(eurorack VERSION 0.0.0 LANGUAGES CXX)

add_library(${PROJECT_NAME}
add_library(${PROJECT_NAME})

option(EURORACK_CLOUDS_IS_CLOUDS "Use the clouds (as opposed to superparasites) firmware for clouds" TRUE)

if (EURORACK_CLOUDS_IS_CLOUDS)
target_sources(${PROJECT_NAME} PRIVATE
eurorack/clouds/dsp/correlator.cc
eurorack/clouds/dsp/granular_processor.cc
eurorack/clouds/dsp/mu_law.cc
eurorack/clouds/dsp/pvoc/frame_transformation.cc
eurorack/clouds/dsp/pvoc/phase_vocoder.cc
eurorack/clouds/dsp/pvoc/stft.cc
eurorack/clouds/resources.cc
eurorack/clouds/resources.cc)
target_compile_definitions(${PROJECT_NAME} PUBLIC EURORACK_CLOUDS_IS_CLOUDS=1)
else()
target_sources(${PROJECT_NAME} PRIVATE
eurorack/supercell/resources.cc
eurorack/supercell/dsp/kammerl_player.cc
eurorack/supercell/dsp/pvoc/stft.cc
eurorack/supercell/dsp/pvoc/spectral_clouds_transformation.cc
eurorack/supercell/dsp/pvoc/phase_vocoder.cc
eurorack/supercell/dsp/pvoc/frame_transformation.cc
eurorack/supercell/dsp/granular_processor.cc
eurorack/supercell/dsp/mu_law.cc
eurorack/supercell/dsp/correlator.cc
)
target_compile_definitions(${PROJECT_NAME} PUBLIC EURORACK_CLOUDS_IS_SUPERPARASITES=1)
endif()


target_sources(${PROJECT_NAME} PRIVATE
eurorack/plaits/dsp/voice.cc
eurorack/plaits/dsp/speech/lpc_speech_synth_phonemes.cc
eurorack/plaits/dsp/speech/lpc_speech_synth_controller.cc
Expand Down
2 changes: 1 addition & 1 deletion libs/eurorack/eurorack
Submodule eurorack updated 77 files
+11 −0 README.md
+0 −0 supercell/__init__.py
+0 −0 supercell/bootloader/__init__.py
+311 −0 supercell/bootloader/bootloader.cc
+47 −0 supercell/bootloader/makefile
+238 −0 supercell/cv_scaler.cc
+128 −0 supercell/cv_scaler.h
+148 −0 supercell/drivers/adc.cc
+74 −0 supercell/drivers/adc.h
+582 −0 supercell/drivers/codec.cc
+102 −0 supercell/drivers/codec.h
+94 −0 supercell/drivers/dac.cc
+41 −0 supercell/drivers/dac.h
+76 −0 supercell/drivers/debug_pin.h
+64 −0 supercell/drivers/debug_port.cc
+68 −0 supercell/drivers/debug_port.h
+64 −0 supercell/drivers/gate_input.cc
+72 −0 supercell/drivers/gate_input.h
+230 −0 supercell/drivers/leds.cc
+234 −0 supercell/drivers/leds.h
+167 −0 supercell/drivers/pots_adc.cc
+78 −0 supercell/drivers/pots_adc.h
+79 −0 supercell/drivers/switches.cc
+76 −0 supercell/drivers/switches.h
+43 −0 supercell/drivers/system.cc
+52 −0 supercell/drivers/system.h
+63 −0 supercell/drivers/version.h
+300 −0 supercell/dsp/audio_buffer.h
+88 −0 supercell/dsp/correlator.cc
+88 −0 supercell/dsp/correlator.h
+44 −0 supercell/dsp/frame.h
+112 −0 supercell/dsp/fx/diffuser.h
+356 −0 supercell/dsp/fx/fx_engine.h
+264 −0 supercell/dsp/fx/oliverb.h
+132 −0 supercell/dsp/fx/pitch_shifter.h
+180 −0 supercell/dsp/fx/reverb.h
+211 −0 supercell/dsp/grain.h
+752 −0 supercell/dsp/granular_processor.cc
+257 −0 supercell/dsp/granular_processor.h
+258 −0 supercell/dsp/granular_sample_player.h
+46 −0 supercell/dsp/kammerl_player.cc
+409 −0 supercell/dsp/kammerl_player.h
+237 −0 supercell/dsp/looping_sample_player.h
+69 −0 supercell/dsp/mu_law.cc
+83 −0 supercell/dsp/mu_law.h
+80 −0 supercell/dsp/parameters.h
+363 −0 supercell/dsp/pvoc/frame_transformation.cc
+110 −0 supercell/dsp/pvoc/frame_transformation.h
+54 −0 supercell/dsp/pvoc/modifier.h
+141 −0 supercell/dsp/pvoc/phase_vocoder.cc
+86 −0 supercell/dsp/pvoc/phase_vocoder.h
+197 −0 supercell/dsp/pvoc/spectral_clouds_transformation.cc
+94 −0 supercell/dsp/pvoc/spectral_clouds_transformation.h
+217 −0 supercell/dsp/pvoc/stft.cc
+117 −0 supercell/dsp/pvoc/stft.h
+82 −0 supercell/dsp/random_oscillator.h
+394 −0 supercell/dsp/resonestor.h
+96 −0 supercell/dsp/sample_rate_converter.h
+125 −0 supercell/dsp/window.h
+323 −0 supercell/dsp/wsola_sample_player.h
+103 −0 supercell/linker_scripts/stm32f427x_flash.ld
+112 −0 supercell/linker_scripts/stm32f427x_flash_application_large.ld
+75 −0 supercell/makefile
+84 −0 supercell/meter.h
+3,361 −0 supercell/resources.cc
+102 −0 supercell/resources.h
+0 −0 supercell/resources/__init__.py
+176 −0 supercell/resources/lookup_tables.py
+82 −0 supercell/resources/resources.py
+83 −0 supercell/resources/src_filters.py
+91 −0 supercell/settings.cc
+112 −0 supercell/settings.h
+148 −0 supercell/supercell.cc
+161 −0 supercell/test/clouds_test.cc
+44 −0 supercell/test/makefile
+510 −0 supercell/ui.cc
+151 −0 supercell/ui.h
23 changes: 22 additions & 1 deletion src/common/Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,11 @@ void Parameter::set_type(int ctrltype)
case ct_nimbusmode:
valtype = vt_int;
val_min.i = 0;
val_max.i = 3; // sin, tri, saw, s&h
#if EURORACK_CLOUDS_IS_SUPERPARASITES
val_max.i = 7;
#else
val_max.i = 3;
#endif
val_default.i = 0;
break;

Expand Down Expand Up @@ -4050,6 +4054,23 @@ std::string Parameter::get_display(bool external, float ef) const
case 3:
txt = "Spectral Madness";
break;
#if EURORACK_CLOUDS_IS_SUPERPARASITES
case 4:
txt = "Oliverb";
break;
case 5:
txt = "Reonestor";
break;
case 6:
txt = "Kammerl";
break;
case 7:
txt = "Spectral Cloud";
break;
#endif
default:
txt = "Unknown Model";
break;
}
}
break;
Expand Down
22 changes: 20 additions & 2 deletions src/common/dsp/effects/NimbusEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
#endif

#define TEST // remember this is how you tell the eurorack code to use dsp not hardware
#if EURORACK_CLOUDS_IS_SUPERPARASITES
#include "supercell/dsp/granular_processor.h"
#else
#include "clouds/dsp/granular_processor.h"
#endif

NimbusEffect::NimbusEffect(SurgeStorage *storage, FxStorage *fxdata, pdata *pd)
: Effect(storage, fxdata, pd)
Expand All @@ -40,7 +44,10 @@ NimbusEffect::NimbusEffect(SurgeStorage *storage, FxStorage *fxdata, pdata *pd)
block_mem = new uint8_t[memLen]();
block_ccm = new uint8_t[ccmLen]();
processor = new clouds::GranularProcessor();
#if EURORACK_CLOUDS_IS_SUPERPARASITES
#else
memset(processor, 0, sizeof(*processor));
#endif

processor->Init(block_mem, memLen, block_ccm, ccmLen);
mix.set_blocksize(BLOCK_SIZE);
Expand Down Expand Up @@ -122,8 +129,15 @@ void NimbusEffect::process(float *dataL, float *dataR)
int frames_to_go = sdata.output_frames_gen;
int outpos = 0;

auto modeInt = *pd_int[nmb_mode];
// Just make sure we are safe if we swap between superparasites and not
#if EURORACK_CLOUDS_IS_SUPERPARASITES
modeInt = std::clamp(modeInt, 0, 7);
#else
modeInt = std::clamp(modeInt, 0, 3);
#endif
processor->set_playback_mode(
(clouds::PlaybackMode)((int)clouds::PLAYBACK_MODE_GRANULAR + *pd_int[nmb_mode]));
(clouds::PlaybackMode)((int)clouds::PLAYBACK_MODE_GRANULAR + modeInt));
processor->set_quality(*pd_int[nmb_quality]);

int consume_ptr = 0;
Expand Down Expand Up @@ -165,8 +179,12 @@ void NimbusEffect::process(float *dataL, float *dataR)
parm->reverb = clamp01(*pd_float[nmb_reverb]);
parm->dry_wet = 1.f;

#if EURORACK_CLOUDS_IS_SUPERPARASITES
parm->capture = nimbusTrigger;
#else
parm->trigger = nimbusTrigger; // this is an external granulating source. Skip it
parm->gate = parm->freeze; // This is the CV for the freeze button
#endif
parm->gate = parm->freeze; // This is the CV for the freeze button

processor->Prepare();
processor->Process(input, output, inputSz);
Expand Down
9 changes: 9 additions & 0 deletions src/surge-xt/gui/overlays/AboutScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,15 @@ void AboutScreen::resized()

yp += lblvs;

#if EURORACK_CLOUDS_IS_SUPERPARASITES
addLabel("Nimbus includes the the integrated superparasites firmware by Patrick Dowling, "
"including"
" mqtthiqs/Parasites and jkammerl/Beat Repeat modes.",
600);

yp += lblvs;
#endif

addLabel("Oscilloscope code based on s(m)exoscope by Bram @ Smartelectronix, licensed "
"under GNU GPL v3 license",
600);
Expand Down

0 comments on commit d73bcfd

Please sign in to comment.