mungewell / mpd-utils

Scripts for configuring the Akai MPD218 Midi Pad Controller
GNU General Public License v2.0
82 stars 9 forks source link

how is the program to be used without qprompt ? #2

Closed robertmuth closed 2 years ago

robertmuth commented 2 years ago

Currently, it is not possible to use the program without qprompt at all because

This stanza accesses a bunch of undefined variables in this case

     if options.division:
          edit_division()
       if options.swing:
          edit_swing()
       if options.dial:
         edit_dial(int(options.dial))
       if options.pad:
         edit_pad(int(options.pad))

But it is also not clear how to use it in this case. Is there an inverse operation to dump?

mungewell commented 2 years ago

Pushed a fix, should be good now but I no longer have the MPD218 to test with a real device.

Project is based around Construct, which is bi-direction way of describing binary formats and uses parse/build functions to decode/encode. This project actually re-builds the changed in order to write to file: https://github.com/mungewell/mpd-utils/blob/master/mpd218.py#L412

If you wanted to use the same method you can change the dictionaries made by parsing and build the result. On other projects I have done I have made the Python code be more of a library for other code to call... this project pre-dates doing that.