Skip to content

Commit 39e8cd7

Browse files
Merge branch 'even-more-small-stuff-again'
2 parents 3dc6c7d + f299766 commit 39e8cd7

File tree

45 files changed

+158
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+158
-130
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ Extract the zipped folder and copy/replace it (the entire folder, not just the .
7171
- Linux: ~/.vst3 or ~/.clap
7272

7373
# System requirements and supported environments
74+
- Windows: 64-bit (X64) cpu with AVX support. Tested on Windows 11. Needs Windows 10+.
7475
- Mac: 64-bit (X64) cpu for Intel-based Macs. 64-bit ARM cpu for Apple Silicon. Universal binaries are provided. Tested on MacOS 14, minimum required is 10.15.
7576
- Linux: 64-bit (X64) cpu. Provided binaries do not require AVX support, but you might want to build with march=native for better performance. Tested on Ubuntu 22, minimum required is 18. Needs glibc 2.25+. Known to work on Fedora and Mint, too.
76-
- Windows: 64-bit (X64) cpu with AVX support. Tested on Windows 11. Windows 7+ should work but you might need this:<br/>[https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170).
7777
- Explicitly supported hosts: Reaper, Bitwig, FLStudio, Waveform 13+. Please use a recent version.
7878
- Explicitly NOT supported hosts:<br/>Renoise (bug), Cakewalk (probably same as this: https://forum.renoise.com/t/possible-probable-bug-w-r-t-vst3-parameter-flushing/70684/9).
7979
- All other hosts, you'll just have to try and see.

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
### November 12, 2024 - V1.9.9.
2+
3+
- Fix a couple compiler warnings.
4+
- Update all dependencies to latest.
5+
- Update all supported hosts (for testing) to latest.
6+
- Add new host test file for FLStudio + CLAP, seems OK now.
7+
- Breaking change: since JUCE 8 is minimum Windows 10, now so is Firefly!
8+
- Replace homebrew fft with juce version, should speed up filter graph rendering a bit.
9+
110
### November 7, 2024 - V1.9.8.
211

312
- Global LFO now reacts to phase adjustment when in snap-to-host-time mode.
Binary file not shown.

lib/JUCE

Submodule JUCE updated 2786 files

lib/vst3/public.sdk

Submodule public.sdk updated 174 files

macos/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
<key>CFBundleSignature</key>
2121
<string>????</string>
2222
<key>CFBundleShortVersionString</key>
23-
<string>1.9.8</string>
23+
<string>1.9.9</string>
2424
<key>CFBundleVersion</key>
25-
<string>1.9.8</string>
25+
<string>1.9.9</string>
2626
<key>NSHumanReadableCopyright</key>
2727
<string></string>
2828
<key>NSHighResolutionCapable</key>

param_reference.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<html>
22
<head>
3-
<title>Firefly Synth 1.9.8</title>
3+
<title>Firefly Synth 1.9.9</title>
44
<style>th, td { padding: 3px; }a, a:visited { color: #666666; }.description { background:#EEEEEE; }h1 { font-size: 19px; color: black; }h2 { font-size: 17px; color: black; }h3 { font-size: 15px; color: black; }body { font-family: Verdana; color: black; }html { position: relative; max-width: 1024px; margin: auto; }tr td { width: auto; white-space: nowrap; } tr th { width: auto; white-space: nowrap; }table, th, td { font-size: 13px; border: 1px solid gray; border-collapse: collapse; text-align: left; }tr td:last-child { width: 100%; white-space: wrap; } tr th:last-child { width: 100%; white-space: wrap; }</style>
55
</head>
66
<body>
7-
<h1>Firefly Synth 1.9.8</h1>
7+
<h1>Firefly Synth 1.9.9</h1>
88
<h2>Module Overview</h2>
99
<table>
1010
<tr>

plugin_base/cmake/plugin_base.juce.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
add_definitions(-DJUCE_USE_CURL=0)
2-
add_definitions(-DJUCE_DISPLAY_SPLASH_SCREEN=0)
32
add_definitions(-DJUCE_MODAL_LOOPS_PERMITTED=0)
43

54
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")

plugin_base/src/plugin_base.clap/plugin_base.clap/pb_plugin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ pb_plugin::guiSetParent(clap_window const* window) noexcept
227227
{
228228
PB_LOG_FUNC_ENTRY_EXIT();
229229
_gui->addToDesktop(0, window->ptr);
230+
_gui->getPeer()->setCurrentRenderingEngine(0);
230231
#if (defined __linux__) || (defined __FreeBSD__)
231232
for (int fd : LinuxEventLoopInternal::getRegisteredFds())
232233
_host.posixFdSupportRegister(fd, CLAP_POSIX_FD_READ);

plugin_base/src/plugin_base.vst3/plugin_base.vst3/pb_editor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ pb_editor::attached(void* parent, FIDString type)
107107
loop->registerEventHandler(this, fd);
108108
#endif
109109
_gui->addToDesktop(0, parent);
110+
_gui->getPeer()->setCurrentRenderingEngine(0);
110111
_gui->setVisible(true);
111112
_gui->add_param_listener(_controller);
112113
_gui->reloaded();

plugin_base/src/plugin_base.vst3/plugin_base.vst3/utility.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ load_ibstream(IBStream* stream)
2424
return data;
2525
}
2626

27-
extern char const* modulation_output_count_param_guid = "{0ED52D09-8FD0-4A4A-8D71-BEDED941ADAF}";
27+
char const* modulation_output_count_param_guid = "{0ED52D09-8FD0-4A4A-8D71-BEDED941ADAF}";
2828
char const* modulation_output_param_guids[modulation_output_param_count] = {
2929
"{00F56C57-6B95-4117-8DA1-D011CC0CC042}",
3030
"{2F254575-DBDC-4916-9E37-58B59A606DBD}",

plugin_base/src/plugin_base/plugin_base/dsp/graph_engine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class graph_engine {
3838
std::map<int, std::map<int, std::unique_ptr<module_engine>>> _activated = {};
3939

4040
public:
41-
~graph_engine() { _engine.deactivate(); }
41+
virtual ~graph_engine() { _engine.deactivate(); }
4242
graph_engine(plugin_desc const* desc, graph_engine_params const& params);
4343

4444
void process_end();

plugin_base/src/plugin_base/plugin_base/dsp/utility.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fast_rand_seed(int seed)
170170
inline float
171171
fast_rand_next(std::uint32_t& state)
172172
{
173-
float const max_int = static_cast<float>(std::numeric_limits<std::int32_t>::max());
173+
float constexpr max_int = static_cast<float>(std::numeric_limits<std::int32_t>::max());
174174
state = static_cast<std::uint64_t>(state) * 48271 % 0x7fffffff;
175175
return static_cast<float>(state) / max_int;
176176
}
@@ -198,7 +198,7 @@ check_bipolar(double val)
198198
if (-1 <= val && val <= 1) return val;
199199
assert(-1 <= val && val <= 1);
200200
return val;
201-
#endif;
201+
#endif
202202
}
203203

204204
inline float
@@ -224,7 +224,7 @@ check_bipolar(float val)
224224
if (-1 - 1e-5 <= val && val <= 1 + 1e-5) return val;
225225
assert(-1 - 1e-5 <= val && val <= 1 + 1e-5);
226226
return val;
227-
#endif;
227+
#endif
228228
}
229229

230230
inline float mix_signal(float mix, float dry, float wet)

plugin_base/src/plugin_base/plugin_base/gui/controls.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ _bold(bold), _tabular(tabular), _font_height(height)
296296
if(bold) label_font = label_font.boldened();
297297
if(height != -1) label_font = label_font.withHeight(height);
298298
float th = label_font.getHeight();
299+
#pragma warning(suppress : 4996) // TODO once it gets better
299300
float tw = label_font.getStringWidthFloat(reference_text);
300301
float nw = std::ceil(tw) + getBorderSize().getLeftAndRight();
301302
setSize(nw, std::ceil(th) + getBorderSize().getTopAndBottom());
@@ -311,6 +312,7 @@ autofit_combobox::max_text_width(PopupMenu const& menu)
311312
while(iter.next())
312313
{
313314
auto text = iter.getItem().text;
315+
#pragma warning(suppress : 4996) // TODO once it gets better
314316
auto text_width = font.getStringWidthFloat(text);
315317
if(iter.getItem().subMenu)
316318
result = std::max(result, max_text_width(*iter.getItem().subMenu));
@@ -325,7 +327,7 @@ autofit_combobox::autofit()
325327
{
326328
if(!_autofit) return;
327329

328-
int const hpadding = 19;
330+
int const hpadding = 20;
329331
auto const& font = _lnf->getComboBoxFont(*this);
330332
float text_height = font.getHeight();
331333
float max_width = max_text_width(*getRootMenu());
@@ -437,7 +439,8 @@ static std::string
437439
get_longest_module_name(plugin_gui* gui)
438440
{
439441
float w = 0;
440-
juce::Font font;
442+
FontOptions options;
443+
Font font(options);
441444
std::string result;
442445
std::string full_name;
443446
std::string display_name;
@@ -447,7 +450,8 @@ get_longest_module_name(plugin_gui* gui)
447450
if(desc.modules[i].module->gui.visible)
448451
{
449452
get_module_output_label_names(desc.modules[i], full_name, display_name);
450-
float name_w = font.getStringWidth(display_name);
453+
#pragma warning(suppress : 4996) // TODO once it gets better
454+
float name_w = font.getStringWidthFloat(display_name);
451455
if (name_w > w)
452456
{
453457
w = name_w;

plugin_base/src/plugin_base/plugin_base/gui/controls.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public juce::Component
155155
param_desc const* const _param;
156156

157157
protected:
158-
void enablementChanged() { repaint(); }
158+
void enablementChanged() override { repaint(); }
159159

160160
public:
161161
void paint(juce::Graphics& g) override;

plugin_base/src/plugin_base/plugin_base/gui/gui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ justification_type(gui_label const& label)
116116

117117
static int
118118
module_header_height(int font_height)
119-
{ return font_height + 6; }
119+
{ return font_height + 7; }
120120

121121
std::vector<list_item>
122122
gui_visuals_items()

plugin_base/src/plugin_base/plugin_base/gui/gui.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public juce::MouseListener
8181
{
8282
plugin_gui* const _gui;
8383
public:
84-
void mouseUp(juce::MouseEvent const& event);
85-
gui_undo_listener(plugin_gui* gui): _gui(gui) {}
84+
gui_undo_listener(plugin_gui* gui) : _gui(gui) {}
85+
void mouseUp(juce::MouseEvent const& event) override;
8686
};
8787

8888
// triggers clear/copy/swap/etc
@@ -97,7 +97,7 @@ public juce::MouseListener
9797
juce::TabBarButton* _button;
9898

9999
public:
100-
void mouseUp(juce::MouseEvent const& event);
100+
void mouseUp(juce::MouseEvent const& event) override;
101101
~gui_tab_menu_listener() { _button->removeMouseListener(this); }
102102
gui_tab_menu_listener(plugin_gui* gui, plugin_state* state, lnf* lnf, juce::TabBarButton* button, int module, int slot):
103103
_gui(gui), _lnf(lnf), _state(state), _button(button), _module(module), _slot(slot) { _button->addMouseListener(this, true); }

plugin_base/src/plugin_base/plugin_base/gui/lnf.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ get_combobox_mod_target_indicator_width(ComboBox const& box, Font const& font)
2525
if (param_cb == nullptr) return 0;
2626
auto drop_action = param_cb->get_drop_target_action();
2727
if (drop_action == drop_target_action::none) return 0;
28+
#pragma warning(suppress : 4996) // TODO once it gets better
2829
return font.getStringWidth("[N/A]") + 2;
2930
}
3031

@@ -250,7 +251,7 @@ lnf::init_theme(std::filesystem::path const& theme_folder, var const& json)
250251
}
251252
}
252253
}
253-
254+
254255
assert(json.hasProperty("global_settings"));
255256
var global_settings = json["global_settings"];
256257
if (global_settings.hasProperty("lighten"))
@@ -333,9 +334,9 @@ Font
333334
lnf::font() const
334335
{
335336
// Handle the case for missing resources.
336-
Font result;
337+
Font result(FontOptions(_global_settings.get_font_height()));
337338
if(_typeface.get())
338-
result = Font(_typeface);
339+
result = Font(FontOptions(_typeface));
339340
result.setHeight(_global_settings.get_font_height());
340341
result.setStyleFlags(_desc->plugin->gui.font_flags);
341342
return result;
@@ -406,6 +407,7 @@ lnf::getTabButtonBestWidth(TabBarButton& b, int)
406407
float bar_width = b.getTabbedButtonBar().getWidth();
407408
int tab_count = b.getTabbedButtonBar().getNumTabs();
408409
if(!auto_size) return bar_width / tab_count;
410+
#pragma warning(suppress : 4996) // TODO once it gets better
409411
return font().getStringWidth(b.getButtonText()) + _global_settings.section_radius + 10;
410412
}
411413
auto full_name = _desc->plugin->modules[_module].info.tag.full_name;
@@ -446,7 +448,7 @@ lnf::drawTooltip(Graphics& g, String const& text, int w, int h)
446448
g.fillRect(bounds.toFloat());
447449
g.setColour(colors().bubble_outline);
448450
g.drawRect(bounds.toFloat().reduced(0.5f, 0.5f), 1.0f);
449-
auto layout = detail::LookAndFeelHelpers::layoutTooltipText(text, findColour(TooltipWindow::textColourId));
451+
auto layout = detail::LookAndFeelHelpers::layoutTooltipText(TypefaceMetricsKind::portable, text, findColour(TooltipWindow::textColourId));
450452
layout.draw(g, Rectangle<float>(w, h));
451453
}
452454

@@ -909,15 +911,15 @@ lnf::drawLinearSlider(Graphics& g, int x, int y, int w, int h, float p, float, f
909911
assert(style == Slider::SliderStyle::LinearHorizontal);
910912

911913
// output meter
912-
auto const& param_topo = *ps->param()->param;
913-
if (ps && ps->param()->param->gui.edit_type == gui_edit_type::output_meter)
914+
auto const* param_topo = ps? ps->param()->param: nullptr;
915+
if (param_topo && param_topo->gui.edit_type == gui_edit_type::output_meter)
914916
{
915917
int block_pad = 2;
916918
int block_count = 20;
917919
float block_width_base = width / block_count;
918920
float actual_block_width = (int)(block_width_base - block_pad);
919921
float actual_cell_width = actual_block_width + block_pad;
920-
float pos_adjust = pos * (param_topo.domain.max - param_topo.domain.min);
922+
float pos_adjust = pos * (param_topo->domain.max - param_topo->domain.min);
921923
int block_count_off = block_count * std::clamp(pos_adjust, 0.0f, 1.0f);
922924

923925
g.setColour(colors().param_meter1);

plugin_base/src/plugin_base/plugin_base/gui/lnf.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public juce::LookAndFeel_V4 {
4141
gui_colors section_gui_colors(std::string const& section_full_name);
4242

4343
plugin_topo_gui_theme_settings const& global_settings() const { return _global_settings; }
44-
int combo_height(bool tabular) const { return _global_settings.get_font_height() + (tabular ? 10 : 6); }
45-
int toggle_height(bool tabular) const { return _global_settings.get_font_height() + (tabular ? 8 : 4); }
44+
int combo_height(bool tabular) const { return _global_settings.get_font_height() + (tabular ? 11 : 7); }
45+
int toggle_height(bool tabular) const { return _global_settings.get_font_height() + (tabular ? 9 : 5); }
4646

4747
int getDefaultScrollbarWidth() override { return 8; }
4848
bool areScrollbarButtonsVisible() override { return true; }

plugin_base/src/plugin_base/plugin_base/gui/utility.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ make_drag_source_image(Font const& font, std::string const& text, Colour border_
3838
float margin_w = 8.0f;
3939
float margin_h = 4.0f;
4040
float text_h = font.getHeight();
41+
#pragma warning(suppress : 4996) // TODO once it gets better
4142
float text_w = font.getStringWidthFloat(String(text));
4243

4344
Image image(Image::PixelFormat::ARGB, text_w + margin_w + extra_left, text_h + margin_h + extra_top, true);

plugin_base/src/plugin_base/plugin_base/shared/utility.cpp

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,6 @@ using namespace juce;
1111

1212
namespace plugin_base {
1313

14-
// https://rosettacode.org/wiki/Fast_Fourier_transform#C.2B.2B
15-
static void
16-
fft(std::complex<float>* inout, std::complex<float>* scratch, int count)
17-
{
18-
if (count < 2) return;
19-
assert(count == next_pow2(count));
20-
std::complex<float>* even = scratch;
21-
std::complex<float>* odd = scratch + count / 2;
22-
for (std::size_t i = 0; i < count / 2; i++) even[i] = inout[i * 2];
23-
for (std::size_t i = 0; i < count / 2; i++) odd[i] = inout[i * 2 + 1];
24-
fft(odd, inout, count / 2);
25-
fft(even, inout, count / 2);
26-
for (std::size_t i = 0; i < count / 2; i++)
27-
{
28-
float im = -2.0f * pi32 * i / count;
29-
std::complex<float> t = std::polar(1.0f, im) * odd[i];
30-
inout[i] = even[i] + t;
31-
inout[i + count / 2] = even[i] - t;
32-
}
33-
}
34-
3514
double
3615
seconds_since_epoch()
3716
{
@@ -60,27 +39,32 @@ file_load(std::filesystem::path const& path)
6039
return data;
6140
}
6241

63-
std::vector<float>
64-
fft(std::vector<float> const& in)
42+
cached_fft::
43+
cached_fft(int in_samples):
44+
_in_samples(in_samples),
45+
_output(next_pow2(in_samples) * 2, 0.0f),
46+
_juce_fft(std::log2(next_pow2(in_samples)))
47+
{ assert(in_samples > 1); }
48+
49+
std::vector<float> const&
50+
cached_fft::perform(std::vector<float> const& in)
6551
{
66-
std::size_t pow2 = next_pow2(in.size());
67-
std::vector<std::complex<float>> inout(pow2, std::complex<float>());
68-
std::vector<std::complex<float>> scratch(pow2, std::complex<float>());
69-
for (std::size_t i = 0; i < in.size(); i++)
70-
inout[i] = std::complex<float>(in[i], 0.0f);
71-
fft(inout.data(), scratch.data(), pow2);
52+
_output.clear();
53+
int np2 = next_pow2(_in_samples);
54+
assert(in.size() == _in_samples);
55+
_output.resize(np2 * 2);
56+
std::copy(in.begin(), in.end(), _output.begin());
57+
_juce_fft.performRealOnlyForwardTransform(_output.data(), true);
58+
_output.erase(_output.begin() + np2 / 2, _output.end());
7259

73-
// drop above nyquist
74-
inout.erase(inout.begin() + pow2 / 2, inout.end());
75-
76-
// scale to 0..1
77-
std::vector<float> result;
60+
// scale to 0..1, real part is in even indices, drop imag parts
7861
float max = std::numeric_limits<float>::min();
79-
for (int i = 0; i < inout.size(); i++)
80-
max = std::max(max, std::abs(inout[i].real()));
81-
for (int i = 0; i < inout.size(); i++)
82-
result.push_back(max == 0.0f? 0.0f: std::abs(inout[i].real()) / max);
83-
return result;
62+
for (int i = 0; i < _output.size(); i += 2)
63+
max = std::max(max, std::abs(_output[i]));
64+
for (int i = 0; i < _output.size() / 2; i++)
65+
_output[i] = max == 0.0f ? 0.0f : std::abs(_output[i * 2]) / max;
66+
_output.erase(_output.begin() + np2 / 4, _output.end());
67+
return _output;
8468
}
8569

8670
std::vector<float>

0 commit comments

Comments
 (0)