Re: [Sndobj-devel] Mixing objects
Status: Abandoned
Brought to you by:
veplaini
From: Victor L. <vic...@nu...> - 2007-07-26 22:25:17
|
I think the best way of doing this is to use only one SndThread object (not a separate one for each SndObj). Then you can create mixers for each group of SndObjs that you want to mix together and one main mixer that mixes all the separate sub-mixes. Using several threads might not be the most efficient way of doing this, although each thread will end up being mixed with the others (depending on the OS, on Linux this might not happen). Victor > > > Hi! > > Here is the example code: > import sndobj > import time > > class Play(object): > def __init__(self, frq, amp): > self.frq = frq > self.amp = amp > self.tab = sndobj.HarmTable() > self.osc = sndobj.Oscili(self.tab, frq, amp) > self.outp = sndobj.SndRTIO(1) > self.outp.SetOutput(1,self.osc) > self.thread = sndobj.SndThread() > self.thread.AddObj(self.osc) > self.thread.AddObj(self.outp, sndobj.SNDIO_OUT) > def onOff(self,switch): > if switch == 'on': > self.thread.ProcOn() > elif switch == 'off': > self.thread.ProcOff() > > obj1 = Play(100,5000) > obj2 = Play(170,3000) > obj3 = Play(300,2000) > obj1.onOff('on') > obj2.onOff('on') > obj3.onOff('on') > time.sleep(5) > obj1.onOff('off') > obj2.onOff('off') > obj3.onOff('off') > > So it's a simple class and I made 3 object's from it. How > can I mix i.e. just 1st and 3rd object so I can add some > eff just on them? Thanks. > > Bosko > > > ---------------------------------------------------------- > --------------- This SF.net email is sponsored by: Splunk > Inc. Still grepping through log files to find problems? > Stop. Now Search log events and configuration files using > AJAX and a browser. Download your FREE copy of Splunk now > >> http://get.splunk.com/ > > > _______________________________________________ > Sndobj-devel mailing list > Snd...@li... > https://lists.sourceforge.net/lists/listinfo/sndobj-devel > |