From cf9c4c752d2b2941d3598cde31c437225696f012 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Fri, 19 Dec 2008 04:26:58 +0000 Subject: global on/off mic&lab from Config flags --- diff --git a/TamTamJam.activity/Jam/JamMain.py b/TamTamJam.activity/Jam/JamMain.py index d78b095..ae41951 100644 --- a/TamTamJam.activity/Jam/JamMain.py +++ b/TamTamJam.activity/Jam/JamMain.py @@ -205,8 +205,9 @@ class JamMain(gtk.EventBox): self.activity.toolbox.add_toolbar( _("Playback"), self.playbackToolbar ) self.desktopToolbar = DesktopToolbar( self ) self.activity.toolbox.add_toolbar( _("Desktop"), self.desktopToolbar ) - self.recordToolbar = RecordToolbar( self ) - self.activity.toolbox.add_toolbar( _("Record"), self.recordToolbar ) + if Config.MIC: + self.recordToolbar = RecordToolbar( self ) + self.activity.toolbox.add_toolbar( _("Record"), self.recordToolbar ) #-- GUI ----------------------------------------------- if True: # GUI diff --git a/TamTamJam.activity/Jam/Picker.py b/TamTamJam.activity/Jam/Picker.py index aec2ae0..70d4481 100644 --- a/TamTamJam.activity/Jam/Picker.py +++ b/TamTamJam.activity/Jam/Picker.py @@ -134,11 +134,9 @@ class Instrument( Picker ): elif not i.kitStage and not i.kit: all.append(i) - if not Config.XO: - lab.sort() - all += lab - + lab.sort() mic.sort() + all += lab all += mic for inst in all: diff --git a/TamTamMini.activity/Mini/InstrumentPanel.py b/TamTamMini.activity/Mini/InstrumentPanel.py index 5355b30..73fbebe 100644 --- a/TamTamMini.activity/Mini/InstrumentPanel.py +++ b/TamTamMini.activity/Mini/InstrumentPanel.py @@ -129,9 +129,6 @@ class InstrumentPanel( gtk.EventBox ): for i in range(loadStage[2], len(keys)): key = keys[i] - if Config.XO and key[0:3] == 'lab': - continue - instrument = self.instrumentDB.instNamed[key] if not instrument.kitStage and not instrument.kit: diff --git a/TamTamSynthLab.activity/SynthLab/SynthLabConstants.py b/TamTamSynthLab.activity/SynthLab/SynthLabConstants.py index 88367c6..0fd9094 100755 --- a/TamTamSynthLab.activity/SynthLab/SynthLabConstants.py +++ b/TamTamSynthLab.activity/SynthLab/SynthLabConstants.py @@ -1,4 +1,5 @@ from gettext import gettext as _ +import common.Config as Config class SynthLabConstants: @@ -74,7 +75,8 @@ class SynthLabConstants: CONTROL_TYPES = ['lfo', 'rand', 'adsr', 'trackpadX', 'trackpadY'] CONTROL_TYPES_PLUS = [type + '+' for type in CONTROL_TYPES] - SOURCE_TYPES = ['fm', 'buzz', 'vco', 'pluck', 'noise', 'sample', 'voice', 'grain', 'addSynth', 'mic'] + SOURCE_TYPES = ['fm', 'buzz', 'vco', 'pluck', 'noise', 'sample', 'voice', 'grain', 'addSynth'] + if Config.MIC: SOURCE_TYPES += ['mic'] SOURCE_TYPES_PLUS = [type + '+' for type in SOURCE_TYPES] FX_TYPES = ['wguide', 'distort','filter', 'ring', 'reverb', 'harmon', 'eq4band', 'chorus'] FX_TYPES_PLUS = [type + '+' for type in FX_TYPES] diff --git a/common/Config.py b/common/Config.py index 53b161e..fee725c 100644 --- a/common/Config.py +++ b/common/Config.py @@ -62,6 +62,8 @@ PLUGIN_NPERIODS = 2 ## SOUNDS ############## +MIC = False + ARECORD = "arecord " + os.getenv("TAMTAM_ARECORD", "-f S16_LE -t wav -r 16000 -c2 -D hw:0,0") diff --git a/common/Util/Instruments.py b/common/Util/Instruments.py index d8a41b3..b4aa318 100644 --- a/common/Util/Instruments.py +++ b/common/Util/Instruments.py @@ -20,17 +20,20 @@ instrumentDB = InstrumentDB.getRef() def _addInstrument( name, csoundInstrumentId, instrumentRegister, category, loopStart, loopEnd, crossDur, ampScale = 1, kit = None, kitStage = False ): instrumentDB.addInstrumentFromArgs( name, csoundInstrumentId, instrumentRegister, loopStart, loopEnd, crossDur, ampScale, kit, name, Config.IMAGE_ROOT+"/"+name+".png", category, kitStage = kitStage ) +if Config.MIC: + _addInstrument( "mic1", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 ) + _addInstrument( "mic2", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 ) + _addInstrument( "mic3", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 ) + _addInstrument( "mic4", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 ) + +if not Config.XO: + _addInstrument( "lab1", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) + _addInstrument( "lab2", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) + _addInstrument( "lab3", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) + _addInstrument( "lab4", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) + _addInstrument( "lab5", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) + _addInstrument( "lab6", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) -_addInstrument( "mic1", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 ) -_addInstrument( "mic2", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 ) -_addInstrument( "mic3", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 ) -_addInstrument( "mic4", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 ) -_addInstrument( "lab1", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) -_addInstrument( "lab2", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) -_addInstrument( "lab3", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) -_addInstrument( "lab4", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) -_addInstrument( "lab5", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) -_addInstrument( "lab6", INST_SIMP, MID, 'mysounds', 0, 0, 0, 1 ) _addInstrument( "ounk", INST_SIMP, MID, 'animals', 0, 0, 0, 1 ) _addInstrument( "gam", INST_TIED, HIGH, 'percussions', .69388, .7536, .02922, 1.4 ) _addInstrument( "guit", INST_TIED, MID, 'strings', .08592, .75126, .33571, 0.7 ) -- cgit v0.9.1