Flash Error w/ Custom JSON

Was super excited to dig into PlugData x Daisy Seed stuff today. Spent some time reading some documentation and examples before diving in.

Started off great, flashed the Seed a couple times with some basic oscillator tones and then a knob to control the volume.

Then when I was testing LED feedback, I came across some strange behaviour where the LED feedback was inverted (e.g. max brightness at minimum volume and visa versa). Electronics-wise, I know the circuit was correct as it was running a fully functioning DaisyDuino project beforehand where LED feedback from VCA was working as expected.

I exported a patch with a simple inverse circuit before “s led1 @hv_param” to test if that fixed the bug but then this error appeared:

Now I can’t flash a compiled PlugData patch with a Custom JSON. The other board types work fine but unfortunately they aren’t any use to me as I have a Seed. Anyone seen this before or know of any potential solutions? Would love to get back up and running again.

Full error code below:

--> Generating C

=== Signal Order ===
__phasor_k~f {frequency:440.0 phase:0.0}
__var_k~f {k:0.5 step:0 reverse:False}
__sub~f
__abs~f
__var_k~f {k:0.25 step:0 reverse:False}
__sub~f
__var_k~f {k:6.283185307179586 step:0 reverse:False}
__mul~f
__mul~f
__mul~f
__mul~f
__var_k~f {k:0.007833333333333 step:0 reverse:False}
__var_k~f {k:-0.166666666666667 step:0 reverse:False}
__fma~f
__fma~f
__varread~f {var_id:asFpCtdI}
__mul~f
__add~f
__add~f
AVX: 64.0 cycles / 8.0 cycles per frame
     512 frames @ 1000MHz >= 4.10us
SSE: 61.0 cycles / 15.25 cycles per frame
     512 frames @ 1000MHz >= 7.81us
CPU% #Objs Object Type      Performance
==== ===== ================ ===========
20%  1     __phasor_k~f     Counter({'avx': 13, 'sse': 10})
 3%  5     __var_k~f        Counter({'avx': 2.5, 'sse': 2.5})
 9%  2     __sub~f          Counter({'avx': 6, 'sse': 6})
 0%  1     __abs~f          Counter({'avx': 0.5, 'sse': 0.5})
39%  5     __mul~f          Counter({'avx': 25, 'sse': 25})
15%  2     __fma~f          Counter({'avx': 10, 'sse': 10})
 1%  1     __varread~f      Counter({'avx': 1, 'sse': 1})
 9%  2     __add~f          Counter({'avx': 6, 'sse': 6})
--> Generating Daisy module
  1) e[91mErrore[0m c2daisy: 'pin_r'
Total compile time: 86.55ms
Compiling for custom...
make: /Users/z/Library/Caches/plugdata/Heavy-aa4197bc8216b3eb144e04/daisy/source/Makefile: No such file or directory
make: *** No rule to make target '/Users/z/Library/Caches/plugdata/Heavy-aa4197bc8216b3eb144e04/daisy/source/Makefile'.  Stop.

Also, realise this might be more of a Wasted Audio / PlugData related issue so let me know if I should share this elsewhere.

Thank you!

What do your board.json and patch look like? (try a minimum example that shows the problem)

It’s not specific to plugdata, but likely an error in your board definition or your patch.

Thanks for the quick response

I’m not sure it is the board.json as I didn’t make any changes since the previous flashes, which exported successfully. Just double checked with the the basic customseed.json example given by Takumi here and getting the same error

Attaching a screenshot of the patch for you below

What are these cache files the compiler is failing to reference from /Library/Caches/plugdata/ ?

Is there anyway I can add them in manually?

These are temporary files that are created by the compiler. They are missing because Heavy (that converts PD to C/C++) failed.
We should do some better error handling to skip all these steps if Heavy has failed.

I’m assuming that pin_r comes from your custom json, so please share it anyway to help with debugging!

Ah gotcha, okay couldn’t attach the .json but have copied the contents below for you - thanks!

{
    "name": "customseed",
    "som": "seed",
    "audio": { "channels": 2 },
    "components": {
        "knob1": {
            "component": "AnalogControl",
            "pin": 15
        },
        "knob2": {
            "component": "AnalogControl",
            "pin": 16
        },
        "knob3": {
            "component": "AnalogControl",
            "pin": 17
        },
        "knob4": {
            "component": "AnalogControl",
            "pin": 18
        },
        "knob5": {
            "component": "AnalogControl",
            "pin": 19
        },
        "sw1": {
            "component": "Switch",
            "pin": 14
        },
        "led1": {
            "component": "Led",
            "pin": 13
        }

    }
}
1 Like

Hmm, this is odd. There is nothing with pin_r in your json or patch file.

I don’t understand where this is coming from …

Yeah it’s definitely a weird one considering I didn’t change the custom JSON since the previous successful exports and now any patch / custom JSON combo triggers the same error…

Just did a bunch of extra tests:

  1. Tested compiling a new patch with just osc~ and dac~which exported successfully!
  2. Tested original patch to see if it would export, no joy - same error code
  3. Copied all objects from original patch, pasted them into a new patch, ran compiler - same error code
  4. Deleted “r knob1 @hv_param” and “s led1 @hv_param” objects from the same patch, ran compiler - success!
  5. Added a new “r knob1 @hv_param” object to same patch, ran compiler - success!
  6. Added a new “s led1 @hv_param” object to same patch, ran compiler - success!

Definitely has me scratching my head but glad to be mostly up a running regardless :slight_smile:

My last question is what is happening with the LED behaviour? (same patch as screenshot in previous post)

In this patch my LED behaviour is flipped compared to your tutorial here (I’m getting max brightness when no volume and LED off at max volume)

Threw together this inverse circuit, which I’ve tested by printing to console and sending values from the UI slider but once I compile and send to Daisy the LED doesnt light no-matter the potentiometer value?

Ah, the inversion is done in json2daisy: json2daisy/src/json2daisy/resources/component_defs.json at main · electro-smith/json2daisy · GitHub

I can’t test right now, but I think you can put this in your json:

        "led1": {
            "component": "Led",
            "pin": 13,
            "invert": false
        }

Ahhh so that’s where all the different options are. Thank you so much for the help!! This worked a treat. Can’t wait to start tinkering :nerd_face: