Drumkit
NAME
Audio::Hydrogen::Drumkit - representation of a drumkit
DESCRIPTION
This provides an abstraction of the data found in a
drumkit.xml
file that describes a hydrogen drumkit.
You can load the XML file with the from-xml
method
provided by XML::Class and export with to-xml
.
METHODS
attribute name
This is the string name of the drumkit, it is typically the
same as the directory name where the drumkit.xml
was
found.
attribute author
This is an arbitrary string describing the author, it is not required.
attribute info
A free text description of the drumkit. It is not required.
attribute instruments
This is a list of Audio::Hydrogen::Instrument objects,
hydrogen supports 32 instruments and any more than this
may not be shown in the interface. If the drumkit.xml
was created by Hydrogen then it may have exactly 32
items in the list, any un-used ones won't have a name.
If you are adding to the list or creating a new drumkit
you should ensure that the id
field of the instrument
is set to a unique value (an integer,) as this is how the
instrument is referred to in patterns and in the interface.
method make-absolute
Typically the filenames referred to in a drumkit file are relative to the directory of the drumkit, but when the instruments are used in a song they should be absolute paths so the instruments can be found wherever the song file is. This method takes an IO::Path that should typically represent the directory of the drumkit and will adjust the filenames of the instruments so they are children of this directory. This is always done when the drumkit is obtained from a DrumkitInfo.