electro-smith / oopsy

gen~ to Daisy: exporting Max Gen patchers for the ElectroSmith Daisy hardware platforms
MIT License
126 stars 30 forks source link

JSON Update #69

Closed CorvusPrudens closed 2 years ago

CorvusPrudens commented 2 years ago

This PR incorporates the changes in #66 along with a few fixes and the addition of a few sensor components.

beserge commented 2 years ago

Oopsy Full Test 1

Daisy Pod

json

templates/oopsy_pod.maxpat

Issues:

Pot Test

Simply mapped pots to leds with @max 1 @min -1.

Issues: Again, these colors also don't agree with the comment that was left in here at some point.

Pasted image 20220329134221

Encoder test

Encoder works!

Pasted image 20220329135201

Switch test

Sw is rising edge bang by default. Need to use sw_pressed to get pressed behavior.

Both sw1 and sw2 work fine with bangs and pressed. The example patches sometimes use sw and when they should use sw_pressed.

Pasted image 20220329140018

Daisy Field

templates/oopsy_field.maxpat

json

There are no led_sw_1 and led_sw_2. Should add aliases for all knobs as ctrl. e.g. ctrl1: knob1.

Daisy Petal

templates/oopsy_petal.maxpat

This example is totally borked. Needs to be reworked to test the petal effectively.

Issues:

Pot Test

Pasted image 20220329150836 ]

Issues:

Encoder Test

Pasted image 20220329152621

Switch Test

Pasted image 20220330091335

Pasted image 20220330092615

Footswitch Leds

Pasted image 20220329155348

Encoder Leds

 led_ring_1 = glue_out3[ size-1]; // device out

 hardware.led_driver.SetLed(, led_ring_1);

 hardware.led_driver.SetLed(, led_ring_1);

 hardware.led_driver.SetLed(, led_ring_1); // set out

Expression

Pasted image 20220330121108

Daisy Patch

templates/oopsy_patch.maxpat

Audio

Using the template patch:

Issues:

Daisy Patch Init

templates/oopsy_patch_init.maxpat

CV 4,6,7,8 Test

Was able to test these by just swapping them into the previous template patch. out 4 led doesn't work despite the template saying it does.

Knob test

Just swapped the ctrl1 for knob1, etc. These work fine.

ADC 9,10,11,12 Test

Works fine. I'd appreciate an alias as with cv. e.g. adc10 for adc_10.

Pasted image 20220330104547

SD Card

Tested on all platforms using examples/sdcard-minimal.maxpat.
Working on patch, petal, field, pod, and patch.Init!

Midi In

Midi seems to be coming in, I can see the > symbol in the oled when midi comes in. Wasn't able to convert midi -> freq in the gen~ patcher yet. This patch makes audio on the pc but not the daisy patch. Almost definitely user error here.

Pasted image 20220330145048

Midi Out

Spent some time looking at this, couldn't really figure out a simple way to test it. Let me know if you've got a good patch to test this and / or midi in.

One simple thing could be passing midi in through to midi out but I don't have enough cables around to actually test that atm!

Versio

We'll test this after this round of changes.

How To: Custom JSON with Oopsy

The section on Components is useful. This should be fleshed out to indicate default @max and @min, special things like sw_pressed, etc.

We should update the section about it being a WIP once it's merged.

Repo README

This hasn't been updated yet. This should be modeled after the pd2dsy readme.

Explanation of @max and @min. Explanation of the oled display. Explanation of poke leds on field. We should get this working on the other boards if we haven't yet. It's really cool! Any other special stuff like s toggle on the patch.Init(), or anything else I haven't found yet.

Explanation of interface types. (switch, encoder, rgb led, etc.) Should list default @max and @min. Should list any special stuff like sw_pressed.

Tables per platform as it is with the pd2dsy readme.

All told there should be some cross-pollination between the custom json howto, the getting started with oopsy wiki, and the github readme. It's better to duplicate information than link all over the place like crazy.

Code Review / Overall

Need to remove old json templates. source/pod.json vs source/daisy.pod.json

beserge commented 2 years ago

Abridged issues, refer to full test for details.

Hardware

Pod

I think these issues were already solved in pd2dsy some months ago.

Field

Petal

Patch

Patch Init

Midi IO

This sort of worked. It would be helpful to me, and probably users if we had a nice midiout and midiin example that works on all platforms, similar to the sdcard example. The current midi example doesn't really show how to use midi in gen.

Documentation

Needs some love. Refer to the full test writeup for more info.

Overall code stuf

CorvusPrudens commented 2 years ago

MIDI testing:

I did midi input testing on the Patch, Pod, and Field using the oopsy.midi.parse object. Note on/off and pitch values worked as expected. No further testing is needed since if one aspect works, the rest must as well (no MIDI code was touched at all in this PR).

I didn't test output, but the likelihood of errors there is very small.

CorvusPrudens commented 2 years ago

MIDI Out

I've now tested MIDI output with simple note on / off messages using the following configuration on the Patch and Field (with an appropriate trigger input for each platform): Screen Shot 2022-04-07 at 1 37 17 PM

MIDI output worked as expected using the right range for notes and the expected velocity of 127.

Field LEDs and pads

There was a lurking issue present with the order of pads and LEDs on the field (which had been corrected already in pd2dsy). This was easy to test, since hooking up a metro to an LED (instead of the corresponding pad) would not illuminate the expected pad. Essentially, the pads and LEDs were jumbled up in a complementary way to make the Field template appear to behave correctly.

This has now been resolved.

CorvusPrudens commented 2 years ago

While the code was in place to resolve bipolar input issues, the patch.Init() JSON omitted the necessary range field and the patcher omitted the @min -1 attribute. With the following simple test, it was very easy to verify the problem: Screen Shot 2022-04-18 at 2 35 01 PM Before the most recent two commits, the above configuration would not illuminate the LED. Once the changes were made, the LED lit up when I provided an input below 0 volts as expected.

The template patcher has been corrected and now includes @min -1 on all inputs that expect a bipolar input.

CorvusPrudens commented 2 years ago

This was superseded by #71, which will be merged into main at a later date.