Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TamTamSynthLab.activity
diff options
context:
space:
mode:
authorNat <natcl@hotmail.com>2007-10-26 20:46:18 (GMT)
committer Nat <natcl@hotmail.com>2007-10-26 20:46:18 (GMT)
commit1a4a49865ea6543177a9734b80fb3a9227808b45 (patch)
tree384aff89f07f06960977f5a283f1625a72523ff9 /TamTamSynthLab.activity
parent7c0c78e17dccfdd34c78c7a10ceb8b315986d8de (diff)
parent2e1f26239411a0448c31f4911263ada60dbf3514 (diff)
Merge branch 'master' of git+ssh://natcl@dev.laptop.org/git/projects/tamtam
Diffstat (limited to 'TamTamSynthLab.activity')
-rw-r--r--TamTamSynthLab.activity/MANIFEST5
-rwxr-xr-xTamTamSynthLab.activity/SynthLab/SynthLabConstants.py4
-rw-r--r--TamTamSynthLab.activity/SynthLab/SynthLabMain.py43
-rw-r--r--TamTamSynthLab.activity/TamTamSynthLab.py9
-rwxr-xr-xTamTamSynthLab.activity/icons/sl-mic+.svg29
-rw-r--r--TamTamSynthLab.activity/icons/sl-mic-menu.svg26
6 files changed, 60 insertions, 56 deletions
diff --git a/TamTamSynthLab.activity/MANIFEST b/TamTamSynthLab.activity/MANIFEST
index f3497bf..055a4d2 100644
--- a/TamTamSynthLab.activity/MANIFEST
+++ b/TamTamSynthLab.activity/MANIFEST
@@ -88,14 +88,12 @@ common/Util/ControlStream.py
common/Util/Credits.py
common/Util/InstrumentDB.py
common/Util/InstrumentPanel.py
-common/Util/Instrument_.py
+common/Util/Instruments.py
common/Util/KeyboardWindow.py
common/Util/LoopSettings.py
common/Util/Network.py
common/Util/NoteDB.py
-common/Util/NoteLooper.py
common/Util/Profiler.py
-common/Util/Sound.py
common/Util/ThemeWidgets.py
common/Util/Trackpad.py
common/Util/__init__.py
@@ -125,6 +123,7 @@ common/Generation/__init__.py
common/Generation/bList.py
common/Resources/__init__.py
common/Resources/crop.csd
+common/Resources/cropSynthLab.csd
common/Resources/tamtamorc.csd
common/Resources/tooltips_en.py
common/Resources/tooltips_fr.py
diff --git a/TamTamSynthLab.activity/SynthLab/SynthLabConstants.py b/TamTamSynthLab.activity/SynthLab/SynthLabConstants.py
index 77ead26..0fcda29 100755
--- a/TamTamSynthLab.activity/SynthLab/SynthLabConstants.py
+++ b/TamTamSynthLab.activity/SynthLab/SynthLabConstants.py
@@ -73,18 +73,14 @@ class SynthLabConstants:
'chorus': [.5, 1., 5., .5, 0, 3, 0, 10, 0, 30, 0, 1, FLOAT, FLOAT, FLOAT]}
CONTROL_TYPES = ['lfo', 'rand', 'adsr', 'trackpadX', 'trackpadY']
- #CONTROL_TYPES_SEL = [type + 'sel' for type in CONTROL_TYPES]
CONTROL_TYPES_PLUS = [type + '+' for type in CONTROL_TYPES]
SOURCE_TYPES = ['fm', 'buzz', 'vco', 'pluck', 'noise', 'sample', 'voice', 'grain', 'addSynth', 'mic']
- #SOURCE_TYPES_SEL = [type + 'sel' for type in SOURCE_TYPES]
SOURCE_TYPES_PLUS = [type + '+' for type in SOURCE_TYPES]
FX_TYPES = ['wguide', 'distort','filter', 'ring', 'reverb', 'harmon', 'eq4band', 'chorus']
- #FX_TYPES_SEL = [type + 'sel' for type in FX_TYPES]
FX_TYPES_PLUS = [type + '+' for type in FX_TYPES]
OUTPUT_TYPE = ['adsr']
OUTPUT_TYPE_SEL = ['adsrsel']
CHOOSE_TYPE = [CONTROL_TYPES, SOURCE_TYPES, FX_TYPES, OUTPUT_TYPE]
- #CHOOSE_TYPE2 = [CONTROL_TYPES_SEL, SOURCE_TYPES_SEL, FX_TYPES_SEL, OUTPUT_TYPE_SEL]
CHOOSE_TYPE_PLUS = [CONTROL_TYPES_PLUS, SOURCE_TYPES_PLUS, FX_TYPES_PLUS]
# SynthLab Tooltips
diff --git a/TamTamSynthLab.activity/SynthLab/SynthLabMain.py b/TamTamSynthLab.activity/SynthLab/SynthLabMain.py
index 6622076..b6476d5 100644
--- a/TamTamSynthLab.activity/SynthLab/SynthLabMain.py
+++ b/TamTamSynthLab.activity/SynthLab/SynthLabMain.py
@@ -14,6 +14,8 @@ import commands
from sugar.graphics.toolcombobox import ToolComboBox
from common.Util.ThemeWidgets import BigComboBox
+import common.Util.Instruments
+import common.Util.InstrumentDB as InstrumentDB
import common.Config as Config
from common.Util.ThemeWidgets import *
from common.Util.CSoundClient import new_csound_client
@@ -35,6 +37,7 @@ class SynthLabMain(gtk.EventBox):
self.set_keep_above(False)
self.set_decorated(False)
self.activity = activity
+ self.instrumentDB = InstrumentDB.getRef()
self.csnd = new_csound_client()
self.csnd.setMasterVolume( 100.0 ) # csnd expects a range 0-100 for now
self.trackpad = Trackpad( self )
@@ -72,11 +75,14 @@ class SynthLabMain(gtk.EventBox):
self._presetToolbar.show()
loopPointsTable = []
- sample_names = [name for i in range( len( Config.INSTRUMENTS ) ) for name in Config.INSTRUMENTS.keys() if Config.INSTRUMENTS[ name ].instrumentId == i ]
- for inst in sample_names:
- loopStart = Config.INSTRUMENTS[ inst ].loopStart
- loopEnd = Config.INSTRUMENTS[ inst ].loopEnd
- crossDur = Config.INSTRUMENTS[ inst ].crossDur
+ self.sample_names = [name for i in range( len( self.instrumentDB.instNamed ) ) for name in self.instrumentDB.instNamed.keys() if self.instrumentDB.instNamed[ name ].instrumentId == i ]
+ print self.instrumentDB.instNamed
+ print self.sample_names
+ for inst in self.sample_names:
+ print self.instrumentDB.instNamed[ inst ].instrumentId
+ loopStart = self.instrumentDB.instNamed[ inst ].loopStart
+ loopEnd = self.instrumentDB.instNamed[ inst ].loopEnd
+ crossDur = self.instrumentDB.instNamed[ inst ].crossDur
loopPointsTable.extend( [ loopStart, loopEnd, crossDur ] )
mess = "f5755 0 512 -2 " + " " .join([str(n) for n in loopPointsTable])
self.csnd.inputMessage( mess )
@@ -86,7 +92,7 @@ class SynthLabMain(gtk.EventBox):
self.lineWidthMUL4 = self.lineWidth*4
self.lineWidthMUL4SQ = self.lineWidthMUL4*self.lineWidthMUL4
self.clockStart = 0
- self.sample_names = [name for i in range( len( Config.INSTRUMENTS ) ) for name in Config.INSTRUMENTS.keys() if Config.INSTRUMENTS[ name ].instrumentId == i ]
+ #self.sample_names = [name for i in range( len( Config.INSTRUMENTS ) ) for name in Config.INSTRUMENTS.keys() if Config.INSTRUMENTS[ name ].instrumentId == i ]
if as_window:
self.add_events(gtk.gdk.KEY_PRESS_MASK|gtk.gdk.KEY_RELEASE_MASK)
@@ -1140,6 +1146,19 @@ class SynthLabMain(gtk.EventBox):
mess = "f5504 0 32768 -1 " + "\"%s\" 0 0 0" % snd
self.csnd.inputMessage( mess )
time.sleep(.005)
+ if lastTable[4] == 6:
+ snd = self.sample_names[int(sourceParametersTable[1])]
+ self.csnd.load_instrument(snd)
+ if lastTable[5] == 6:
+ snd = self.sample_names[int(sourceParametersTable[5])]
+ self.csnd.load_instrument(snd)
+ if lastTable[6] == 6:
+ snd = self.sample_names[int(sourceParametersTable[9])]
+ self.csnd.load_instrument(snd)
+ if lastTable[7] == 6:
+ snd = self.sample_names[int(sourceParametersTable[13])]
+ self.csnd.load_instrument(snd)
+ time.sleep(.005)
def recordSound( self, widget, data ):
if widget.get_active() == True:
@@ -1412,14 +1431,4 @@ class SynthLabMain(gtk.EventBox):
f = shelve.open( Config.TAM_TAM_ROOT + '/common/Resources/SynthFiles/' + preset, 'r')
self.loadState(f)
f.close()
- self.handleSaveTemp()
-
- def initRadioButton( self, labelList, methodCallback, box ):
- for i in range( len( labelList ) ):
- label = labelList[i]
- if i == 0:
- button = ImageRadioButton( group = None, mainImg_path = Config.IMAGE_ROOT + label + '.png', altImg_path = Config.IMAGE_ROOT + label + 'sel.png' )
- else:
- button = ImageRadioButton( group = button, mainImg_path = Config.IMAGE_ROOT + label + '.png', altImg_path = Config.IMAGE_ROOT + label + 'sel.png' )
- button.connect( "toggled", methodCallback, i )
- box.pack_start( button, True, True )
+ self.handleSaveTemp() \ No newline at end of file
diff --git a/TamTamSynthLab.activity/TamTamSynthLab.py b/TamTamSynthLab.activity/TamTamSynthLab.py
index dd3b6d5..b115ec2 100644
--- a/TamTamSynthLab.activity/TamTamSynthLab.py
+++ b/TamTamSynthLab.activity/TamTamSynthLab.py
@@ -56,7 +56,7 @@ class TamTamSynthLab(activity.Activity):
self.set_canvas( self.synthLab )
-
+
self.synthLab.onActivate(arg = None)
self.show()
@@ -74,7 +74,7 @@ class TamTamSynthLab(activity.Activity):
if Config.DEBUG > 4: print "TamTam::preload returned after", time.time() - t
return True
-
+
def onActive(self, widget = None, event = None):
if widget.props.active == False:
csnd = new_csound_client()
@@ -82,7 +82,7 @@ class TamTamSynthLab(activity.Activity):
else:
csnd = new_csound_client()
csnd.connect(True)
-
+
def onKeyPress(self, widget, event):
pass
@@ -114,6 +114,7 @@ class TamTamSynthLab(activity.Activity):
self.ensure_dir(Config.TUNE_DIR)
self.ensure_dir(Config.SYNTH_DIR)
self.ensure_dir(Config.SNDS_DIR)
+ self.ensure_dir(Config.SNDS_INFO_DIR)
self.ensure_dir(Config.SCRATCH_DIR)
if not os.path.isdir(Config.PREF_DIR):
@@ -127,4 +128,4 @@ class TamTamSynthLab(activity.Activity):
self.synthLab.handleJournalLoad(file_path)
def write_file(self,file_path):
- self.synthLab.handleJournalSave(file_path)
+ self.synthLab.handleJournalSave(file_path)
diff --git a/TamTamSynthLab.activity/icons/sl-mic+.svg b/TamTamSynthLab.activity/icons/sl-mic+.svg
index 3e19ef1..fd55be3 100755
--- a/TamTamSynthLab.activity/icons/sl-mic+.svg
+++ b/TamTamSynthLab.activity/icons/sl-mic+.svg
@@ -4,8 +4,7 @@
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="80px" height="80px" viewBox="0 0 80 80" enable-background="new 0 0 80 80" xml:space="preserve">
<path fill="#51A425" stroke="#333333" stroke-linecap="square" d="M5.221,13.415c0-3.891,5.639-8.679,10.206-8.679h48.479
- c4.568,0,10.207,4.789,10.207,8.679v32.205c0,16.188-15.414,29.311-34.446,29.311c-19.033,0-34.446-13.122-34.446-29.311V13.415z"/>
-<line fill="none" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" x1="18.862" y1="17.083" x2="18.862" y2="59.985"/>
+ c4.568,0,10.207,4.789,10.207,8.679V45.62c0,16.188-15.414,29.312-34.446,29.312c-19.033,0-34.446-13.123-34.446-29.312V13.415z"/>
<path fill="#F5D04E" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" d="M10.417,5.818
c0-2.758,2.326-4.985,5.195-4.985c2.88,0,5.207,2.228,5.207,4.985c0,2.745-2.327,4.986-5.207,4.986
C12.743,10.804,10.417,8.563,10.417,5.818z"/>
@@ -13,16 +12,20 @@
c0-2.758,2.326-4.985,5.207-4.985c2.868,0,5.195,2.228,5.195,4.985c0,2.745-2.327,4.986-5.195,4.986
C28.34,10.804,26.015,8.563,26.015,5.818z"/>
<path fill="#F5D04E" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" d="M42.917,5.818
- c0-2.758,2.326-4.985,5.194-4.985c2.881,0,5.208,2.228,5.208,4.985c0,2.745-2.327,4.986-5.208,4.986
+ c0-2.758,2.326-4.985,5.194-4.985c2.881,0,5.207,2.228,5.207,4.985c0,2.745-2.326,4.986-5.207,4.986
C45.243,10.804,42.917,8.563,42.917,5.818z"/>
-<path fill="#F5D04E" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" d="M59.819,5.818
- c0-2.758,2.327-4.985,5.194-4.985c2.87,0,5.209,2.228,5.209,4.985c0,2.745-2.339,4.986-5.209,4.986
- C62.146,10.804,59.819,8.563,59.819,5.818z"/>
-<path fill="#DF3800" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" d="M34.299,73.847
- c0-2.744,2.339-4.984,5.207-4.984c2.869,0,5.195,2.24,5.195,4.984c0,2.758-2.326,4.986-5.195,4.986
- C36.638,78.833,34.299,76.604,34.299,73.847z"/>
-<path fill-rule="evenodd" clip-rule="evenodd" fill="#333333" d="M25.582,25.87c1,2,2.25,4,3.25,7c3-2,4-5,5-8c2,1,4,6,6,8
- c2-2,3-5,4-8c3,2,3,5,6,8c2-2,3-5,4-8h3c0,2,2,5,3,8c1,0,2-2,3-3v16c-1-1-1-2-2-3c-2,3-4,7-5,10c-2-2-3-6-6-10c-2,3-3,7-5,10
- c-2-3-3-7-5-10c-2,3-3,7-5,10c-2-3-3-7-5-10c-2,3-4,7-5,10c-5-5-4-10-4-15v-3c0.25-6.12,3.75-10.12,2.62-11.62L25.582,25.87z"/>
-<line fill="none" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" x1="19.014" y1="39.278" x2="65.82" y2="39.278"/>
+<path fill="#F5D04E" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" d="M59.818,5.818
+ c0-2.758,2.328-4.985,5.195-4.985c2.868,0,5.209,2.228,5.209,4.985c0,2.745-2.341,4.986-5.209,4.986
+ C62.146,10.804,59.818,8.563,59.818,5.818z"/>
+<path fill="#DF3800" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" d="M34.299,73.848
+ c0-2.744,2.339-4.983,5.207-4.983c2.869,0,5.195,2.239,5.195,4.983c0,2.758-2.326,4.985-5.195,4.985
+ C36.638,78.833,34.299,76.604,34.299,73.848z"/>
+<circle fill="none" stroke="#333333" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" cx="54.128" cy="25.592" r="8.263"/>
+<rect x="35.613" y="27.37" transform="matrix(0.7071 0.7071 -0.7071 0.7071 39.9056 -15.6601)" fill="none" stroke="#333333" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" width="6.485" height="25.942"/>
+<path fill="none" stroke="#333333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M29.5,49.167
+ c-1.333,1.333-5.88,2.294-2.833,7.167c0.833,1.333,3.5,3.499,1.167,7.666"/>
+<path fill="none" stroke="#333333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M50,20.667
+ c0.667,6.5,5.334,8.667,9.834,10.667"/>
+<path fill="none" stroke="#333333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M38.417,32.854
+ c-0.86,0.522-1.802,1.527-2.552,2.219c-0.273,0.252-0.506,0.482-0.636,0.781"/>
</svg>
diff --git a/TamTamSynthLab.activity/icons/sl-mic-menu.svg b/TamTamSynthLab.activity/icons/sl-mic-menu.svg
index 525b290..a892caa 100644
--- a/TamTamSynthLab.activity/icons/sl-mic-menu.svg
+++ b/TamTamSynthLab.activity/icons/sl-mic-menu.svg
@@ -3,19 +3,15 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="80px" height="80px" viewBox="0 0 80 80" enable-background="new 0 0 80 80" xml:space="preserve">
-<g>
- <path fill="#51A425" stroke="#333333" stroke-linecap="square" d="M9.667,17.252c0-3.326,4.911-7.418,8.889-7.418h42.222
- c3.979,0,8.89,4.093,8.89,7.418v27.527c0,13.838-13.424,25.055-30,25.055c-16.577,0-30-11.217-30-25.055V17.252z"/>
-
- <line fill="none" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" x1="21.547" y1="20.388" x2="21.547" y2="57.058"/>
- <path fill="#333333" d="M27.4,27.898c0.871,1.709,1.96,3.419,2.831,5.983c2.613-1.709,3.484-4.273,4.354-6.838
- c1.742,0.855,3.484,5.128,5.226,6.838c1.742-1.709,2.613-4.273,3.484-6.838c2.612,1.709,2.612,4.274,5.226,6.838
- c1.741-1.709,2.612-4.273,3.483-6.838h2.612c0,1.709,1.742,4.274,2.613,6.838c0.871,0,1.741-1.709,2.612-2.564v13.676
- c-0.871-0.854-0.871-1.709-1.741-2.564c-1.742,2.564-3.484,5.983-4.355,8.548c-1.741-1.709-2.612-5.129-5.225-8.548
- c-1.742,2.564-2.613,5.983-4.355,8.548c-1.741-2.564-2.612-5.983-4.354-8.548c-1.742,2.564-2.613,5.983-4.354,8.548
- c-1.742-2.564-2.613-5.983-4.354-8.548c-1.742,2.564-3.484,5.983-4.354,8.548c-4.355-4.273-3.484-8.548-3.484-12.821v-2.564
- c0.218-5.231,3.266-8.65,2.282-9.933L27.4,27.898z"/>
-
- <line fill="none" stroke="#333333" stroke-linecap="round" stroke-linejoin="round" x1="21.68" y1="39.358" x2="62.444" y2="39.358"/>
-</g>
+<path fill="#51A425" stroke="#333333" stroke-linecap="square" d="M9.667,17.252c0-3.326,4.911-7.418,8.889-7.418h42.221
+ c3.979,0,8.891,4.093,8.891,7.418v27.527c0,13.838-13.424,25.055-30,25.055c-16.577,0-30-11.217-30-25.055L9.667,17.252
+ L9.667,17.252z"/>
+<circle fill="none" stroke="#333333" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" cx="51.269" cy="27.362" r="6.745"/>
+<rect x="36.157" y="28.813" transform="matrix(0.7071 0.7071 -0.7071 0.7071 39.2253 -15.8988)" fill="none" stroke="#333333" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" width="5.294" height="21.173"/>
+<path fill="none" stroke="#333333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M31.167,46.604
+ c-1.088,1.088-4.799,1.872-2.312,5.85c0.68,1.088,2.857,2.855,0.953,6.257"/>
+<path fill="none" stroke="#333333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M47.899,23.342
+ c0.545,5.305,4.354,7.074,8.026,8.707"/>
+<path fill="none" stroke="#333333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M38.445,33.29
+ c-0.702,0.426-1.471,1.247-2.083,1.811c-0.224,0.206-0.413,0.394-0.519,0.638"/>
</svg>