Kits¶
Kits are groupings of samples that can be played by the Game Boy’s wave channel; this is mostly used for drums.
Kits are defined in the ROM rather than the .sav data.
Usage Examples¶
# Load kits from a ROM
kits = Kits('lsdj.gb')
# Get kit 13's name
kit_13_name = kits[13].name
# Get sample 4 from kit 10
sample = kits[10].samples[4]
# Save the sample to a .wav file
sample.write_wav('my_sample.wav')
# Load a new sample into kit 9, sample 3
kits[9].samples[3].read_wav('load_sample.wav')
API Reference¶
YATTA!
-
class
pylsdj.
Kits
(rom_file)¶ A wrapper for an LSDJ ROM’s kits
-
class
pylsdj.
Kit
(data)¶ An individual sample kit
-
name
¶ the kit’s name
-
samples
¶ the samples that comprise the kit, each of which is a KitSample
-
-
class
pylsdj.
KitSample
(data, index)¶ -
force_loop
¶ true if the sample will loop, false otherwise
-
length
¶ the length of the sample, in bytes
-
name
¶ the sample’s name
-
read_wav
(filename)¶ Read sample data for this sample from a WAV file.
Parameters: filename – the file from which to read
-
sample_data
¶ The raw hex nibbles that comprise the sample
-
used
¶ True if the sample’s memory is in use, false otherwise
-
write_wav
(filename)¶ Write this sample to a WAV file.
Parameters: filename – the file to which to write
-