def reset_global_defaults(self): # gv.global_volume = 10 ** (-6.0/20) # -12dB default global volume gv.basename = gv.SETLIST_LIST[gv.preset] gv.globaltranspose = dp.get_default('%%transpose') gv.sample_mode = dp.get_default('%%mode') gv.velocity_mode = dp.get_default('%%velmode') gv.PRERELEASE = dp.get_default('%%release') gv.gain = dp.get_default('%%gain') gv.PITCHBEND = dp.get_default('%%pitchbend') gv.currvoice = 1
def enter(self): if not self.in_a_mode: self.in_a_mode = True self.selected_kw_item = self.keywords_dict[self.mode] if self.dp.existing_patterns.has_key( self.selected_kw_item.get('name')): value = self.dp.existing_patterns[self.selected_kw_item.get( 'name')] if type(value) == str: value = value.title() print '### %s exists with a value of %s ###' % ( self.selected_kw_item.get('name').title(), str(value)) else: value = definitionparser.get_default( self.selected_kw_item.get('name')) if type(value) == str: value = value.title() self.dp.change_item_value( preset=self.preset, item=self.selected_kw_item, direction=None) # direction=None will set the default print '### %s does not exist. Set default: %s ###' % ( self.selected_kw_item.get('name').title(), str(value)) self.display() elif self.in_a_mode: # In a mode -> save to definition.txt self.dp.write_definition_file() self.in_a_mode = False self.display()