• Loopings

    During the past few months I dove into audio loops, both from musicians and makers perspective. Mainly because of some unused SDRAM on the daisy seed board i decided to implement a looper functionality. This has proven to be rather simple from a programming perspective. When playing around with the looper it has proved to be a useful musical tool and fun to play with. One thing a added which is not commonly present at least on smaller loopers is a retrigger function. This I added to be able to manually sync to loop to an external one. It has proved to be really useful for a two-person ambient project i’m part of. The video demonstrates the looper function and briefly explains the theory of operation.

    Theory

    A looper is essentially a very long delay with a “freeze” function. The sample processing method of the looper is as follows

    float LooperProcessSample(float sampleIn, LooperDataType* data)
    {
        float sampleOut;
        if (data->looperState == LOOPER_STATE_STOPPED)
        {
            return sampleIn;
        }
        if (data->looperState != LOOPER_STATE_RECORDING)
        {
            sampleOut = sampleIn + *(data->memoryPointer + data->currentPosition)*data->playVolume;
        }
        else
        {
            sampleOut = sampleIn;
        }
        
        if (data->looperState == LOOPER_STATE_RECORDING)
        {
    
            *(data->memoryPointer + data->currentPosition) = sampleIn*data->recordingVolume; 
            
        }
        if (data->looperState == LOOPER_STATE_OVERDUBBING)
        {
            *(data->memoryPointer + data->currentPosition) += sampleIn*data->recordingVolume; 
        }
    
        if (++data->currentPosition >= data->indexEnd)
        {
            data->currentPosition = data->indexStart;
        }
        return sampleOut;
    }

    Depending on the state of the looper we either add a sample from the delay line (data->memorypointer) to the input sample or don’t. Also, if the looper either recording or overdubbing we write into the delay line.
    The whole handling of the looper revolves around a state machine with the following data structure.

    typedef struct {
        float * memoryPointer;
        float playVolume;
        float recordingVolume;
        uint32_t indexStart;
        uint32_t indexEnd;
        uint32_t currentPosition;
        uint8_t looperState;
        uint8_t looperFunction;
    } LooperDataType;

    Suprisingly the state changes are rather complex although the looper is rather simple to use. P1 to P3 denote the foot switches of the PiPicoFX from left to right.

  • Raspberry Pi Pico 2 is out!

    While I was absorbed/busy because of summer and festival season I was completely unaware of a big announcement from Raspberry Pi: that a new Raspberry Pi Microprocessor, the RP2350 came out along with the Raspberry Pi Pico 2 as a “standard” Development Board. Also, some parts on my Youtube Channel got unexpected attention.

    So, let’s discuss briefly in which way the RP2350 impacts the PiPicoFX project. Sure not all the new feature are of interest but some definitely are

    • Dual Arm Cortex M33 instead of two M0+’s: Audio processing can be float on the Raspberry Pi Pico version as well! Luckily I already ported the audio algorithms to float
    • Double the RAM, 520kb instead of 260kb: At first glance a doubling of the delay times! Only at the first glance since a float processing a sample is double the size so we end up having roughly the same number of samples in RAM.
    • 150 MHz max CPU frequency: A slight boost in performance/decrease in CPU load
    • extended boot options, security features: Allows to ship devices accepting only signed firmware thus reducing the risk of breaking a device with an unofficial firmware. This is rather theoretical though.
    • two QSPI-Controllers/ support for PSRAM: Maybe a door open up for adding a fat PSRAM block for really long delay or looper functionalities
    • More Pins: probably removes the need to have and extra Microprocessor for handling extra UI Elements

    To wrap it up: the RP2350 has some exciting new feature, the most important one probably being the floating point support of the processors. I’ll soon start blending the Raspberry Pi Pico and the Daisy Seed codebase of the PiPicoFX into a new Raspberry Pi Pico 2 firmware.

  • Raspberry Pi Pico vs Electrosmith Daisy Seed

    Almost a year ago i learned that there are actually microprocessor board available built specifically for audio processing. Of course i got curious to know how they work. After the first tiny successful steps i decided to port the entire PiPicoFX-Codebase to the Electrosmith Daisy Board. One milestone along this road was to painstakingly recreate the effect algorithms to be able to compare the Raspberry Pi Pico and the electrosmith daisy seed, more specifically floating-point base DSP and integer DSP side-by-side.

    Sound Samples

    Here are the sound samples processed with a little application i made for testing audio algorithm. This program allows to process wav-file by the same algorithm as implemented on the hardware platforms. This allows for a clean, bit-true comparison between floating-point and integer DSP.

    High-Gain Amp Simulator with little delay. The guitar used is a semi-acoustic telecaster with P90’s.
    High-Gain Amp Simulator: Floating-Point DSP
    High-Gain Amp Simulator: Integer DSP
    Drum Loop running through compressor.
    Drum Loop running through reverb