diff options
24 files changed, 234 insertions, 71 deletions
diff --git a/TamTamEdit.activity/Edit/MainWindow.py b/TamTamEdit.activity/Edit/MainWindow.py index 4ccb7d5..520c50f 100644 --- a/TamTamEdit.activity/Edit/MainWindow.py +++ b/TamTamEdit.activity/Edit/MainWindow.py @@ -848,7 +848,9 @@ class MainWindow( gtk.EventBox ): def pickInstrument( self, widget, num, primary = True ): self.last_clicked_instTrackID = num self.last_clicked_instPrimary = primary + exec 'self.GUI["2instrument%sPalette"].skip = True' % str(num+1) exec 'self.GUI["2instrument%sPalette"].setCategory("all")' % str(num+1) # Select the first category + exec 'self.GUI["2instrument%sPalette"].skip = False' % str(num+1) if primary or self.trackInstrument2[num] == None: exec 'self.GUI["2instrument%sPalette"].setInstrument(self.trackInstrument[num].name)' % str(num+1) else: @@ -2148,9 +2150,11 @@ class instrumentPalette( Popup ): category = widget.props.value.lower() instruments = self.getInstruments(category) self.loadInstrumentMenu(instruments) - self.skip = True - self.instrumentBox1.set_active(0) - self.skip = False + #self.skip = True + #self.instrumentBox1.set_active(0) + if not self.skip: + self.instrumentBox1.popup() + #self.skip = False def setCategory(self, category): self.categoryBox.set_active(self.categories.index(category.capitalize())) diff --git a/TamTamEdit.activity/NEWS b/TamTamEdit.activity/NEWS index 8120a07..d678be6 100644 --- a/TamTamEdit.activity/NEWS +++ b/TamTamEdit.activity/NEWS @@ -1,8 +1,16 @@ +41 + + +40 + +* Proper activity split (Flipo, Olipet) +* New instrument picker (Flipo) + 39 * New activity : TamTamJam (lync) * Activities are now separate (TamTamJam, TamTamEdit, TamTamSynthLab) -* No sound when set to language other than english fixed (#3165) (J5, marcopg, tomeu, Flipo) +* No sound when set to language other than english fixed (#3165) (J5, marcopg, tomeu, Flipo, ethrop) 38 diff --git a/TamTamEdit.activity/activity/activity.info b/TamTamEdit.activity/activity/activity.info index 275a2c4..c10b4fd 100644 --- a/TamTamEdit.activity/activity/activity.info +++ b/TamTamEdit.activity/activity/activity.info @@ -3,4 +3,4 @@ name = TamTamEdit service_name = org.laptop.TamTamEdit icon = activity-tamtamedit class = TamTamEdit.TamTamEdit -activity_version = 40 +activity_version = 41 diff --git a/TamTamJam.activity/Jam/JamMain.py b/TamTamJam.activity/Jam/JamMain.py index e6418d8..1f63ead 100644 --- a/TamTamJam.activity/Jam/JamMain.py +++ b/TamTamJam.activity/Jam/JamMain.py @@ -294,7 +294,8 @@ class JamMain(gtk.EventBox): self.syncQueryStart = {} self.syncTimeout = None self.heartbeatLoop = self.csnd.loopCreate() - self.csnd.loopSetNumTicks( Config.TICKS_PER_BEAT, self.heartbeatLoop ) + self.syncBeats = 4 + self.csnd.loopSetNumTicks( self.syncBeats*Config.TICKS_PER_BEAT, self.heartbeatLoop ) self.heartbeatStart = time.time() self.csnd.loopStart( self.heartbeatLoop ) @@ -445,15 +446,14 @@ class JamMain(gtk.EventBox): def popInstrument( self ): self.instrument = self.instrumentStack.pop() - def _playDrum( self, id, pageId, volume, reverb, beats, regularity, loopId = None ): + def _playDrum( self, id, pageId, volume, reverb, beats, regularity, loopId = None, sync = True ): if loopId == None: # create new loop - startTick = 0 - firstTime = True + if sync: startTick = self.csnd.loopGetTick( self.heartbeatLoop ) + else: startTick = 0 else: # update loop startTick = self.csnd.loopGetTick( loopId ) self.csnd.loopDestroy( loopId ) - firstTime = False loopId = self.csnd.loopCreate() @@ -481,24 +481,23 @@ class JamMain(gtk.EventBox): self.drumFillin.play() + while startTick > ticks: + startTick -= ticks + # sync to heartbeat - if False: # firstTime: # always force first note to play rather than snaping to nearest beat.. good idea? - startTick = ticks - Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) - else: - while startTick > ticks: # align with last beat - startTick -= Config.TICKS_PER_BEAT + if sync: beatTick = int(startTick) % Config.TICKS_PER_BEAT - heartTick = self.csnd.loopGetTick( self.heartbeatLoop ) - if beatTick > heartTick: - if beatTick - heartTick < heartTick + Config.TICKS_PER_BEAT - beatTick: - startTick = (int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) + syncTick = self.csnd.loopGetTick( self.heartbeatLoop ) % Config.TICKS_PER_BEAT + if beatTick > syncTick: + if beatTick - syncTick < syncTick + Config.TICKS_PER_BEAT - beatTick: + startTick = (int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + syncTick else: - startTick = (1 + int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) + startTick = (1 + int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + syncTick else: - if heartTick - beatTick < beatTick + Config.TICKS_PER_BEAT - heartTick: - startTick = (int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) + if syncTick - beatTick < beatTick + Config.TICKS_PER_BEAT - syncTick: + startTick = (int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + syncTick else: - startTick = (-1 + int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) + startTick = (-1 + int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + syncTick if startTick >= ticks: startTick -= ticks @@ -518,7 +517,8 @@ class JamMain(gtk.EventBox): def _playLoop( self, id, volume, reverb, tune, loopId = None, force = False, sync = True ): if loopId == None: # create new loop - startTick = 0 + if sync: startTick = self.csnd.loopGetTick( self.heartbeatLoop ) + else: startTick = 0 else: # update loop startTick = self.csnd.loopGetTick( loopId ) self.csnd.loopDestroy( loopId ) @@ -548,22 +548,23 @@ class JamMain(gtk.EventBox): self.csnd.loopSetNumTicks( offset, loopId ) - while startTick > offset: # align with last beat - startTick -= Config.TICKS_PER_BEAT - - if sync: # sync to heartbeat + while startTick > offset: + startTick -= offset + + # sync to heartbeat + if sync: beatTick = startTick % Config.TICKS_PER_BEAT - syncTick = self.csnd.loopGetTick( self.heartbeatLoop ) + syncTick = self.csnd.loopGetTick( self.heartbeatLoop ) % Config.TICKS_PER_BEAT if beatTick > syncTick: if beatTick - syncTick < syncTick + Config.TICKS_PER_BEAT - beatTick: - startTick = (int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) + startTick = (int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + syncTick else: - startTick = (1 + int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) + startTick = (1 + int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + syncTick else: if syncTick - beatTick < beatTick + Config.TICKS_PER_BEAT - syncTick: - startTick = (int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) + startTick = (int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + syncTick else: - startTick = (-1 + int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + self.csnd.loopGetTick( self.heartbeatLoop ) + startTick = (-1 + int(startTick)//Config.TICKS_PER_BEAT)*Config.TICKS_PER_BEAT + syncTick if startTick >= offset: startTick -= offset @@ -581,7 +582,6 @@ class JamMain(gtk.EventBox): self.csnd.loopDestroy( loopId ) def addMetronome( self, page, period ): - self.noteDB.deleteNotesByTrack( [ page ], [ 1 ] ) baseCS = CSoundNote( 0, # onset @@ -926,6 +926,7 @@ class JamMain(gtk.EventBox): self.noteDB.dumpToStream( stream, True ) self.desktop.dumpToStream( stream ) + stream.sync_beats( self.syncBeats ) scratch.close() except IOError, (errno, strerror): @@ -1092,6 +1093,27 @@ class JamMain(gtk.EventBox): #========================================================== # Sync + def setSyncBeats( self, beats ): + self.jamToolbar.setSyncBeats( beats ) + + def _setSyncBeats( self, beats ): + if beats == self.syncBeats: + return + + self.syncBeats = beats + + ticks = beats * Config.TICKS_PER_BEAT + + curTick = self.csnd.loopGetTick( self.heartbeatLoop ) + + self.csnd.loopSetNumTicks( ticks, self.heartbeatLoop ) + while curTick > ticks: + curTick -= ticks + + self.csnd.loopSetTick( self.heartbeatLoop ) + + self.updateSync() + def nextHeartbeat( self ): delta = time.time() - self.heartbeatStart return self.beatDuration - (delta % self.beatDuration) @@ -1121,7 +1143,7 @@ class JamMain(gtk.EventBox): return True def correctSync( self ): - curTick = self.csnd.loopGetTick( self.heartbeatLoop ) + curTick = self.csnd.loopGetTick( self.heartbeatLoop ) % Config.TICKS_PER_BEAT curTicksIn = curTick % Config.TICKS_PER_BEAT ticksIn = self.heartbeatElapsedTicks() err = curTicksIn - ticksIn diff --git a/TamTamJam.activity/Jam/Picker.py b/TamTamJam.activity/Jam/Picker.py index 167904c..5609e56 100644 --- a/TamTamJam.activity/Jam/Picker.py +++ b/TamTamJam.activity/Jam/Picker.py @@ -34,7 +34,11 @@ class Picker( gtk.HBox ): self.desktop = owner.getDesktop() - self.scrollLeft = gtk.Button( "<" ) + self.scrollLeftImg = gtk.Image() + self.scrollLeftImg.set_from_icon_name('go-left', gtk.ICON_SIZE_BUTTON) + self.scrollLeft = gtk.Button( label = None ) + self.scrollLeft.set_relief(gtk.RELIEF_NONE) + self.scrollLeft.set_image(self.scrollLeftImg) self.scrollLeft.connect( "clicked", self.doScroll, "left" ) self.pack_start( self.scrollLeft, False, False ) @@ -45,7 +49,11 @@ class Picker( gtk.HBox ): self.hadjustment.connect( "changed", self.scrollChanged ) self.hadjustment.connect( "value-changed", self.scrollChanged ) - self.scrollRight = gtk.Button( ">" ) + self.scrollRightImg = gtk.Image() + self.scrollRightImg.set_from_icon_name('go-right', gtk.ICON_SIZE_BUTTON) + self.scrollRight = gtk.Button( label = None ) + self.scrollRight.set_relief(gtk.RELIEF_NONE) + self.scrollRight.set_image(self.scrollRightImg) self.scrollRight.connect( "clicked", self.doScroll, "right" ) self.pack_start( self.scrollRight, False, False ) diff --git a/TamTamJam.activity/Jam/Popup.py b/TamTamJam.activity/Jam/Popup.py index 7ca17d0..9268870 100644 --- a/TamTamJam.activity/Jam/Popup.py +++ b/TamTamJam.activity/Jam/Popup.py @@ -910,7 +910,7 @@ class Loop( Popup ): self.noteDB.deleteNote( n.page, n.track, n.id ) else: break - self.recordLoop = self.owner._playLoop( self.instrument["id"], self.instrument["amplitude"], self.instrument["reverb"], [ self.curPage ], self.recordLoop, force = True ) + self.recordLoop = self.owner._playLoop( self.instrument["id"], self.instrument["amplitude"], self.instrument["reverb"], [ self.curPage ], self.recordLoop, force = True, sync = False ) def _record_timeout( self ): self.updatePlayhead() diff --git a/TamTamJam.activity/Jam/Toolbars.py b/TamTamJam.activity/Jam/Toolbars.py index 30001ef..e3b255d 100644 --- a/TamTamJam.activity/Jam/Toolbars.py +++ b/TamTamJam.activity/Jam/Toolbars.py @@ -7,6 +7,8 @@ from gettext import gettext as _ from sugar.graphics.palette import Palette, WidgetInvoker from sugar.graphics.radiotoolbutton import RadioToolButton +from sugar.graphics.combobox import ComboBox +from sugar.graphics.toolcombobox import ToolComboBox import common.Config as Config @@ -25,7 +27,7 @@ class JamToolbar( gtk.Toolbar ): self.volumeAdjustment = gtk.Adjustment( 0.0, 0, 1.0, 0.1, 0.1, 0 ) self.volumeAdjustment.connect( 'value-changed', self.handleVolume ) self.volumeSlider = gtk.HScale( adjustment = self.volumeAdjustment ) - self.volumeSlider.set_size_request( 450, -1 ) + self.volumeSlider.set_size_request( 300, -1 ) self.volumeSlider.set_draw_value( False ) self._add_tooltip( self.volumeSlider, _("Master Volume") ) self._insert_widget( self.volumeSlider, -1 ) @@ -38,12 +40,37 @@ class JamToolbar( gtk.Toolbar ): self.tempoAdjustment = gtk.Adjustment( Config.PLAYER_TEMPO_LOWER, Config.PLAYER_TEMPO_LOWER, Config.PLAYER_TEMPO_UPPER+1, 10, 10, 0 ) self.tempoAdjustment.connect( 'value-changed', self.handleTempo ) self.tempoSlider = gtk.HScale( adjustment = self.tempoAdjustment ) - self.tempoSlider.set_size_request( 450, -1 ) + self.tempoSlider.set_size_request( 300, -1 ) self.tempoSlider.set_draw_value( False ) self._add_tooltip( self.tempoSlider, _("Tempo") ) self._insert_widget( self.tempoSlider, -1 ) self._insert_widget( self.tempoImg, -1 ) + self._insert_separator( True ) + + label = gtk.Label( _("Sync to:") ) + self.syncLabel = gtk.ToolItem() + self.syncLabel.add( label ) + self.insert( self.syncLabel, -1 ) + + self.comboBox = ComboBox() + self.comboBox.append_item( 1, _("1 Beat") ) + self.comboBox.append_item( 2, _("2 Beats") ) + self.comboBox.append_item( 3, _("3 Beats") ) + self.comboBox.append_item( 4, _("4 Beats") ) + self.comboBox.append_item( 5, _("5 Beats") ) + self.comboBox.append_item( 6, _("6 Beats") ) + self.comboBox.append_item( 7, _("7 Beats") ) + self.comboBox.append_item( 8, _("8 Beats") ) + self.comboBox.append_item( 9, _("9 Beats") ) + self.comboBox.append_item( 10, _("10 Beats") ) + self.comboBox.append_item( 11, _("11 Beats") ) + self.comboBox.append_item( 12, _("12 Beats") ) + self.comboBox.set_active( 4 - 1 ) # default 4 beats + self.comboBox.connect( "changed", self.changeSync ) + self.syncBox = ToolComboBox( self.comboBox ) + self.insert( self.syncBox, -1 ) + self.show_all() #def _add_palette( self, widget, palette, position = Palette.DEFAULT ): @@ -67,6 +94,12 @@ class JamToolbar( gtk.Toolbar ): separator.set_expand( expand ) self.insert( separator, -1 ) + def setSyncBeats( self, beats ): + self.comboBox.set_active( beats - 1 ) + + def changeSync( self, widget ): + self.owner._setSyncBeats( widget.get_active() + 1 ) + def mapRange( self, value, ilower, iupper, olower, oupper ): if value == iupper: return oupper @@ -126,4 +159,3 @@ class DesktopToolbar( gtk.Toolbar ): def setDesktop( self, widget, which ): if widget.get_active(): self.owner._setDesktop( which ) - diff --git a/TamTamJam.activity/NEWS b/TamTamJam.activity/NEWS index 8120a07..15061cc 100644 --- a/TamTamJam.activity/NEWS +++ b/TamTamJam.activity/NEWS @@ -1,3 +1,12 @@ +41 + +40 + +* Proper activity split (Flipo, Olipet) +* Numerous bug fixes (lync) +* Removed extra categories (Olipet, Flipo) +* Added more loops (JM, Olipet) + 39 * New activity : TamTamJam (lync) diff --git a/TamTamJam.activity/activity/activity.info b/TamTamJam.activity/activity/activity.info index 8def01b..4a91343 100644 --- a/TamTamJam.activity/activity/activity.info +++ b/TamTamJam.activity/activity/activity.info @@ -3,4 +3,4 @@ name = TamTamJam service_name = org.laptop.TamTamJam icon = activity-tamtamjam class = TamTamJam.TamTamJam -activity_version = 40 +activity_version = 41 diff --git a/TamTamMini.activity/MANIFEST b/TamTamMini.activity/MANIFEST index b4b8114..67d6985 100644 --- a/TamTamMini.activity/MANIFEST +++ b/TamTamMini.activity/MANIFEST @@ -3,7 +3,7 @@ NEWS setup.py Config.py TamTamMini.py -activity/activity-tamtam.svg +activity/activity-tamtammini.svg activity/activity.info icons/keyrec.svg icons/loop.svg diff --git a/TamTamMini.activity/Mini/miniTamTamMain.py b/TamTamMini.activity/Mini/miniTamTamMain.py index c2b84eb..3b1a68c 100644 --- a/TamTamMini.activity/Mini/miniTamTamMain.py +++ b/TamTamMini.activity/Mini/miniTamTamMain.py @@ -47,6 +47,7 @@ class miniTamTamMain(gtk.EventBox): self.set_border_width(Config.MAIN_WINDOW_PADDING) self.firstTime = False + self.playing = False self.csnd = new_csound_client() self.timeout_ms = 50 self.instVolume = 50 @@ -412,6 +413,8 @@ class miniTamTamMain(gtk.EventBox): self.csnd.loopSetNumTicks( self.beat * Config.TICKS_PER_BEAT) self.drumFillin.unavailable( noteOnsets, notePitchs ) self.recordOverSensitivity( False ) + if self.playing: + self.csnd.loopStart() def adjustDrumVolume(self): for n in self.noteList: @@ -536,6 +539,7 @@ class miniTamTamMain(gtk.EventBox): self.sequencer.stopPlayback() self.csnd.loopPause() widget.set_icon_widget(self.playButtonImg) + self.playing = False else: if not self.firstTime: self.regenerate() @@ -547,6 +551,7 @@ class miniTamTamMain(gtk.EventBox): self.csnd.loopSetTick( Config.TICKS_PER_BEAT*self.beat - int(round(nextInTicks)) ) self.csnd.loopStart() widget.set_icon_widget(self.stopButtonImg) + self.playing = True def handleGenerationDrumBtn(self , widget , data): diff --git a/TamTamMini.activity/NEWS b/TamTamMini.activity/NEWS index 8120a07..21bf4bc 100644 --- a/TamTamMini.activity/NEWS +++ b/TamTamMini.activity/NEWS @@ -1,3 +1,7 @@ +40 + +* Proper activity split (Flipo, Olipet) + 39 * New activity : TamTamJam (lync) diff --git a/TamTamMini.activity/activity/activity-tamtam.svg b/TamTamMini.activity/activity/activity-tamtam.svg deleted file mode 100644 index 563df7b..0000000 --- a/TamTamMini.activity/activity/activity-tamtam.svg +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ - <!ENTITY stroke_color "#010101"> - <!ENTITY fill_color "#FFFFFF"> -]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="activity-tamtam"> - - <path d=" M9.653,18.199h35.54c0.772,0,1.4,0.628,1.4,1.403v2.362c0,0.771-0.628,1.401-1.4,1.401H9.653c-0.775,0-1.403-0.628-1.403-1.401 v-2.361C8.25,18.826,8.877,18.199,9.653,18.199z" display="inline" fill="&stroke_color;" id="path8" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/> - - <rect display="inline" fill="&fill_color;" height="22.128" id="rect10" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" width="33.139" x="10.852" y="23.365"/> - - <path d=" M9.653,45.493h35.54c0.772,0,1.4,0.627,1.4,1.401v2.362c0,0.775-0.628,1.405-1.4,1.405H9.653c-0.775,0-1.403-0.629-1.403-1.405 v-2.362C8.25,46.124,8.877,45.493,9.653,45.493z" display="inline" fill="&stroke_color;" id="path17" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/> - - <path d=" M10.851,45.491l8.544-22.126l7.896,22.125l7.926-22.126" display="inline" fill="none" id="path19" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/> - - <path d=" M43.987,45.491l-8.77-22.126" display="inline" fill="none" id="path21" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/> - - <line display="inline" fill="none" id="line27" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" x1="33.69" x2="48.336" y1="13.149" y2="5.948"/> - - <line display="inline" fill="none" id="line29" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" x1="6.042" x2="20.658" y1="2.213" y2="9.48"/> - - <path d=" M25.721,9.802c0.55,1.451-0.171,3.066-1.608,3.612c-1.437,0.545-3.049-0.188-3.599-1.639c-0.547-1.45,0.174-3.067,1.609-3.613 C23.561,7.62,25.172,8.352,25.721,9.802z" display="inline" fill="&fill_color;" id="path23" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.25"/> - - <path d=" M33.338,16.442c-1.04,1.125-2.798,1.189-3.928,0.144c-1.128-1.044-1.197-2.801-0.155-3.927c1.041-1.125,2.8-1.19,3.926-0.146 C34.31,13.558,34.381,15.316,33.338,16.442z" display="inline" fill="&fill_color;" id="path25" stroke="&stroke_color;" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.25"/> -</g></svg> - diff --git a/TamTamMini.activity/activity/activity-tamtammini.svg b/TamTamMini.activity/activity/activity-tamtammini.svg new file mode 100644 index 0000000..0b1a5a1 --- /dev/null +++ b/TamTamMini.activity/activity/activity-tamtammini.svg @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14576) -->
+<!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="55px" height="55px" viewBox="0 0 55 55" enable-background="new 0 0 55 55" xml:space="preserve">
+<g>
+ <path id="path8" fill="#010101" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="
+ M4.455,25.83h23.59c0.512,0,0.929,0.417,0.929,0.931v1.568c0,0.512-0.417,0.93-0.929,0.93H4.455c-0.515,0-0.931-0.417-0.931-0.93
+ v-1.566C3.524,26.247,3.939,25.83,4.455,25.83z"/>
+
+ <rect id="rect10" x="5.25" y="29.259" fill="#FFFFFF" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="21.995" height="14.687"/>
+ <path id="path17" fill="#010101" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="
+ M4.455,43.945h23.59c0.512,0,0.929,0.416,0.929,0.932v1.566c0,0.515-0.417,0.934-0.929,0.934H4.455
+ c-0.515,0-0.931-0.417-0.931-0.934v-1.566C3.524,44.365,3.939,43.945,4.455,43.945z"/>
+ <path id="path19" fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M5.25,43.945
+ l5.671-14.687l5.241,14.685l5.26-14.685"/>
+ <path id="path21" fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="
+ M27.242,43.945l-5.82-14.687"/>
+</g>
+<line id="line27" fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="20.305" y1="22.694" x2="29.119" y2="18.362"/>
+<line id="line29" fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="3.668" y1="16.114" x2="12.464" y2="20.487"/>
+<path id="path23" fill="#FFFFFF" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="
+ M15.51,20.681c0.331,0.873-0.103,1.845-0.968,2.173c-0.864,0.328-1.834-0.113-2.165-0.986c-0.33-0.872,0.104-1.845,0.968-2.173
+ C14.21,19.368,15.18,19.809,15.51,20.681z"/>
+<path id="path25" fill="#FFFFFF" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="
+ M20.094,24.676c-0.626,0.677-1.684,0.715-2.364,0.086c-0.679-0.627-0.721-1.686-0.094-2.362c0.626-0.678,1.685-0.717,2.363-0.088
+ C20.679,22.941,20.721,23.999,20.094,24.676z"/>
+<path fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M29.604,26.749"/>
+<path fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M29.266,9.782"/>
+<g>
+ <g id="XMLID_1_">
+ <g>
+ <path fill="#FFFFFF" d="M24.533,14.555l-7.044,4.876L17.407,5.393l7.126,5.772c0,0.021,0.397,0.305,20.951,0.631v2.545
+ L24.533,14.555z"/>
+ </g>
+ <g>
+ <path fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M45.483,11.796
+ c-20.554-0.326-20.951-0.61-20.951-0.631l-7.126-5.772l0.082,14.038l7.044-4.876l20.951-0.213V11.796z"/>
+ </g>
+ </g>
+
+ <line fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="36.449" y1="8.237" x2="36.449" y2="11.291"/>
+
+ <line fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="33.521" y1="8.237" x2="33.521" y2="11.291"/>
+
+ <line fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x1="30.467" y1="8.237" x2="30.467" y2="11.291"/>
+</g>
+<path fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M43.051,6.261"/>
+<path fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M40.778,25.476"/>
+<g>
+ <g id="XMLID_3_">
+ <g>
+ <path fill="#FFFFFF" d="M47.486,42.039c0.626,6.335-6.97,6.215-6.97,6.215h-0.068c0,0-7.604,0.12-6.97-6.215
+ c0.111-1.071,2.041-1.929,2.041-1.929s0.856-1.604,0.103-3.644l-1.286-3.326c0,0-0.643-5.247,5.684-5.247h0.926
+ c6.318,0,5.684,5.247,5.684,5.247l-1.285,3.326c-0.755,2.04,0.103,3.644,0.103,3.644S47.375,40.968,47.486,42.039z"/>
+ </g>
+ <g>
+ <path fill="none" stroke="#010101" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M40.945,27.894
+ c6.318,0,5.684,5.247,5.684,5.247l-1.285,3.326c-0.755,2.04,0.103,3.644,0.103,3.644s1.929,0.857,2.04,1.929
+ c0.626,6.335-6.97,6.215-6.97,6.215"/>
+ <path fill="none" stroke="#010101" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M40.02,27.894
+ c-6.326,0-5.684,5.247-5.684,5.247l1.286,3.326c0.754,2.04-0.103,3.644-0.103,3.644s-1.93,0.857-2.041,1.929
+ c-0.634,6.335,6.97,6.215,6.97,6.215"/>
+ </g>
+ </g>
+</g>
+<circle fill="#FFFFFF" stroke="#010101" stroke-linecap="round" stroke-linejoin="round" cx="40.588" cy="37.883" r="2.036"/>
+<g id="XMLID_2_">
+ <g>
+ <polygon fill="#FFFFFF" points="41.705,8.001 41.959,33.452 39.258,33.452 39.385,8.128 "/>
+ </g>
+ <g>
+ <polygon fill="none" stroke="#010101" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" points="41.705,8.001
+ 41.959,33.452 39.258,33.452 39.385,8.128 "/>
+ </g>
+</g>
+</svg>
diff --git a/TamTamMini.activity/activity/activity.info b/TamTamMini.activity/activity/activity.info index 14e41d2..25db6d8 100644 --- a/TamTamMini.activity/activity/activity.info +++ b/TamTamMini.activity/activity/activity.info @@ -1,6 +1,6 @@ [Activity] name = TamTamMini service_name = org.laptop.TamTamMini -icon = activity-tamtam +icon = activity-tamtammini class = TamTamMini.TamTamMini activity_version = 40
\ No newline at end of file diff --git a/TamTamSynthLab.activity/NEWS b/TamTamSynthLab.activity/NEWS index 8120a07..48dd547 100644 --- a/TamTamSynthLab.activity/NEWS +++ b/TamTamSynthLab.activity/NEWS @@ -1,3 +1,9 @@ +41 + +40 + +* Proper activity split (Flipo, Olipet) + 39 * New activity : TamTamJam (lync) diff --git a/TamTamSynthLab.activity/activity/activity.info b/TamTamSynthLab.activity/activity/activity.info index 1b45e4f..9f50d40 100644 --- a/TamTamSynthLab.activity/activity/activity.info +++ b/TamTamSynthLab.activity/activity/activity.info @@ -3,4 +3,4 @@ name = TamTamSynthLab service_name = org.laptop.TamTamSynthLab icon = activity-tamtamsynthlab class = TamTamSynthLab.TamTamSynthLab -activity_version = 40 +activity_version = 41 diff --git a/common/Resources/Desktops/desktop0 b/common/Resources/Desktops/desktop0 index 0dd6fd1..00e1a5f 100644 --- a/common/Resources/Desktops/desktop0 +++ b/common/Resources/Desktops/desktop0 @@ -3798,3 +3798,4 @@ block_add Instrument False 291 328 False {'volume': 0.5, 'reverb': 0, 'name': 'r block_add Loop False 386 328 True {'beats': 4, 'regularity': 0.80000000000000004, 'id': 197, 'key': 20, 'name': 'loop04_0'} block_add Loop False 463 328 True {'beats': 2, 'regularity': 0.80000000000000004, 'id': 190, 'key': None, 'name': 'loop02_0'} block_add Loop False 517 328 True {'beats': 2, 'regularity': 0.80000000000000004, 'id': 189, 'key': None, 'name': 'loop02_0'} +sync_beats 8 diff --git a/common/Resources/Desktops/desktop1 b/common/Resources/Desktops/desktop1 index 610444b..d51da98 100644 --- a/common/Resources/Desktops/desktop1 +++ b/common/Resources/Desktops/desktop1 @@ -6171,7 +6171,7 @@ note_add 9 327 0 27 38 0.737997319594 0.5 1.0 5 137 0.005 0.095 0.0 0.0 1000.0 1 note_add 10 327 0 27 42 0.671027963479 0.5 1.0 5 137 0.005 0.095 0.0 0.0 1000.0 1 mini note_add 11 327 0 33 40 0.727866267806 0.5 1.0 5 137 0.005 0.095 0.0 0.0 1000.0 1 mini note_add 12 327 0 33 48 0.674593053365 0.5 1.0 5 137 0.005 0.095 0.0 0.0 1000.0 1 mini -block_add Drum False 137 118 False {'name': 'drum5kit', 'regularity': 0.80000000000000004, 'id': 139, 'volume': 0.5, 'beats': 10, 'key': 61, 'reverb': 0.0, 'page': 235} +block_add Drum False 137 118 False {'name': 'drum1kit', 'regularity': 0.80000000000000004, 'id': 135, 'volume': 0.5, 'beats': 10, 'key': 61, 'reverb': 0.0, 'page': 235} block_add Instrument False 283 88 False {'volume': 0.5, 'reverb': 0, 'name': 'piano', 'pan': 0.5, 'id': 28} block_add Loop False 470 88 True {'key': 18, 'beats': 12, 'name': 'loop12_0', 'regularity': 0.80000000000000004, 'id': 239} block_add Loop False 731 88 True {'key': None, 'beats': 10, 'name': 'loop10_0', 'regularity': 0.80000000000000004, 'id': 234} @@ -6188,3 +6188,4 @@ block_add Instrument True 284 426 False {'volume': 0.5, 'reverb': 0, 'name': 'pi block_add Loop False 471 426 True {'key': 21, 'beats': 12, 'name': 'loop12_3', 'regularity': 0.80000000000000004, 'id': 236} block_add Loop False 732 426 True {'key': None, 'beats': 10, 'name': 'loop10_3', 'regularity': 0.80000000000000004, 'id': 231} block_add Loop False 947 426 True {'key': None, 'beats': 8, 'name': 'loop08_4', 'regularity': 0.80000000000000004, 'id': 227} +sync_beats 12 diff --git a/common/Resources/Desktops/desktop2 b/common/Resources/Desktops/desktop2 index b8395e1..e705e9f 100644 --- a/common/Resources/Desktops/desktop2 +++ b/common/Resources/Desktops/desktop2 @@ -396,3 +396,4 @@ block_add Instrument False 443 445 False {'volume': 0.5, 'reverb': 0, 'name': 'o block_add Loop False 550 445 True {'key': None, 'beats': 5, 'name': 'loop2', 'regularity': 0.80000000000000004, 'id': 82} block_add Loop False 638 445 True {'key': None, 'beats': 2, 'name': 'loop3', 'regularity': 0.80000000000000004, 'id': 81} block_add Drum False 233 354 False {'name': 'drum2kit', 'regularity': 0.32130953701001352, 'id': 134, 'volume': 0.5, 'beats': 9, 'key': None, 'reverb': 0.0, 'page': 78} +sync_beats 3 diff --git a/common/Util/Block.py b/common/Util/Block.py index 9b1abea..b1395b8 100644 --- a/common/Util/Block.py +++ b/common/Util/Block.py @@ -569,6 +569,8 @@ class Loop(Block): self.owner.getLoopImage( self.data["id"], True ) ] def destroy( self ): + if self.active: + self.owner.deactivateLoop( self ) if self.keyActive: self.owner.mapKey( None, self, self.data["key"] ) self.owner.noteDB.deletePages( [ self.data["id"] ] ) diff --git a/common/Util/CSoundClient.py b/common/Util/CSoundClient.py index 5f2e9bf..bdd6e97 100644 --- a/common/Util/CSoundClient.py +++ b/common/Util/CSoundClient.py @@ -140,7 +140,6 @@ class _CSoundClientPlugin: global _loop_default sc_loop_delete(_loop_default) _loop_default = sc_loop_new() - print 'loop cleared' # this is function deletes an Event from a loop # TODO: rename this function diff --git a/common/Util/ControlStream.py b/common/Util/ControlStream.py index de72fe2..4eeabc1 100644 --- a/common/Util/ControlStream.py +++ b/common/Util/ControlStream.py @@ -75,6 +75,9 @@ class TamTamOStream: def desktop_set( self, id ): self.file.write( "desktop_set %d\n" % id ) + def sync_beats( self, beats ): + self.file.write( "sync_beats %d\n" % beats ) + class TamTamTable: def __init__(self, noteDB = None, jam = None ): @@ -95,6 +98,7 @@ class TamTamTable: 'block_add':self.block_add, 'desktop_store':self.desktop_store, 'desktop_set':self.desktop_set, + 'sync_beats':self.sync_beats, 'sleep':self.sleep, 'quit':self.quit} @@ -215,6 +219,9 @@ class TamTamTable: def desktop_set( self, argv ): self.jam.setDesktop( int( argv[0] ), True ) + def sync_beats( self, argv ): + self.jam.setSyncBeats( int( argv[0] ) ) + def sleep(self, argv): t = float(argv[0]) print 'sleeping for %i seconds' % t diff --git a/scripts/create_symlinks.sh b/scripts/create_symlinks.sh index 71eab02..702b23b 100755 --- a/scripts/create_symlinks.sh +++ b/scripts/create_symlinks.sh @@ -4,3 +4,4 @@ rm -rf /usr/share/activities/TamTam* ln -s /home/olpc/tamtam/TamTamEdit.activity /usr/share/activities/TamTamEdit.activity ln -s /home/olpc/tamtam/TamTamJam.activity /usr/share/activities/TamTamJam.activity ln -s /home/olpc/tamtam/TamTamSynthLab.activity /usr/share/activities/TamTamSynthLab.activity +ln -s /home/olpc/tamtam/TamTamMini.activity /usr/share/activities/TamTamMini.activity |