hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.05k stars 173 forks source link

drumkit.xml changes "No definition for element drumkit_info available." #348

Closed dreaming-augustin closed 2 years ago

dreaming-augustin commented 8 years ago

It appears that the format of drumkit.xml has changed between 0.9.5 and 0.9.6.

I used hydrogen 0.9.5 and downloaded contributed drumkits, especially those made available here: http://www.hydrogen-music.org/feeds/drumkit_list.php

After the upgrade to 0.9.6.1, I got many errors like:

Error XSDError in file:///usr/share/hydrogen/data/drumkits/3355606kit/drumkit.xml, at line 1, column 14: No definition for element drumkit_info available. Error XSDError in file:///usr/share/hydrogen/data/drumkits/Boss%20DR-110/drumkit.xml, at line 1, column 14: No definition for element drumkit_info available. Error XSDError in file:///usr/share/hydrogen/data/drumkits/EasternHop-1/drumkit.xml, at line 1, column 14: No definition for element drumkit_info available. ....

(E) XMLDoc::read XML document /usr/share/hydrogen/data/drumkits/3355606kit/drumkit.xml is not valid (/usr/share/hydrogen/data/xsd/drumkit.xsd), loading may fail (E) Legacy::load_drumkit loading drumkit with legacy code (E) XMLDoc::read XML document /usr/share/hydrogen/data/drumkits/Boss DR-110/drumkit.xml is not valid (/usr/share/hydrogen/data/xsd/drumkit.xsd), loading may fail (E) Legacy::load_drumkit loading drumkit with legacy code (E) XMLDoc::read XML document /usr/share/hydrogen/data/drumkits/EasternHop-1/drumkit.xml is not valid (/usr/share/hydrogen/data/xsd/drumkit.xsd), loading may fail (E) Legacy::load_drumkit loading drumkit with legacy code

as reported in many places, including in this bug report accepted by mauser: https://www.assembla.com/spaces/hydrogen/tickets/185-during-startup--error-messages-are-printed/details#

The wiki page here about the drumkit file format: https://github.com/hydrogen-music/hydrogen/wiki/Drumkit-format warns: "! WARNING : the content of this page may be out of date (it will be updated soon) !" in an edit made in 2014!

I am not sure what changes must be made, nor where to find the latest standard.

dreaming-augustin commented 8 years ago

Some distributions still use 0.9.5, so http://www.hydrogen-music.org/feeds/drumkit_list.php should probably kept as is.

A new feed http://www.hydrogen-music.org/feeds/drumkit_list_0.9.6.php should be created with updated drumkits.

Also, at the very least a conversion document should be made available, and possibly have an automated conversion script, to help users who upgraded from a previous version to convert already downloaded drumkits.

dreaming-augustin commented 8 years ago

In one instance, I changed:

to: and it fixed one error, but I got a new one: VariBreaks/drumkit.xml, at line 13, column 22: Element {http://www.hydrogen-music.org/drumkit}isLocked is not defined in this scope. The line reads: false Is that an omission in the standard, or is the use of isLocked deprecated?
dreaming-augustin commented 8 years ago

shoot! github ate the xml markup!

Change: <drumkit_info> to `<?xml version="1.0" encoding="UTF-8"?>

` ... The line reads: `false`
dreaming-augustin commented 8 years ago

I tracked relevant changes in this commit:

Updated the XML of the default drumkits to be in conformance with the new XML schema c1cf2cc63b39b5464942646340c95ac36ff6bd51 data/drumkits/GMkit/drumkit.xml | 690 ++++++++++++++++----- data/drumkits/TR808EmulationKit/drumkit.xml | 915 ++++++++++++++++------------ 2 files changed, 1048 insertions(+), 557 deletions(-)

1048 insertions and, 557 deletions: a lot of changes!!

dreaming-augustin commented 8 years ago

The wiki hadn't been updated in 2 years. I updated it with the little information I know:
https://github.com/hydrogen-music/hydrogen/wiki/Drumkit-format

dreaming-augustin commented 8 years ago

I used sed to replace the first line in all the drumkits all at once: sed -i 's#<drumkit_info>#<?xml version="1.0" encoding="UTF-8"?>\n<drumkit_info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hydrogen-music.org/drumkit">#' */drumkit.xml

dreaming-augustin commented 8 years ago

Now, I've got errors like: Error XSDError in file:///home/gentou/.hydrogen/data/drumkits/YamahaVintageKit/drumkit.xml, at line 6, column 20: Element {http://www.hydrogen-music.org/drumkit}instrumentList is not defined in this scope.

dreaming-augustin commented 8 years ago

I did my best to figure out how to upgrade the drumkits. Attached is a patch of what I have so far.

I started changing <filename> elements, but apparently it is far from enough. It appears that the xml standard is overly strict. Apparently all elements must be present in the specified order.

Without any feedback from the maintainers, I am not sure what I am supposed to do.

xml_drumkit_fix_348-1.patch.txt

mauser commented 8 years ago

Hi @dreaming-augustin!

We're currently thinking about how to handle the next schema upgrade (to 0.9.7) which is bringing even more changes.

At the moment the warnings in hydrogen 0.9.6.1 are not nice, but they should not create any functional problems, so the 0.9.5 is not really in the focus at the moment. In addition, creating a drumkit_list_096.xml would mean to create new versions off all drumkits, which needs a lot of disk space.

simotek commented 8 years ago

Related to this (Presumably), on openSUSE i'm seeing the following crash sometimes when loading a drum kit

(E) XMLDoc::read XML document /usr/share/hydrogen/data/drumkits/K-27_Trash_Kit/drumkit.xml is not valid (/usr/share/hydrogen/data/xsd/drumkit.xsd), loading m ay fail (E) Legacy::load_drumkit loading drumkit with legacy code Error XSDError in file:///usr/share/hydrogen/data/drumkits/3355606kit/drumkit.xml, at line 1, column 14: No definition for element drumkit_info available. hydrogen: /home/abuild/rpmbuild/BUILD/hydrogen-0.9.6/src/core/src/basics/instrument_list.cpp:202: void H2Core::InstrumentList::move(int, int): Assertion `idx _b >= 0 && idx_b < __instruments.size()' failed.

Thread 1 "hydrogen" received signal SIGABRT, Aborted. 0x00007ffff50af908 in raise () from /lib64/libc.so.6 (gdb) bt

0 0x00007ffff50af908 in raise () at /lib64/libc.so.6

1 0x00007ffff50b0d5a in abort () at /lib64/libc.so.6

2 0x00007ffff50a8667 in __assert_fail_base () at /lib64/libc.so.6

3 0x00007ffff50a8712 in () at /lib64/libc.so.6

4 0x00007ffff7b9824b in H2Core::InstrumentList::move(int, int) () at /usr/lib64/libhydrogen-core.so.0

5 0x0000000000517da1 in DrumPatternEditor::functionMoveInstrumentAction(int, int) ()

6 0x0000000000517feb in DrumPatternEditor::functionDropInstrumentRedoAction(QString, QString, int) ()

theGreatWhiteShark commented 2 years ago

Close due to age. Luckily the drumkit XSD remained mostly stable since 0.9.7 and almost all versions of Hydrogen which are in use today should work with the current format.