Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNat <Nat@localhost.localdomain>2007-02-27 07:31:25 (GMT)
committer Nat <Nat@localhost.localdomain>2007-02-27 07:31:25 (GMT)
commit5de6e3bae28a282339a5e6e4951e82c796a1655a (patch)
treeae895d1426587c92416e591c3f90194ae21a01bc
parentb56740d0a6f67c44b4a56b38e19968e2aaf51dae (diff)
Play sound on enter icon
-rw-r--r--Edit/MainWindow.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/Edit/MainWindow.py b/Edit/MainWindow.py
index 4a18ef6..73e4157 100644
--- a/Edit/MainWindow.py
+++ b/Edit/MainWindow.py
@@ -10,6 +10,7 @@ from Util.NoteDB import NoteDB
from Util.CSoundClient import new_csound_client
from Util.InstrumentPanel import InstrumentPanel
from Util.InstrumentPanel import DrumPanel
+from Util.CSoundNote import CSoundNote
import time
@@ -78,7 +79,7 @@ class MainWindow( SubActivity ):
return box
def init_GUI():
- self.instrumentPanel = InstrumentPanel( self.donePickInstrument, enterMode = True )
+ self.instrumentPanel = InstrumentPanel( self.donePickInstrument, self.playInstrumentNote, enterMode = True )
self.drumPanel = DrumPanel( self.donePickDrum )
self.GUI = {}
self.GUI["2main"] = gtk.HBox()
@@ -754,6 +755,20 @@ class MainWindow( SubActivity ):
self.GUI["2drumButton"].load_pixmap( "main", self.GUI["2instrumentIcons"][drum] )
self.GUI["2drumButton"].load_pixmap( "alt", self.GUI["2instrumentIcons"][drum] )
self.GUI["2drumButton"].set_active( False )
+
+ def playInstrumentNote(self , instrument, secs_per_tick = 0.025):
+ self.csnd.play(
+ CSoundNote( onset = 0,
+ pitch = 36,
+ amplitude = 1,
+ pan = 0.5,
+ duration = 20,
+ trackId = 1,
+ fullDuration = False,
+ instrument = instrument,
+ instrumentFlag = instrument,
+ reverbSend = 0),
+ secs_per_tick)
#-----------------------------------
# generation functions