Drumkit-independent patterns proposal #1691
Replies: 3 comments 5 replies
-
@theGreatWhiteShark #38 is related |
Beta Was this translation helpful? Give feedback.
-
I've been wondering (in the process of #1699) if it's worth considering a mid-way point. Swapping drum kits is currently hard in part because just loading them has a somewhat arbitrary order, and importing instruments individually inserts them as new instruments, so replacing them involves a clunky "copy notes all patterns" "paste notes all patterns" action. What if it we allowed individual instruments to be imported as replacements by dragging from the Sound Library panel on top of the That would make the process significantly easier than currently, for probably less work and complexity, although nowhere near as easy as it would be to have a kit loaded and have it Just Work as your proposal. |
Beta Was this translation helpful? Give feedback.
-
Superseded by #1984 |
Beta Was this translation helpful? Give feedback.
-
Goal
We want to allow for a smooth changing between drumkits and for drumkit-independent patterns. It should be possible to load another drumkit on the current song and use it without being required to reprogram any pattern. Making patterns independent of a specific drumkit would increase their reusability a lot and would also allow for large web-based pattern collections.
I would implement this feature by mapping each instrument (of a drumkit, pattern, or song) to a general identifier (GID). When loading a pattern/switching a drumkit all notes are assigned to a new instrument holding the same GID as the previous one.
Storage
I would store those maps in the
SoundLibrary
next to the associated drumkit usingstd::pair<Drumkit*, std::multimap<QString(GID),int(instrument number)>>
. It will be automatically loaded along side the drumkit from (a) the drumkit folder or (b) .hydrogen/data/mapping/DRUMKIT_NAME.h2map or initialized empty + warning if no such file could be found. (a) is treated as read-only and has lower precedence. (b) contains all mappings stored using the GUI or shipped by us.The associated
.h2map
files are saved as XML and consist of a list of GID-instrument number pairs. (Not quite sure yet which will be the node and which its value). In future versions of Hydrogen the exported.h2drumkit
bundles will also contain a.h2map
but I won't modify the kits stored on SourceForge. Instead, I'll create mapping files for all of those kits myself which will be installed in/usr/share/hydrogen/data/mapping
during upgrade. This way users are not required to discard and refill their local drumkit folder. The drumkit definition file won't be touched.The
.h2pattern
definition, on the other hand, I intend to modify by adding an additional field for the GID for each note. For backward compatibility drumkit name and instrument number will still be written out and those two will be used in combination with the.h2map
file of the associated kit when loading older patterns. But pattern definition already changed recently and the resulting one should still be compatible with older versions.Within the
.h2song
there will be a mapping section too for the currently loaded drumkit.GIDs
The particular strings we use as general identifiers (GID) for instruments are not formally defined in this design. As a recommendation and when writing all the mapping files I would use English names of General MIDI [1] and append number starting at
1
in case of multiple occurrences, likeHigh Tom 1
. Maybe it would be a good idea to maintain a wiki page listing all GIDs we use in our default mappings asAcoustic Snare
andElectric Snare
of the GM Standard should probably be merged into one.Not defining a limited set makes it easy to support future kits, allows for easy customization, but probably will also result in some mismatches.
Hydrogen will collect all GIDs read from all mappings into a set and offers them as possible choices in the GUI. However, the user will also be able to set them to arbitrary strings.
UX
There will be two new windows:
Switching kits or loading patterns
The mapping itself is done by taking all GIDs of the instruments of the current kit / new pattern containing notes and searching for an instrument of the same GID in the target drumkit. If exactly one was found and exactly one instrument of the current kit holds this GID, the mapping is considered trivial and is done automatically.
If there is either no instrument with matching GID in the target kit or multiple instruments with the same GID in the current kit / pattern and/or target kit, the user has two options:
Mapping to empty instruments will add an empty instrument at the bottom of the song's instrument list holding both the original instrument's notes and GID. When e.g. switching from a kit with 3 toms to a kit with 2 toms and back, one tom instrument will be muted in between but is again usable when switching back. This will become handy when e.g. cycling through all kits using a PC MIDI event.
Drumkits
.h2drumkit
bundle and a mapping file holding the same drumkit name is already present in .hydrogen/data/mapping the user is prompted whether to overwrite the existing mapping (as it would have higher precedence than the bundled one)Patterns
category
in case this property was set. Previously, patterns were put in folders named according to their associated drumkits which will be obsolete.Anything I missed or general remarks?
[1] https://en.wikipedia.org/wiki/General_MIDI#Percussion
Beta Was this translation helpful? Give feedback.
All reactions