Pico on Orac: Just Plug it in?

I think I broke the pd remote control either by removing your comma or
just adding the picoktrl.json to mec.service. Removed both the local and
system picokrtl.json ref. in mec.service, now the main pd patch connects to ORAC now. Will see which one breaks it.

FYI I did not move the pico.ihx hex file.

best tefman.

OK, so just adding the ref to picoktrl.json to mec.service in system breaks the pd remote control patch:

from pd window:

warning: 13 removed from poll list but not found
LISTEN:: listen 6101
connecting to port 6100
SEND:: connect 192.168.1.130 6100
recv: Connection refused (61)

works again if I remove it.

did not move the .ihx file.

-tefman

Got it!

  1. As far as I can tell, the remote control patch only works with osckontrol.json. At some point, I’d like to figure out how to get MEC to handle traffic from both the pico (or preferably the tau) AND the remote control patch at the same time, but for now I’m fine with switching between the two. (Mark is a busy, generous guy, and I hate to pester him about stuff that I should be able to work out on my own.)

  2. picopd.json will work just fine if run by hand, so there is some permissions weirdness when MEC is run as a service.

  3. There is no 69-eigenharp.rules in /etc/udev/rules.d. Sudo copying to there, running sudo udevadm control --reload-rules, and then rebooting seems to have fixed the issue. My pico now works.

Things I did:

  1. Create an Orac patch that has brds in slot 1, and midi in channel set to 0. Saved it as new, and then hit the save button to make sure it loads when orac loads. (Might not be able to hear pico with default patch, even if everything else is fixed?)
  2. edit /etc/systemd/system/mec.service and make the entry point to picopd.json
    2a)refresh the systemctl daemon
  3. create folder structure for the ihx file, and copy it there
  4. sudo cp 69-eigenharp.rules /etc/udev/rules.d
  5. refresh the rules
  6. reboot

Before you get too carried away, I’d try running mec by hand, just to make sure that pi4 isn’t causing additional complications.

cd /usr/local/MEC
sudo ./mec-app picopd.json
(control-c to exit)

snippets for the rest of the steps from my history. Make sure you understand what you are doing, as some of these can mess up your pi if you or I mistyped.

sudo systemctl stop mec
sudo pico /etc/systemd/system/mec.service
sudo systemctl daemon-reload
sudo mkdir -p /usr/local/eigenharp/firmware/resources
sudo cp /usr/local/MEC/pico.ihx /usr/local/eigenharp/firmware/resources
sudo cp /usr/local/MEC/69-eigenharp.rules /etc/udev/rules.d
sudo udevadm control --reload-rules
sudo reboot now

(yes, using the pico text editor on that second step might seem “kind of meta”)

Note: to get a Tau working, you also need to

sudo cp /usr/local/MEC/psu_mm_fw_0102.ihx /usr/local/eigenharp/firmware/resources/

so the osckontrol section that is interesting is (in mec section)

        "oscdisplay"  :  {
            "listen port" : 6100
        },

        "kontrol"  :  {
            "listen port" : 6000
        }

to this to get the pico/working we need this section, again in mec section

        "eigenharp" : {
            "voices" : 4,
            "pico" : {
                "mapping": {
                    "calculated": {
                        "keys in col": 9,
                        "row multiplier": 1,
                        "col multipler": 5,
                        "note offset": 48
                    }
                },
                "leds" : {
                    "green" : [1],
                    "_orange" : [ 1 ],
                    "_red" : [ 1 ]
                }
            },
            "tau" : {
                "mapping" : {
                    "calculated-wrong": {
                        "keys in col": 16,
                        "row multiplier": 1,
                        "col multipler": 4,
                        "note offset": 20
                    }
                }
            },
            "alpha" : {
                "mapping" : {
                    "calculated": {
                        "keys in col": 24,
                        "row multiplier": 3,
                        "col multipler": -1,
                        "note offset": 26
                    }
                },
                "leds" : {
                    "green" : [ 48, 52, 56,60, 64, 68 , 26, 74, 34, 82, 42, 90],
                    "_orange" : [ 1 ],
                    "red" : [ 30, 78, 38, 86, 46, 94 ]
                }
            }
        }

the other side we also need, is how to talk to orac,
this can either be done via mpe or osc

e.g.

    "mec-app"  :  {
        "outputs" : {
            "midi" : {
                "virtual" : 0,
                "voices" : 4,
                "pitchbend range" : 48.0,
                "device" : "Pure Data:0"
            },
            "_console" : {
                "throttle" : 0
            }
        }
    }

note: the device can differ slightly depending on platform name - use aconnect to check

Mark, sorry

just a bit confused. Should these pieces of code be one file, referenced with in mec.service?

the three pico.* files in MEC have bits of this code separate.

Da3v & Mark thanks for all the info, I will read twice, think about it… then act.

-tefman

Yes, and mentioned earlier these are configuring mec in different ways for different purposes.
Mec can be configured in many different ways for different tasks - it was not created initially for Orac

Soo I tried to put Mark’s code together below…

{
“mec” : {
“oscdisplay” : {
“listen port” : 6100
},

    "kontrol"  :  {
        "listen port" : 6000
    }
    "eigenharp" : {
        "voices" : 4,
        "pitchbend range" : 2.0,
        "firmware dir" : "./resources/",
        "throttle" : 1,
        "mapping" : {
            "pico" : {
                "mapping" : {
                "calculated" : {
                    "keys in col"    : 9,
                    "row multiplier" : 1,
                    "col multipler"  : 5,
                    "note offset"    : 48
                }
            },
            "leds" : {
                "green" : [1],
                  "_orange" : [1]
                  "-red"    : [1]
            }
          },
            "tau" : {
                "mapping" : {
                "calculated-wrong" : {
                    "keys in col"    : 16,
                    "row multiplier" : 1,
                    "col multipler"  : 4,
                    "note offset"    : 20
                }
              }
            },

"mec-app"  :  {
    "outputs" : {
        "osc" : {
            "host" : "127.0.0.1",
            "port" : 9002,
            "touch offset" : 0,
            "x offset" : 0.0,
            "y offset" : 0.0
        },
        "_console" : {
            "throttle" : 0
        }
    }
}

not sure about my brackets… think i might need one after the kontrol section, before eigenharp? yes? I ditched the alpha section as I don’t have one.

Best -tefman

Ooops I mean a comma before the eigenharp section?

-tefdaze

yeah and ditch the first line of “mapping” cause I duplicated it by mistake…

in over my head here but trying… deleting the alpha section & using osc for output might be 2 other ones. Will try assemble your code to the letter Mark.

-tefman