Oopsy Help ;)

Hi Guys !

I would be really happy if one of you could help me with the following:

1) I have VSCode and an STLink V3 debug probe set-up, and I can compile debug any pod example I use or create in DaisyExamples
( that might sound basic for you guys, but It took me countless evenings to get there…)

2) I have installed Max8 and using oopsy I generate for example “reverb.cpp” and “reverb.h” out of reverb.maxpat.

Now: that might be naive, but what should I carry across into into my 1) style project to get the max reverb running ?

a → of course if I open the “oopsy” generated project in VSCode I get again tons of messages I don’t have a clue about, and I don’t want to fight again like I did to reach "step b-> I’ ve tried to replace in the “standart” project hw.StartAudio(AudioCallback) by " perform(… ) that I saw in the generated reverb.cpp, but that does not work!

king regards,

1 Like


To clarify, are you just trying to get the gen~ patch onto your Daisy, or are you trying to debug the generated code?

If the former, you shouldn’t have to dig into the files much at all, but oopsy is currently only set up to use USB to program the Daisy. So you’d have to just bypass the stlink.

If its the latter, or you’d just prefer to program the daisy via ST-Link (it is a bit quicker and no button presses). You can navigate to the generated folder inside of Max 8/Packages/Oopsy/Source/ and using a git-bash terminal on windows, or your standard terminal on other OS X you should be able to run make && make program to program via JTAG.

If you are trying to debug it, I have only done this briefly, but you’ll need to copy over, and edit a few files from a working example to get the vscode stuff working.

many thanks again Shensley for your answer.

To clarify:

I have painfully reached the point where I have managed to set-up VScode and the ST link and this way I am able to use your helper.py script to generate a template and enrich it to upload and debug code for my pod .

Now what I would like to do is to extract, or wrap the c++ code MAX8/oopsy generate for a patch in order to use it in the "AudioCallback(float **in, float **out, size_t size){…}.

For example in the pod/MultiEffect example you have :

void AudioCallback(float *in, float *out, size_t size)
float outl, outr, inl, inr;

case REV: GetReverbSample(outl, outr, inl, inr); break;
case DEL: GetDelaySample(outl, outr, inl, inr); break;

And you could also use something like: case PATCH1 : GetMaxPatch1( outl, outr, inl, inr);
assuming you have extracted and adapted the gen~ “erated” c++ code and added the corresponding headers.

Hope that’ s clearer than my initial post !

kind regards,

PS: I know oopsy inside MAX is supposed to upload the code. But again it does not work for me the way it is set-up, nor does work anymore the online command make program.

I’m not 100% sure I follow what you’re trying to do, but if you just want to bypass using dfu-util and use the JTAG, then you can still use the Oopsy workflow up to a certain point.

  1. Use the oopsy bpatcher in Max to generate the code (hit the button in the oopsy bpatcher), this will generate the wrapper (libdaisy-gen) code and the makefile in a folder like oopsy/source/build_myPatch_patch. It will say DFU failed and you can ignore that.
  2. navigate to that folder, and run make && make program

Alternatively, you can do it from a command line using Node.js:

  • cd oopsy/source
  • node oopsy.js (insert path to your reverb.cpp) (insert path to the target json, e.g. daisy.patch.json) (insert other option args)
  • cd build_(name of your patch)
  • make program

Which will do the same as step 1 above.

We could also very easily add a command option to oopsy.js to select between using DFU and JTAG, since all it requires is changing the argument to the make invocation.

…and, if you wanted to insert more complex debugging features, you could hack the genlib_daisy.h to add them once, rather than for every project.

If they work well I’d be happy to review a PR!

Hi Graham!

Many thanks for your answer, and apologes my late reply.

Here is where I’m coming from:

I have a pod, all set-up ( windows10 / Gitbash / VScode / STlink )

My project is to build with the seed an on-board guitar effects for the guitars I build, ( my fisrt hobby )

I’ m knowledgeable enough to adapt, modify, build and load the examples I find in the Git “DaisyExamples” Repo
( though I will still have to design a pcb around a seed and stick that all in my guitars, with buttons, selectors, leds…for now I enter the pod from my guitar via a pre-amp, and listen with ear pods. )

Here is now where I hit my limits: I would like to be a bit more “creative”, and on top of re-using objects from the daisy & daisysp,
write “processings” of my own in the audio callback

My first idea, origin of this post, was to somehow reuse the code that Max generates. But I don’ t know where to grab it even before trying to re-use it :wink:

Now my second attempt is to use the gsl ( Gnu scientific lib GSL - GNU Scientific Library - GNU Project - Free Software Foundation ) but I don’t know how to link it my code.

if I put in my something like:
#include <gsl/gsl_sf_bessel.h>
or #include <gsl/…whatever…

It is not found by the compiler.

if I replace <gsl/gsl_sf_bessel.h> by “…/…/…/gsl/gsl_sf_bessel.h”, then an other recursive include is not found …

My feeling is that I should modify the Make(s) files, but I don’ t know how to.

That would be much appreciated if you could help me out.

With kind regards,

Ah, this may be beyond what I can help with too then! By the sounds of it you don’t need Oopsy, just plain gen~. The code created by gen~ can be exported by sending “exportcode” to any gen~ object, and it will save the files to whatever directory you choose in the popup. From that point on it will remember where you exported to, and every edit to gen~ will re-export there. If you have a look at the code it’s fairly straigthforward, with an initialization, an audio callback, some handlers for setting params etc. It’s going to be up to you to design how you integrate that code into your daisy projects with GSL etc.

Yes it does sound like you need to modify the makefiles. There’s plenty of tutorials on that out there on the web. To add include paths you can usually use CFLAGS+=-I"path/to/your/libraries/goes/here", but usually for most libraries you need to add more compiler flags, and possibly linker flags if it isn’t a header-only library. The GSL docs should help you there.