martinzw / THRII-direct-USB-pedalboard

A pedalboard that can send complete settings patches to a THRII guitar amplifier with direct USB-connection
29 stars 5 forks source link

My own build - how to save patches? #1

Open BuhJuhWuh opened 1 year ago

BuhJuhWuh commented 1 year ago

Hi Martin,

Firstly, a big thanks for all the groundwork you've done on the reverse engineering of the THR comms protocol. It is an excellent piece of work, and has given me enough confidence that I could use your project as a basis for my own. Loving my new THR, but very soon wanted to adjust the settings hands-free, and the commercial options like the Airstep just don't do what I want them to.

My wishlist:

(done)

  1. Build pedal. With more buttons!
  2. Include ability to daisy-chain THR's power supply, or run from onboard battery
  3. Update screen libraries to match my hardware
  4. Update button libraries to add multiple functions (tap/hold/double tap)
  5. Include status lights
  6. Include inputs for volume and expression pedals
  7. Be able to switch on and off FX units
  8. Be able to switch between FX modes (basics done, but needs finessing)

(in progress)

  1. Edit screen UI - replace some text with icons, use colour-coding to show FX unit status (UI mostly designed - now need to hook up to the variables)
  2. Edit patch switching logic
  3. Maybe remove solo mode - replace with gain boost, similar to your volume boost function

(to do)

  1. Make a way to save patches back to SD card (including naming patches via UI)
  2. Edit patches from the pedal: view and change individual parameters with expression pedal and/or buttons
  3. Tap tempo input for delay/FX

Here's a couple of questions, which I wonder if you can help with:

  1. How did you create the patches included in "patchesII.txt"?
  2. I didn't spot a function for writing settings back to the SD card - is this correct, or did I miss something? I'm sure I can write a function that will do this given enough time and effort, but just wanted to check I hadn't missed something.
  3. In my system, I can switch between FX unit mode (e.g. cycle chorus > flanger > phaser > tremolo; similar for echo and reverb units); however, it appears that your SD card patches only contain settings for the active unit - is this correct?
    At the moment if I load a patch with the Chorus active (say), it loads the settings fine, but if I then switch the FX unit to the Flanger, its settings are garbage or zero. So, is this just a case of expanding the patch definitions to include the full set of settings for all units rather than just the active ones? (I have one or two ideas here, but would be interested in yours too...)

All the best, Jo

THR Pedal 1 THR Pedal 2 THR Pedal 3 THR Pedal 4

martinzw commented 1 year ago

Hi Jo,

nice work! Glad that finally someone builds his own device To your questions:

  1. Just used a text editor and combined thrl6p files' contents. Created the thrl6p files with THR-Remote and/or with my own C#-THRII-Editor.
  2. You're right. No writing to SD with the pedalboard. Write them on PC.
  3. As far as i remember this is normal behaviour for a thrl6p file. chorus ,flanger , phaser , tremolo are not different units but modes for the modulation unit.

I tried hard to tap power from the THR's battery. But without opening the device, there seems to be no chance for that. I use the PSU as well and two DC jacks on the back of the pedal housing connected in parallel. I don't want to rely on a battery inside the pedalboard.

As you can not connect two USB cables to the THR, there is no possibility to connect the THR-Remote at the same time with the pedalboard. I considered making the teensy simulate a THRII device on the 2nd USB port. Thus dialing settings with THR-Remote would set parameters in the simulated device. These settings could be internally transfered to the real THR and /or written to SD. But this would be some work.

BuhJuhWuh commented 1 year ago

Hi Martin,

Thanks for the answers - that all makes sense. From a closer look at the .thrl6p files, I think I probably need to make my own extended ".thrl6p+" file type, which will include the settings for all the FX unit modes. Since your THR30II_Settings class already contains all of these as separate variables, I think the main task then is to edit your SetLoadedPatch() method to correctly map the settings from my new file type into THR_Values. The methods for sending patches to the THR should not need to be edited. Does that seem like a plausible route to you?

Then I will look at making my own function to serialize and store patches on the SD card. (I much prefer finding settings that I like and saving those as patches, rather than using other people's.) I have some ideas for how to implement editing modes using the pedal UI, but that's a longer-term goal. In the meantime, I can use the THR app.

For the power supply, the main use cases I identified were:

  1. playing with everything plugged in - one power supply would be nice but could live with two;
  2. playing with no external power source - therefore batteries required in both amp and pedal;
  3. if pedal has to have a battery, then I want it to charge whenever plugged in to either THR power supply or USB connection.

I had a power bank with pass-through charging lying around which I never use for anything else, so that solved my requirements above.

I also tried to see whether you could use the bluetooth app to change settings at the same time as using the pedal, but no joy there either - I assume they are trying to use the same MIDI connection within the amp, hence they just conflict.

This will be a slow project for me (only gets a couple of hours attention per week!), but will post back with progress in future, in case it is of interest.

Cheers, Jo

martinzw commented 1 year ago

Bluetooth and USB-Sysex can not be used simultaneously. That is why I planned the Teensy as a THR-emulator. Connect THR-Remote to Teensy and Teensy to THR. THR-Remote sees a THR (the virtual one). You dial in the settings with THR-Remote and they are relayed by Teensy to the real THR. If you are satisfied with the sound, press a button and Teensy snapshots the setting to SD. But as i said, that is some work.

BuhJuhWuh commented 1 year ago

Yes, nice idea - but I agree on the workload required!

BuhJuhWuh commented 1 year ago

Hi Martin,

I'm very much an amateur "prod it and see what happens" programmer, but thought it was about time I learned how to use GitHub, so I've started a fork with my own (very intermittent) progress here.

A question: did you ever work out whether it was possible to interact with the tuner? e.g. switch on/off, or even read the note and up/down arrow states?

It would be lovely to a) be able to turn it on/off from the foot pedal, and b) (stretch target!) even to pass the feedback info back using my LEDs... But I guess it may be an entirely self-contained circuit module with no program-level interaction with the rest of the firmware...

Cheers, Jo