shooking / ZoomPedalFun

A collection of tips and tricks for Zoom B1On, B1XFour and G1XFour pedals.
Creative Commons Zero v1.0 Universal
60 stars 2 forks source link

FX Id with sysex F0 52 00 6E 64 05 F7 #15

Open Colatino opened 2 years ago

Colatino commented 2 years ago

Is it possible to extract the fx id from the data returned with the CaptureFxCycle? I couldn't find it documented here.

I'm trying to use the file_download method from your code but I can't make it work reliably, sometimes it downloads ok and sometimes it doesn't, while the CaptureFxCycle is very robust on my side... it always works.

What I need is a way to link the fx_ids I get from the current patch with the fx installed on the pedal so that I can determine how many slots it uses so that I can infer the correct FXn to toggle on and off by code.

For each fx returned I can already infer some data: name, parameters (count, max and default values), slot size, and if it uses the expression pedal.

For instance: \xf0R\x00nd\x06PDL_PIT.ZD2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x00\x00P\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\n\x00\n\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\xf7

Is it possible to get the fx_id from this data?

shooking commented 2 years ago

Best to look at my b1xfour python. The cycle code is ok provided you do it in PCMode.

But my b1xfour builds on Mungewell's zoom-zt2

I ask the pedal to dump ZT2. This gives is the ZD2 Decode them to get IDs etc in JSON. Whilst I am at it I make a table.

Then I ask how many patches and how many per bank etc. This I now do ... except I can the add the FX directly into the JSON and I have a complete decode of the pedal.

All that is left is to render it.

shooking commented 2 years ago

Not related to this issue but not sure how else to contact you - I checked in the CPP that I use to decode parameters / patches. Could be helpful for Arduino - there is a STL port for the Mega I used in the past.

Colatino commented 2 years ago

I ended up changing the approach to solve my problem. As I'll be using a microcontroller the code has to be as optimized as possible so communicating with the pedal (the slowest part of the process) will be limited to getting the current patch and toggling effects on and off. Building a pedal model dynamically takes too long, measuring about 2 min on a PC, so I think maybe on the Pico it'll take even longer.

What I did was compiling the ids and number of slots of all the available G1XF effects (even the ones not installed) on an array to use as a lookup, something like this:

fx_summary={{id_0,n_slots},{id_1,n_slots},{id_2,n_slots}, ... ,{id_n,n_slots}}

Then I'll be asking the pedal for the current patch, that'll give me:

pedal_currrent={{id_v,state},{id_w,state} ,{id_x,state}, {id_y,state}, {id_z,state}}

And finally:

fx_slot_state={{id_v,state,slot_0},{id_w,state,slot_0+n_slots_v}...}

That'll give me the state and address of each of the fx's on the chain, allowing me to toggle each one with individual footswitches.

The last part of the project would be cycling screens with the foot (memory -> stomp -> edit). I tried a bunch of SysEx commands with no success. Also tried enablig editor mode and cycling screens with the button but had no reply from the pedal. Maybe there is a CC/PC command still not documented? I noticed that the pedals send CC PC commands when clicked, any idea how to find that out?

shooking commented 2 years ago

I haven't found any signal from some buttons. Sometimes I inferred based on other pedals. But not these. However - when you modify a parameter I thought it did show the FX parameter screen.

I suspect if one soldered a virtual switch across it you could send pulses. I had considered it (I have enough of the pedals).

shooking commented 2 years ago

I agree that grabbing current state is time consuming. You make a good point - if I cached it and made a JSON DB then I could instead pulls the ZDT (which is very quick) and use that as basis to check if I know about them. If not then pull that FX and JSON it, add to the DB and next time I will.know what it is.

If you look in my code you can see how I work out the slot width based on the number of parameters. 4 or less is likely 1. 5 or more is 2. Hope this helps. There is also some clue in the name.

shooking commented 2 years ago

OK so I took a quick look today at the output from FXCycle.sh

pi@raspberrypi:~/Software/ZoomPedal $ ./FXCycle.sh 
F0 52 00 6E 64 05 F7
Saving into temp.12880

93 bytes read
00000000  f0 52 00 6e 64 06 31 36  30 5f 43 4f 4d 50 2e 5a  |.R.nd.160_COMP.Z|
00000010  44 32 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |D2..............|
00000020  00 00 00 00 06 01 00 00  00 00 00 00 00 00 00 00  |................|
00000030  3c 00 26 00 00 00 00 00  00 00 00 5a 00 1e 00 00  |<.&........Z....|
00000040  00 00 00 00 00 00 01 00  01 00 00 00 00 00 00 00  |................|
00000050  00 64 00 50 00 00 00 16  00 00 00 00 f7           |.d.P.........|
0000005d

Normally sysex cmd N returns N-1, this seems to return N+1. I.E. 5 -> 6 Then we get the name. Now we look at the non-zero values.

f0 52 00 6e 64 06 
31 36 30 5f 43 4f 4d 50 2e 5a 44 32 
00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 06 01 00 00 00 00 
00 00 00 00 00 00 3c 00 26 00 00 00 
00 00 00 00 00 5a 00 1e 00 00 00 00 
00 00 00 00 01 00 01 00 00 00 00 00 
00 00 00 64 00 50 00 00 00 16 00 00 00 
00 f7

Notice we have 6, 1, 60, 38, 90, 30, 1, 1, 100, 80, 22 and if we examine the JSON for this FX we can see these correspond to the FX parameter's default and max values. That is THRSH is max 60 default 38. Not sure if the 01 means the group? I make the FXID=48 and the gid=12 with 1 slot. So we have 06, 01, 16 as unknown. Let's look at another one in the sequence. This comes out as BLACKOPT and the max/defaults can be read from above. The outstanding values are 6, 1, 6 with FXID=16, gid=12, 1 slot

So far I cannot spot the pattern for these extra hex/dec values. But for sure from the FX Cycle you get the name and the max/default values.

shooking commented 2 years ago

ok so if there is a pedal parameter=true then there is an 0x50 ie

pi@raspberrypi:~/Software/ZoomPedal $ ./FXCycle.sh 
F0 52 00 6E 64 05 F7
Saving into temp.30945

93 bytes read
00000000  f0 52 00 6e 64 06 50 44  4c 5f 52 45 53 4f 2e 5a  |.R.nd.PDL_RESO.Z|
00000010  44 32 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |D2..............|
00000020  00 00 00 00 06 01 00 00  00 00 00 00 00 00 00 00  |................|
00000030  31 00 0b 00 00 00 *50* 00  00 00 00 0a 00 07 00 00  |1.....P.........|
00000040  00 10 00 00 00 00 64 00  32 00 00 00 10 00 00 00  |......d.2.......|
00000050  00 64 00 5c 00 00 00 16  00 00 00 00 f7           |.d.\.........|
0000005d