Patch_sm Looper example - Mode

I’ve been working on modifying the the Looper example for the Patch_sm, however I can’t work out how to change between the modes that are listed in the looper.h file. Excerpt below:

    enum class Mode
    {
        NORMAL,
        ONETIME_DUB,
        REPLACE,
        FRIPPERTRONICS,
    };

    inline void SetMode(Mode mode) { mode_ = mode; }

I see that I need to call SetMode(), but anything I try seems to not work. I’m specifically wanting to change it to the frippertronics mode.

Any help would be appreciated! I’m using VS Code to both modify the looper example and program the Patch_Sm.

Thanks!

Welcome to the Daisy forum -

Specifically - what does “anything I try seems to not work” mean? You can’t get it to compile? Or, it doesn’t work correctly after compile and upload?

If the first, try adding the next two lines right after the Looper Init() calls in main():
looper_l.SetMode(Looper::Mode::FRIPPERTRONICS);
looper_r.SetMode(Looper::Mode::FRIPPERTRONICS);

1 Like

Thanks @tele_player! That did the trick. It wouldn’t compile when I had it after the Looper.init() call in main(): because I had it like this:

    looper_l.SetMode(Mode::FRIPPERTRONICS);
    looper_r.SetMode(Mode::FRIPPERTRONICS);

Didn’t realise that I needed Looper:: in there at the start. Quite new to programming Daisy, especially with VS Code, as I mainly use the Arduino IDE.

Thanks for your help!

Hi Hexachord, thank you for posting this question. I have been using the looper in its default setting (and having fun with it) and I had no idea that there were more modes.

1 Like

Starting from the patch_sm Looper.cpp example, I made a version for PedalPCB Terrarium, using the four toggle switches to select the Mode.

Fun!

1 Like