Porting Nimbus to the Patch_SM

Hi there!
Nimbus (MI Clouds) has already been ported to the patch (Daisy Seed) and i had hoped it would be a breeze to port it to the patch submodule. Without fear I jumped into it but I am a bit stuck and poking in the dark.

So for ive taken the Nimbus code and removed all the bits for the display and control. I am just trying to get it running with hardcoded initial parameters. But so far I am getting only my dry signal. I consider this to be a small success because it doesnt crash.

The code is atm very bare bones and I feel like it should be just the right line to get it moving. Has somebody got any pointers?

Here is my code:

#include "daisy_patch_sm.h"
#include "daisysp.h"
#include "granular_processor.h"

using namespace daisysp;
using namespace daisy;
using namespace patch_sm;

GranularProcessorClouds processor;
DaisyPatchSM              hw;

// Pre-allocate big blocks in main memory and CCM. No malloc here.
uint8_t block_mem[118784];
uint8_t block_ccm[65536 - 128];

Parameters* parameters;

void AudioCallback(AudioHandle::InputBuffer  in,
                   AudioHandle::OutputBuffer out,
                   size_t                    size)
{
    FloatFrame input[size];
    FloatFrame output[size];

    for(size_t i = 0; i < size; i++)
    {
        input[i].l  = IN_L[i];
        input[i].r  = IN_R[i];
        output[i].l = output[i].r = 0.f;
    }
    processor.Process(input, output, size);

    for(size_t i = 0; i < size; i++)
    {
        OUT_L[i] = output[i].l;
        OUT_R[i] = output[i].r;
    }
}

int main(void)
{
    hw.Init();
    hw.SetAudioBlockSize(32); // clouds won't work with blocks bigger than 32
    float sample_rate = hw.AudioSampleRate();
    //init the luts
    InitResources(sample_rate);

    processor.Init(sample_rate,
                   block_mem,
                   sizeof(block_mem),
                   block_ccm,
                   sizeof(block_ccm));

    parameters = processor.mutable_parameters();
    processor.set_playback_mode(PLAYBACK_MODE_GRANULAR);
	processor.set_quality(0);

    hw.StartAdc();
    hw.StartAudio(AudioCallback);
    while(1)
    {
        processor.Prepare();        
    }
}

Might not be very helpful, but I ported the Rings (Torus) example from patch to the submodule. Not sure if there’s any similar code to reference between the two:

MI Rings (Torus) port for patch.Init().

Hi there,
I really enjoy your port of the torus! But unfortunately I couldn’t find anything helpful. I’m a novice but it feels like something is going wrong inside of the audio process function.
I mean audio is going in and out but the effects are not applied. I’ve ordered the debugging tool and will look into it deeper but I wonder wether I should just pivot to writing a new granular effect code.

So I got it working. It was a stupid problem: the density parameter at 0.5 doesn’t spawn grains. Reading the OG manual helps^^

I will implement all features over the next couple of days and release it here.

Very curious about this project! Hmu if you need a tester!

Hi, you can find my progress here:

So far I’ve mapped the knobs to 8 parameters with the toggle switch as a ‘shift’ key. The button changes the modes or polyphony.
You can check it in code till I manage to write a readme.

Thanks! I forked it and made a few changes to the controls! I also created a better ReadMe (with a control table :slight_smile: ) DaisyExamples/patch_sm/Nimbus_SM at nimbus_sm · niektb/DaisyExamples · GitHub