Last active
August 22, 2021 15:46
-
-
Save tsundokul/5f865885fd118e5238a548acd63c00be to your computer and use it in GitHub Desktop.
Amplitube 5 disable cabinets in all presets (Windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'nokogiri' | |
def get_presets(dir = default_dir) | |
Dir.glob File.join(dir, '**/*.at{5,4}p') | |
end | |
def get_cab_elements(preset_path) | |
doc = Nokogiri.XML IO.read(preset_path) | |
[doc, doc.xpath('//*[@CabModel]')] | |
end | |
def disable(cabs) | |
cabs.each do |el| | |
el.attributes['Bypass'].value = '1' if el.attributes['Bypass'] | |
end | |
end | |
def main | |
presets = get_presets | |
presets.each do |p| | |
doc, cabs = get_cab_elements(p) | |
disable(cabs) | |
IO.write(p, doc.to_xml) | |
end | |
end | |
def default_dir | |
"/mnt/c/Users/#{ENV['USER']}/Documents/IK Multimedia/AmpliTube 5/Presets" | |
end | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment