Cannot get any oscilloscope to show

Hey Daniel,

Running into a another issue, I’ve pretty much copied all code you have done in foleysynth wrt oscilloscope display into my code. Still, the UI stills indicates I don’t have any plot source to select from, would you help ? some snippets here:

in PluginProcessor:h
foleys::MagicPlotSource* LFO1Display = nullptr;

In my PluginProcessor constructor:
LFO1Display = magicState.createAndAddObjectfoleys::MagicOscilloscope(“LFO1_Display”);
jassert (LFO1Display != nullptr);

In my preparetoPlay():
LFO1Display->prepareToPlay(sampleRate, samplesPerBlock);

And in my processBlock()
LFO1Display->pushSamples (buffer);

I must be missing something but I can’t figure out what ? I have put nothing in the createLayout() but you didn’t either in your code so I suspect it’s useless.

Sorry if some of my issues might be JUCE related and not specific to PGM.

Lorenzo

I spent the whole day thinking in the background what could have happened…

One idea: did you by chance declare your own magicState instance in your AudioProcessor?

Since the introduction of foleys::MagicProcessor it comes with it’s own instance of

MagicProcessorState magicState;

If you have your own magicState declared in your sub class, it will shadow the protected magicState from the super class, and the MagicProcessorEditor will not see your oscilloscope, and the other issue that editing classes has no effect could also be related.

Can you please verify that you didn’t add your own MagicProcessorState?

1 Like

Yeah, totally this ! I don’t know why I had that "foleys::MagicProcessorState magicState { *this }; " in my class definition, I must have copied that from somewhere (an old demo or project in your repo ?)

Anyway, thanks, proceeding until next issue :wink:

That was necessary before the introduction of MagicProcessor.
If you updated the module but not the examples repository you would see this and most likely copy it.

Glad it works now.

Additional question on plot, I’m using it to display an LFO, but would like to slow it down, been trying to play with the preparetoplay method of the scope but I cannot seem to find the proper arguments, I’m willing to “average” the plot (for example one output value showing 10 samples instead of 1=>1 combination). Not sure it makes sense though, or maybe I need to interleave another processing for that averaging ?

Thanks Daniel !

Indeed, I left that out. There should be the chance to customise the speed, amplitude and trigger. What other options are there missing?

Yeah, amplitude is what I was looking to as well, probably offering lin or log based for X/Y axis ?
A grid as well is really useful, both horizontal and vertical, linear or log again.
Log for horizontal doesn’t systematically make much sense, but allow to focus on more recent samples if more recent is to the left. That’s done on cars for consumption over past kilometers.

What is he current amplitude btw ?

Per level color would be great as well, for the line or the fill but that’s just an idea.

My display was working fine yesterday, now it’s screwed up don’t know what I did, maybe the amplitude is very low and displays only “noise” lol

You can achieve that by supplying a gradient for filling the curve.

With the grid I am on the fence: adding a grid to each plot would mean they draw all on top of each other.
But having them individually means you need to make sure you select a proper division/annotations manually.

I would need to look up the amplitude myself, but it’s like I remembered scaling from -1 to +1:
https://github.com/ffAudio/foleys_gui_magic/blob/main/Visualisers/foleys_MagicOscilloscope.cpp#L139

Haha, hard to tell, but good luck fixing it