Wohlstand / OPN2BankEditor

A small cross-platform editor of the OPN2 FM banks of different formats (Downloads in README below)
GNU General Public License v3.0
42 stars 8 forks source link

Importing and exporting with custom text formats #82

Closed jpcima closed 5 years ago

jpcima commented 5 years ago

81

Hi, this shows a concept of using custom text formats for reading and writing. It's not implemented yet in the editor, and only has VOPM as a format now.

In createVopmFormat, it can be seen how to build a grammar for a format. The Vals are to replace with the actual values of the instrument. To associate with values, it relies on MetaParameter, which has been given a setter function. The Ints are just number fields which are ignored, and have defaults used for writing.

While writing, the whitespace tokens are used for human-readable formatting. During parsing, the whitespace tokens are always ignored.

jpcima commented 5 years ago

Abount integrating this in the editor, I an not completely sure how I lay it out the best way. I think a small toolbar which has 3 icons: copy/paste/select format. Maybe I can take some space for it at the right side of the long instrument name box.

Another thing is that there exists already ctrl-c/ctrl-v as copy & paste, which currently copies instrument's binary data. It's important to keep these two are distinct, as custom format are unable to save all data. But also this difference can be lead to confusion for users.

jpcima commented 5 years ago

What is implemented and working:

jpcima commented 5 years ago

Next, I allowed to parse varying forms of PMD found... Ther are some using comma to separate, and some which don't.

Also, writing name seems optional is the case of PMD. I have extended the parser with conditionals using simple looking ahead by one token. It looks for an = symbol to check the presence of name.

For me, the current state if fine to merge.

jpcima commented 5 years ago

Also @Wohlstand, the travis shows failure at the ftp upload step.

Wohlstand commented 5 years ago

That because your branch state lacks the script I have added in some moment, so, merging...

jpcima commented 5 years ago

Oh that's right, I didn't pay attention about this. Thanks