Audio outputs negate the value I send from firmware

Here’s some firmware that demonstrates the behavior. Per the above discussion, I guess this will only work on Patch SM hardware (I do not have a Seed).

#include "daisy_patch_sm.h"

using namespace daisy;
using namespace patch_sm;

DaisyPatchSM patch;

void AudioCallback(AudioHandle::InputBuffer in,
                   AudioHandle::OutputBuffer out,
                   size_t size)
{
  for (size_t i = 0; i < size; i++)
  {
    OUT_L[i] = 1;  // outputs approximately -9V on patch.Init() (Daisy Patch Submodule) hardware
    OUT_R[i] = -1; // outputs approximately +9V
  }
}

int main(void)
{
  patch.Init();
  patch.SetLed(true);
  patch.StartAudio(AudioCallback);
  while (1)
  {
  }
}

With gen~ and Oopsy, you can simply connect a [float 1] or [float -1] operator to the [out 1] and [out 2]. It behaves the same.

The Patch SM audio outputs have a nice wide range of almost -9V to 9V, and since it apparently is DC-coupled, this can be quite useful for things like envelope generators. But I have to output all negative values to get a proper envelope signal. That’s fine, but since it seems backwards, it makes me concerned about how “future proof” my code is.

It sounds like @tele_player is confirming this inverted output behavior. It’s consistent on my hardware at least.

But my main question remains: Can I assume patch.Init() / Patch SM modules will all behave and continue to behave this way?

Worst case I guess it could be a firmware build option or configurable via SD card if the behavior changes in a future iteration of the hardware. I’d still like to know what to expect.

1 Like