From 5de6e3bae28a282339a5e6e4951e82c796a1655a Mon Sep 17 00:00:00 2001 From: Nat Date: Tue, 27 Feb 2007 07:31:25 +0000 Subject: Play sound on enter icon --- 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 -- cgit v0.9.1