mungewell / zoom-zt2

Python script to install/remove effects from the Zoom G1Four pedal
MIT License
62 stars 11 forks source link

MS+ patch download '-c/--curdown' hangs #80

Closed mungewell closed 2 months ago

mungewell commented 2 months ago

Command to download current patch hangs, ctrl-C to abort.

$ python3 zoomzt2.py -c test.ztpc
^CTraceback (most recent call last):
  File "/home/simon/zoom-zt2-sdw-github/zoomzt2.py", line 1068, in <module>
    main()
  File "/home/simon/zoom-zt2-sdw-github/zoomzt2.py", line 801, in main
    data = pedal.patch_download_current()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/simon/zoom-zt2-sdw-github/zoomzt2.py", line 622, in patch_download_current
    self.outport.send(msg); sleep(0); msg = self.inport.receive()
                                            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/mido/backends/rtmidi.py", line 151, in receive
    return self._queue.get()
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/mido/backends/_parser_queue.py", line 46, in get
    return self._queue.get()
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/queue.py", line 171, in get
    self.not_empty.wait()
  File "/usr/lib/python3.11/threading.py", line 320, in wait
    waiter.acquire()
KeyboardInterrupt

You can use the numbered patch down/uploads though.

$ python3 zoomzt2.py -p 1 test.ztpc
$ hexdump -C test.ztpc 
00000000  50 54 43 46 80 01 00 00  02 00 00 00 01 00 00 00  |PTCF............|
00000010  00 00 08 00 00 00 00 00  00 00 43 4c 45 41 52 20  |..........CLEAR |
00000020  44 52 49 56 40 00 00 04  54 58 4a 31 60 00 00 00  |DRIV@...TXJ1`...|
00000030  83 8a 83 6a 83 41 83 74  83 46 83 43 83 59 45 51  |...j.A.t.F.C.YEQ|
00000040  82 f0 8e 67 82 c1 82 bd  98 63 82 dd 82 aa 93 c1  |...g.....c......|
00000050  92 a5 82 cc 83 49 83 8a  83 57 83 69 83 8b 83 76  |.....I...W.i...v|
00000060  83 8a 83 41 83 93 83 76  81 42 83 4e 83 8a 83 41  |...A...v.B.N...A|
00000070  82 c5 90 63 82 cc 82 a0  82 e9 83 68 83 89 83 43  |...c.......h...C|
00000080  83 75 83 54 83 45 83 93  83 68 82 c5 82 b7 81 42  |.u.T.E...h.....B|
00000090  54 58 45 31 78 00 00 00  54 68 69 73 20 6f 72 69  |TXE1x...This ori|
000000a0  67 69 6e 61 6c 20 70 72  65 61 6d 70 20 6d 6f 64  |ginal preamp mod|
000000b0  65 6c 20 77 69 74 68 20  64 69 73 74 69 6e 63 74  |el with distinct|
000000c0  20 64 69 73 74 6f 72 74  69 6f 6e 20 75 73 65 73  | distortion uses|
000000d0  20 6c 69 6e 65 61 72 20  70 68 61 73 65 20 45 51  | linear phase EQ|
000000e0  2e 20 49 74 20 68 61 73  20 61 20 63 6c 65 61 72  |. It has a clear|
000000f0  20 64 72 69 76 65 20 73  6f 75 6e 64 20 77 69 74  | drive sound wit|
00000100  68 20 61 20 73 6f 6c 69  64 20 63 6f 72 65 2e 00  |h a solid core..|
00000110  45 44 54 42 18 00 00 00  81 00 00 48 0d 38 80 0f  |EDTB.......H.8..|
00000120  c8 c0 03 10 c9 d0 00 00  00 00 00 00 00 00 00 00  |................|
00000130  50 52 4d 32 20 00 00 00  00 00 00 00 00 00 00 00  |PRM2 ...........|
00000140  00 80 0c 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000150  00 00 00 00 00 00 80 07  4e 41 4d 45 20 00 00 00  |........NAME ...|
00000160  43 4c 45 41 52 20 44 52  49 56 45 52 20 20 50 52  |CLEAR DRIVER  PR|
00000170  45 41 4d 50 20 20 20 20  20 20 20 20 00 00 00 00  |EAMP        ....|
00000180  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000350
mungewell commented 2 months ago

I implemented the 'new' get current patch, as described here: https://github.com/mungewell/zoom-zt2/issues/68#issue-2061716771

But it seems to be presenting a different format patch when downloading from GCE-3

$ python3 zoomzt2.py -c test.zptc
$ hexdump -C test.zptc | head
00000000  50 54 43 46 a8 00 00 00  01 00 00 00 00 00 00 00  |PTCF............|
00000010  20 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  | ...............|
00000020  00 00 00 00 54 58 4a 31  2c 00 00 00 4d 53 20 38  |....TXJ1,...MS 8|
00000030  30 30 82 f0 8e 67 82 c1  82 bd 83 58 83 5e 83 93  |00...g.....X.^..|
00000040  83 5f 81 5b 83 68 82 c8  98 63 82 dd 83 54 83 45  |._.[.h...c...T.E|
00000050  83 93 83 68 81 42 00 00  54 58 45 31 2c 00 00 00  |...h.B..TXE1,...|
00000060  54 68 69 73 20 73 74 61  6e 64 61 72 64 20 64 69  |This standard di|
00000070  73 74 6f 72 74 69 6f 6e  20 73 6f 75 6e 64 20 75  |stortion sound u|
00000080  73 65 73 20 4d 53 20 38  30 30 2e 00 45 44 54 42  |ses MS 800..EDTB|
00000090  00 00 00 00 50 50 52 4d  0c 00 00 00 00 00 00 00  |....PPRM........|

$ python3 zoomzt2.py --old-patch -c test.zptc
$ hexdump -C test.zptc | head
00000000  50 54 43 46 34 01 00 00  01 00 00 00 05 00 00 00  |PTCF4...........|
00000010  20 00 00 00 00 00 00 00  00 00 4d 53 20 48 69 47  | .........MS HiG|
00000020  61 69 6e 20 40 00 00 03  11 00 00 04 10 00 00 05  |ain @...........|
00000030  40 00 00 01 70 00 00 09  54 58 4a 31 2c 00 00 00  |@...p...TXJ1,...|
00000040  4d 53 20 38 30 30 82 f0  8e 67 82 c1 82 bd 83 58  |MS 800...g.....X|
00000050  83 5e 83 93 83 5f 81 5b  83 68 82 c8 98 63 82 dd  |.^..._.[.h...c..|
00000060  83 54 83 45 83 93 83 68  81 42 00 00 54 58 45 31  |.T.E...h.B..TXE1|
00000070  2c 00 00 00 54 68 69 73  20 73 74 61 6e 64 61 72  |,...This standar|
00000080  64 20 64 69 73 74 6f 72  74 69 6f 6e 20 73 6f 75  |d distortion sou|
00000090  6e 64 20 75 73 65 73 20  4d 53 20 38 30 30 2e 00  |nd uses MS 800..|
mungewell commented 2 months ago

But it does now work on MS+ pedal (without using "editor mode on")

$ python3 zoomzt2.py -c test.zptc
$ python3 decode_preset.py -s test.zptc 
Name: CLEAR DRIV
Effect 1: 0x04000040
   Enabled: True
   Param 1: 53
   Param 2: 14
   Param 3: 62
   Param 4: 50
   Param 5: 15
   Param 6: 68
   Param 7: 50
   Param 8: 52