Skip to content

Instantly share code, notes, and snippets.

@tsundokul
Last active August 22, 2021 15:46
Show Gist options
  • Save tsundokul/5f865885fd118e5238a548acd63c00be to your computer and use it in GitHub Desktop.
Save tsundokul/5f865885fd118e5238a548acd63c00be to your computer and use it in GitHub Desktop.
Amplitube 5 disable cabinets in all presets (Windows)
#!/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