def tuning(ed, params): if len(params) == 1: pass elif len(params) == 2: # standard E shifted shift = int(params[1]) ed.tab.tuning = [n + shift for n in music.standard_E] elif len(params) == 7: # individual strings ed.tab.tuning = reversed([str(s) for s in params[1:]]) else: ed.st = 'Invalid argument' return # display tuning ed.st = music.tuning_str(getattr(ed.tab, 'tuning', music.standard_E))
def load_tablature(self, filename): '''Unpickle tab from a file''' try: if os.path.isfile(filename): infile = open(filename, 'rb') self.tab = pickle.load(infile) infile.close() else: self.tab = Tablature() self.file_name = filename self.set_term_title(filename + ' - VITABS') self.st = '{0} ({1} bars, tuning: {2})'.format( filename, len(self.tab.bars), music.tuning_str(getattr(self.tab, 'tuning', music.standard_E))) except: self.st = 'Error: Can\'t open the specified file'