sndobj-devel Mailing List for The Sound Object Library (Page 15)
Status: Abandoned
Brought to you by:
veplaini
This list is closed, nobody may subscribe to it.
2007 |
Jan
(57) |
Feb
(16) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
(8) |
Aug
(24) |
Sep
(12) |
Oct
(4) |
Nov
(11) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(9) |
Feb
(13) |
Mar
(3) |
Apr
(10) |
May
(11) |
Jun
(12) |
Jul
(8) |
Aug
(9) |
Sep
(1) |
Oct
(24) |
Nov
(11) |
Dec
(19) |
2009 |
Jan
(5) |
Feb
(24) |
Mar
(43) |
Apr
(9) |
May
(14) |
Jun
(28) |
Jul
|
Aug
(6) |
Sep
|
Oct
(4) |
Nov
(10) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(9) |
Dec
|
2011 |
Jan
(3) |
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Victor L. <vic...@nu...> - 2007-08-11 07:49:02
|
yes, a SetSr() method would have to close the device/file/etc, that's why it's not there. Regards Victor > > Hi > It also occurs to me that adding a SetSr method to SndIO > base class would be relatively easy but it has more side > effects cf the SetVectorSize method already there. > In fact I don't see that this would need to be much more > than void SndIO::SetSr(float sr){ > m_sr = sr; > } > > > Best > Ed > > On 8/11/07, Edward Hartley <ed....@gm...> wrote: > > > > Yes I've had that as well IIRC correctly I added some > > helper methods to the .i file for the video library I > > wrapped (I'd have to go back to it on another machine to > > check) but in this case another overloaded constructor > > added (I assume, correct me if I'm wrong) to > SndCoreAudio.cpp SndCoreAudio.h before rebuilding the > > library would be straightforward. I'll tackle that later > > on today. Cheers > > Ed > > > > On 8/10/07, Victor Lazzarini <vic...@nu...> > > > wrote: Another thing you can try straight away is to > > > use SndRTIO, which on OSX is effectively SndCoreAudio, > > > but with the important difference that its constructor > > > is > > > > > > SndRTIO(short ch, int mode, int bsize = DEF_BSIZE, > > > int period = DEF_PERIOD, int encoding = SHORTSAM, > > > SndObj** input=0, int vsize= DEF_VECSIZE, float > > > sr=DEF_SR, int dev = DEF_DEV) > > > > > > without any Uint32 (in fact, there is a slight bug in > > > there in that the conversion from int to uint is not > > > handled, but I can fix that if there is a problem). > > > > > > Victor > > > > > > > > > > > Problem is the constructor still expects 8 args not > > > > the 7 you suggest I introduced the sndobj.SND_OUTPUT > > > > argument to provide the 8th. I think this is a > > > > prototyping issue in SWIG though my close > > > > familiarity with SWIG predates the C++ extensions. > > > > However I note the the cpp source constructor is > > > > SndCoreAudio::SndCoreAudio(int channels,int > > > > bufframes, int buffnos, float norm, > > > > SndObj** inObjs, UInt32 dev, int vecsize, float sr) > > > i.e. 8 args the 6th being the device. > > > > > The python traceback remains as follows irrespective > > > > of whether 7 or 8 args are provided or whether > > > > sndobj.SND_OUTPUT or a python int is passed. > > > > > > > > > > > > File "aif.py", line 20, in <module> > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, > > > > objsp, 256, 22050.0) #wrong args number > > > > File > > > > "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" > > > > , line 2803, in __init__ this = > > > > _sndobj.new_SndCoreAudio(*args) NotImplementedError: > > > > Wrong number of arguments for overloaded function > > > > 'new_SndCoreAudio'. Possible C/C++ prototypes are: > > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > > ,int ,float) > > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > > ,int) SndCoreAudio(int,int,int,float,SndObj ** > > > > ,UInt32) SndCoreAudio(int,int,int,float,SndObj > > > > **) SndCoreAudio(int,int,int,float) > > > > SndCoreAudio(int,int,int) > > > > SndCoreAudio(int,int) > > > > SndCoreAudio(int) > > > > SndCoreAudio() > > > > > > > > I suspect that the constructor is looking for a C++ > > > > Uint32 in the 6th argument but where to pick an > > > > appropriate one from? > > > > > > > > if sndobj.DEF_DEV is substituted for the 6th arg the > > > > following traceback is obtained: > > > > 22050.0 256 which is reasonable enough as this is > > > > another function reference. > > > > > > > > Python(620,0xa000d000) malloc: *** Deallocation of > > > > a pointer not malloced: 0x613158; This could be a > > > > double free(), or free() called with the middle of > > > > an allocated block; Try setting environment variable > > > > MallocHelp to see tools to help debug > > > > Python(620,0xa000d000) malloc: *** Deallocation of a > > > > pointer not malloced: 0x709458; This could be a > > > > double free(), or free() called with the middle of > > > > an allocated block; Try setting environment variable > > > > MallocHelp to see tools to help debug > > > > Python(620,0xa000d000) malloc: *** Deallocation of > > > > a pointer not malloced: 0x7bdcf0; This could be a > double free(), or free() called with the middle of an > > > > allocated block; Try setting environment variable > > > > MallocHelp to see tools to help debug > > > > > > > > I can't see anything obvious in SndCoreAudio.h or > > > > AudioDefs.i Ed > > > > > > > > On 8/10/07, Victor Lazzarini > > > > > <vic...@nu...> wrote: Try > > > > > > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, > > > > > objsp ,256, 22050.0) > > > > > > > > > > There is no sndobj.SND_OUTPUT argument for > > > > > SndCoreAudio (it always opens full-duplex). > > > > > > > > > > Victor > > > > > > > > > > > > > > > > > > > > > > Thanks for the pointer to the solution however > > > > > > > > > > > > now I've removed the constructor > > > > > > > > > > > > outp = sndobj.SndCoreAudio() > > > > > > > > > > > > and after constructing aif1,aif2 replaced it > > > > > with > > > > > > > objs[0]=aif1 > > > > > > objs[1]=aif2 > > > > > > objsp = objs.cast() > > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, > > > > > > objsp) which as expected still produces output > > > > > > at the wrong sampling rate however if I extend > > > > > > this to outp = sndobj.SndCoreAudio(2, 512, 4, > > > > > > 32767.0, objsp , sndobj.SND_OUTPUT, 256, 22050) > > > > > > or > > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, > > > > > > objsp , 1) or variants in between I get > > > > > tracebacks similar to this > > > > > > > File "aif.py", line 20, in <module> > > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, > > > > > > 32767.0, objsp, 1) #, 256, 22050) #wrong args > > > > > > number File > > > > > > > > > > > > > "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" , line > > > > > > 2803, in __init__ this = > > > > > > _sndobj.new_SndCoreAudio(*args) > NotImplementedError: Wrong number of arguments for > > > > > > overloaded function 'new_SndCoreAudio'. > > > > > > Possible C/C++ prototypes are: > > > > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > > > > ,int ,float) SndCoreAudio(int,int,int,float > > > > > > ,SndObj **,UInt32 ,int) SndCoreAudio(int,int > > > > > > ,int,float,SndObj ** ,UInt32) > > > > > > SndCoreAudio(int,int,int,float,SndObj **) > > > > > > SndCoreAudio(int,int,int,float) > > > > > > SndCoreAudio(int,int,int) SndCoreAudio(int > > > > > > ,int) SndCoreAudio(int) > > > > > > SndCoreAudio() > > > > > > > > > > > > Best > > > > > > Ed > > > > > > > > > > > > On 8/9/07, Victor Lazzarini > > > > > > > <vic...@nu...> wrote: You will > > > > > > > need to set the SR on all objects to 22050. It > > > > > > > is generally the last argument (which defaults > > > > > > > to 44100) of each object. You have done it > > > > > > > with all SndObjs, but it looks like you left > > > > > > > the SndCoreAudio to its default. You need to > > > > > > create it with the right SR. > > > > > > > > Victor > > > > > > > > > > > > > > > > > > > > > > > Hi > > > > > > > > I've been tinkering with PySndObj on the Mac > > > > > > > > . BTW it built out of the box for python 2.5 > > > > > > > > with the MacPython framework and appropriate > > > > > > > > build switches to build the python wrapper. > > > > > > > > The examples work OK as does the I have now > > > > > > > > got to the point where I'm able to read an > > > > > > > > AIF file and providing it's a PCM file get > > > > > > > > it to play back OK apart from when the > > > > > > > > sampling rate is not the default 44100. In > > > > > > > > the case in question it is 22050 but it > > > > > > > > plays back as if 44100. (Thanks BTW to the > > > > > > > > wav file example post) I have tried the > commented options shown in the code below, I'm new to the > > > > > > > > API so I'm not sure if this is a bug or I'm > > > > > > > > not setting the sampling rate in the right > > > > > > > place. So suggestions welcomed. The example > > > > > > > > file is in the > > > > > > > > /Developer/Examples/Java/Sound source tree. > > > > > > > > > import sndobj fn = '22-new.aif' #fn = > > > > > > > > 'sound.aif' af = sndobj.SndAiff(fn > > > > > > > > ,sndobj.READ,2) sr = af.GetSr() > > > > > > > > vs = af.GetVectorSize() > > > > > > > > print sr,vs > > > > > > > > T1 = sndobj.SndThread() > > > > > > > > sndin = sndobj.SndIn(af,1) > > > > > > > > outp = sndobj.SndCoreAudio() > > > > > > > > aif1 = sndobj.SndIn(af,1) > > > > > > > > #aif1 = sndobj.SndIn(af,1,vs,sr) > > > > > > > > #aif1.SetSr(sr) > > > > > > > > aif2 = sndobj.SndIn(af,2) > > > > > > > > #aif2 = sndobj.SndIn(af,2, vs, sr) > > > > > > > > #aif2.SetSr(sr) > > > > > > > > outp.SetOutput(1,aif1) > > > > > > > > outp.SetOutput(2,aif2) > > > > > > > > T1.AddObj(af,sndobj.SNDIO_IN) > > > > > > > > T1.AddObj(aif1) > > > > > > > > T1.AddObj(aif2) > > > > > > > > T1.AddObj(outp,sndobj.SNDIO_OUT) > > > > > > > > T1.ProcOn() > > > > > > > > time.sleep(5) > > > > > > > > T1.ProcOff() > > > > > > > > > > > > > > > > TIA > > > > > > > > Ed > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------- > > > > > > > > --------------- 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 > > > > > > > |
From: Edward H. <ed....@gm...> - 2007-08-11 03:11:37
|
Hi It also occurs to me that adding a SetSr method to SndIO base class would be relatively easy but it has more side effects cf the SetVectorSize method already there. In fact I don't see that this would need to be much more than void SndIO::SetSr(float sr){ m_sr = sr; } Best Ed On 8/11/07, Edward Hartley <ed....@gm...> wrote: > > Yes I've had that as well IIRC correctly I added some helper methods > to the .i file for the video library I wrapped (I'd have to go back to > it on another machine to check) but in this case another > overloaded constructor added (I assume, correct me if I'm wrong) to > SndCoreAudio.cpp SndCoreAudio.h before rebuilding the library would be > straightforward. I'll tackle that later on today. > Cheers > Ed > > On 8/10/07, Victor Lazzarini <vic...@nu...> wrote: > > Another thing you can try straight away is to > > use SndRTIO, which on OSX is effectively SndCoreAudio, > > but with the important difference that its constructor > > is > > > > SndRTIO(short ch, int mode, int bsize = DEF_BSIZE, > > int period = DEF_PERIOD, int encoding = SHORTSAM, > > SndObj** input=0, int vsize= DEF_VECSIZE, float sr=DEF_SR, > > int dev = DEF_DEV) > > > > without any Uint32 (in fact, there is a slight bug in > > there in that the conversion from int to uint is not > > handled, but I can fix that if there is a problem). > > > > Victor > > > > > > > > Problem is the constructor still expects 8 args not the 7 > > > you suggest I introduced the sndobj.SND_OUTPUT argument to > > > provide the 8th. I think this is a prototyping issue in > > > SWIG though my close familiarity with SWIG predates the > > > C++ extensions. However I note the the cpp source > > > constructor is SndCoreAudio::SndCoreAudio(int channels,int > > > bufframes, int buffnos, float norm, SndObj** inObjs, > > > UInt32 dev, int vecsize, float sr) > > > i.e. 8 args the 6th being the device. > > > > > > The python traceback remains as follows irrespective of > > > whether 7 or 8 args are provided or whether > > > sndobj.SND_OUTPUT or a python int is passed. > > > > > > > > > File "aif.py", line 20, in <module> > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp, > > > 256, 22050.0) #wrong args number > > > File "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" > > > , line 2803, in __init__ > > > this = _sndobj.new_SndCoreAudio(*args) > > > NotImplementedError: Wrong number of arguments for > > > overloaded function 'new_SndCoreAudio'. > > > Possible C/C++ prototypes are: > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int > > > ,float) > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int) > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32) > > > SndCoreAudio(int,int,int,float,SndObj **) > > > SndCoreAudio(int,int,int,float) > > > SndCoreAudio(int,int,int) > > > SndCoreAudio(int,int) > > > SndCoreAudio(int) > > > SndCoreAudio() > > > > > > I suspect that the constructor is looking for a C++ Uint32 > > > in the 6th argument but where to pick an appropriate one > > > from? > > > > > > if sndobj.DEF_DEV is substituted for the 6th arg the > > > following traceback is obtained: > > > 22050.0 256 which is reasonable enough as this is another > > > function reference. > > > > > > Python(620,0xa000d000) malloc: *** Deallocation of a > > > pointer not malloced: 0x613158; This could be a double > > > free(), or free() called with the middle of an allocated > > > block; Try setting environment variable MallocHelp to see > > > tools to help debug Python(620,0xa000d000) malloc: *** > > > Deallocation of a pointer not malloced: 0x709458; This > > > could be a double free(), or free() called with the middle > > > of an allocated block; Try setting environment variable > > > MallocHelp to see tools to help debug > > > Python(620,0xa000d000) malloc: *** Deallocation of a > > > pointer not malloced: 0x7bdcf0; This could be a double > > > free(), or free() called with the middle of an allocated > > > block; Try setting environment variable MallocHelp to see > > > tools to help debug > > > > > > I can't see anything obvious in SndCoreAudio.h or > > > AudioDefs.i Ed > > > > > > On 8/10/07, Victor Lazzarini <vic...@nu...> > > > > wrote: Try > > > > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp > > > > ,256, 22050.0) > > > > > > > > There is no sndobj.SND_OUTPUT argument for > > > > SndCoreAudio (it always opens full-duplex). > > > > > > > > Victor > > > > > > > > > > > > > > > > > > Thanks for the pointer to the solution however > > > > > > > > > > now I've removed the constructor > > > > > > > > > > outp = sndobj.SndCoreAudio() > > > > > > > > > > and after constructing aif1,aif2 replaced it with > > > > > > > > > > objs[0]=aif1 > > > > > objs[1]=aif2 > > > > > objsp = objs.cast() > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp) > > > > > which as expected still produces output at the wrong > > > > > sampling rate however if I extend this to > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > > > > sndobj.SND_OUTPUT, 256, 22050) > > > > > or > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > > > > 1) or variants in between I get tracebacks similar to > > > > this > > > > > > File "aif.py", line 20, in <module> > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, > > > > > objsp, 1) #, 256, 22050) #wrong args number > > > > > File > > > > > "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" , > > > > > line 2803, in __init__ this = > > > > > _sndobj.new_SndCoreAudio(*args) NotImplementedError: > > > > > Wrong number of arguments for overloaded function > > > > > 'new_SndCoreAudio'. Possible C/C++ prototypes are: > > > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > > > ,int ,float) > > > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > > > ,int) SndCoreAudio(int,int,int,float,SndObj ** > > > > > ,UInt32) SndCoreAudio(int,int,int,float,SndObj **) > > > > > SndCoreAudio(int,int,int,float) > > > > > SndCoreAudio(int,int,int) > > > > > SndCoreAudio(int,int) > > > > > SndCoreAudio(int) > > > > > SndCoreAudio() > > > > > > > > > > Best > > > > > Ed > > > > > > > > > > On 8/9/07, Victor Lazzarini <vic...@nu...> > > > > > > wrote: You will need to set the SR on all objects > > > > > > to 22050. It is generally the last argument > > > > > > (which defaults to 44100) of each object. You > > > > > > have done it with all SndObjs, but it looks > > > > > > like you left the SndCoreAudio to its default. > > > > > > You need to create it with the right SR. > > > > > > > > > > > > Victor > > > > > > > > > > > > > > > > > > > > Hi > > > > > > > I've been tinkering with PySndObj on the Mac . > > > > > > > BTW it built out of the box for python 2.5 with > > > > > > > the MacPython framework and appropriate build > > > > > > > switches to build the python wrapper. The examples > > > > > > > work OK as does the I have now got to the point > > > > > > > where I'm able to read an AIF file and providing > > > > > > > it's a PCM file get it to play back OK apart from > > > > > > > when the sampling rate is not the default 44100. > > > > > > > In the case in question it is 22050 but it plays > > > > > > > back as if 44100. (Thanks BTW to the wav file > > > > > > > example post) I have tried the commented options > > > > > > > shown in the code below, I'm new to the API so I'm > > > > > > > not sure if this is a bug or I'm not setting the > > > > > > > sampling rate in the right place. So suggestions > > > > > > welcomed. The example file is in the > > > > > > > /Developer/Examples/Java/Sound source tree. > > > > > > > > import sndobj fn = '22-new.aif' > > > > > > > #fn = 'sound.aif' > > > > > > > af = sndobj.SndAiff(fn,sndobj.READ,2) > > > > > > > sr = af.GetSr() > > > > > > > vs = af.GetVectorSize() > > > > > > > print sr,vs > > > > > > > T1 = sndobj.SndThread() > > > > > > > sndin = sndobj.SndIn(af,1) > > > > > > > outp = sndobj.SndCoreAudio() > > > > > > > aif1 = sndobj.SndIn(af,1) > > > > > > > #aif1 = sndobj.SndIn(af,1,vs,sr) > > > > > > > #aif1.SetSr(sr) > > > > > > > aif2 = sndobj.SndIn(af,2) > > > > > > > #aif2 = sndobj.SndIn(af,2, vs, sr) > > > > > > > #aif2.SetSr(sr) > > > > > > > outp.SetOutput(1,aif1) > > > > > > > outp.SetOutput(2,aif2) > > > > > > > T1.AddObj(af,sndobj.SNDIO_IN) > > > > > > > T1.AddObj(aif1) > > > > > > > T1.AddObj(aif2) > > > > > > > T1.AddObj(outp,sndobj.SNDIO_OUT) > > > > > > > T1.ProcOn() > > > > > > > time.sleep(5) > > > > > > > T1.ProcOff() > > > > > > > > > > > > > > TIA > > > > > > > Ed > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------- > > > > > --------------- 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 > > > > > > > > |
From: Edward H. <ed....@gm...> - 2007-08-11 02:40:31
|
Yes I've had that as well IIRC correctly I added some helper methods to the .i file for the video library I wrapped (I'd have to go back to it on another machine to check) but in this case another overloaded constructor added (I assume, correct me if I'm wrong) to SndCoreAudio.cpp SndCoreAudio.h before rebuilding the library would be straightforward. I'll tackle that later on today. Cheers Ed On 8/10/07, Victor Lazzarini <vic...@nu...> wrote: > Another thing you can try straight away is to > use SndRTIO, which on OSX is effectively SndCoreAudio, > but with the important difference that its constructor > is > > SndRTIO(short ch, int mode, int bsize = DEF_BSIZE, > int period = DEF_PERIOD, int encoding = SHORTSAM, > SndObj** input=0, int vsize= DEF_VECSIZE, float sr=DEF_SR, > int dev = DEF_DEV) > > without any Uint32 (in fact, there is a slight bug in > there in that the conversion from int to uint is not > handled, but I can fix that if there is a problem). > > Victor > > > > > Problem is the constructor still expects 8 args not the 7 > > you suggest I introduced the sndobj.SND_OUTPUT argument to > > provide the 8th. I think this is a prototyping issue in > > SWIG though my close familiarity with SWIG predates the > > C++ extensions. However I note the the cpp source > > constructor is SndCoreAudio::SndCoreAudio(int channels,int > > bufframes, int buffnos, float norm, SndObj** inObjs, > > UInt32 dev, int vecsize, float sr) > > i.e. 8 args the 6th being the device. > > > > The python traceback remains as follows irrespective of > > whether 7 or 8 args are provided or whether > > sndobj.SND_OUTPUT or a python int is passed. > > > > > > File "aif.py", line 20, in <module> > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp, > > 256, 22050.0) #wrong args number > > File "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" > > , line 2803, in __init__ > > this = _sndobj.new_SndCoreAudio(*args) > > NotImplementedError: Wrong number of arguments for > > overloaded function 'new_SndCoreAudio'. > > Possible C/C++ prototypes are: > > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int > > ,float) > > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int) > > SndCoreAudio(int,int,int,float,SndObj **,UInt32) > > SndCoreAudio(int,int,int,float,SndObj **) > > SndCoreAudio(int,int,int,float) > > SndCoreAudio(int,int,int) > > SndCoreAudio(int,int) > > SndCoreAudio(int) > > SndCoreAudio() > > > > I suspect that the constructor is looking for a C++ Uint32 > > in the 6th argument but where to pick an appropriate one > > from? > > > > if sndobj.DEF_DEV is substituted for the 6th arg the > > following traceback is obtained: > > 22050.0 256 which is reasonable enough as this is another > > function reference. > > > > Python(620,0xa000d000) malloc: *** Deallocation of a > > pointer not malloced: 0x613158; This could be a double > > free(), or free() called with the middle of an allocated > > block; Try setting environment variable MallocHelp to see > > tools to help debug Python(620,0xa000d000) malloc: *** > > Deallocation of a pointer not malloced: 0x709458; This > > could be a double free(), or free() called with the middle > > of an allocated block; Try setting environment variable > > MallocHelp to see tools to help debug > > Python(620,0xa000d000) malloc: *** Deallocation of a > > pointer not malloced: 0x7bdcf0; This could be a double > > free(), or free() called with the middle of an allocated > > block; Try setting environment variable MallocHelp to see > > tools to help debug > > > > I can't see anything obvious in SndCoreAudio.h or > > AudioDefs.i Ed > > > > On 8/10/07, Victor Lazzarini <vic...@nu...> > > > wrote: Try > > > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp > > > ,256, 22050.0) > > > > > > There is no sndobj.SND_OUTPUT argument for > > > SndCoreAudio (it always opens full-duplex). > > > > > > Victor > > > > > > > > > > > > > > Thanks for the pointer to the solution however > > > > > > > > now I've removed the constructor > > > > > > > > outp = sndobj.SndCoreAudio() > > > > > > > > and after constructing aif1,aif2 replaced it with > > > > > > > > objs[0]=aif1 > > > > objs[1]=aif2 > > > > objsp = objs.cast() > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp) > > > > which as expected still produces output at the wrong > > > > sampling rate however if I extend this to > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > > > sndobj.SND_OUTPUT, 256, 22050) > > > > or > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > > > 1) or variants in between I get tracebacks similar to > > > this > > > > > File "aif.py", line 20, in <module> > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, > > > > objsp, 1) #, 256, 22050) #wrong args number > > > > File > > > > "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" , > > > > line 2803, in __init__ this = > > > > _sndobj.new_SndCoreAudio(*args) NotImplementedError: > > > > Wrong number of arguments for overloaded function > > > > 'new_SndCoreAudio'. Possible C/C++ prototypes are: > > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > > ,int ,float) > > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > > ,int) SndCoreAudio(int,int,int,float,SndObj ** > > > > ,UInt32) SndCoreAudio(int,int,int,float,SndObj **) > > > > SndCoreAudio(int,int,int,float) > > > > SndCoreAudio(int,int,int) > > > > SndCoreAudio(int,int) > > > > SndCoreAudio(int) > > > > SndCoreAudio() > > > > > > > > Best > > > > Ed > > > > > > > > On 8/9/07, Victor Lazzarini <vic...@nu...> > > > > > wrote: You will need to set the SR on all objects > > > > > to 22050. It is generally the last argument > > > > > (which defaults to 44100) of each object. You > > > > > have done it with all SndObjs, but it looks > > > > > like you left the SndCoreAudio to its default. > > > > > You need to create it with the right SR. > > > > > > > > > > Victor > > > > > > > > > > > > > > > > > Hi > > > > > > I've been tinkering with PySndObj on the Mac . > > > > > > BTW it built out of the box for python 2.5 with > > > > > > the MacPython framework and appropriate build > > > > > > switches to build the python wrapper. The examples > > > > > > work OK as does the I have now got to the point > > > > > > where I'm able to read an AIF file and providing > > > > > > it's a PCM file get it to play back OK apart from > > > > > > when the sampling rate is not the default 44100. > > > > > > In the case in question it is 22050 but it plays > > > > > > back as if 44100. (Thanks BTW to the wav file > > > > > > example post) I have tried the commented options > > > > > > shown in the code below, I'm new to the API so I'm > > > > > > not sure if this is a bug or I'm not setting the > > > > > > sampling rate in the right place. So suggestions > > > > > welcomed. The example file is in the > > > > > > /Developer/Examples/Java/Sound source tree. > > > > > > > import sndobj fn = '22-new.aif' > > > > > > #fn = 'sound.aif' > > > > > > af = sndobj.SndAiff(fn,sndobj.READ,2) > > > > > > sr = af.GetSr() > > > > > > vs = af.GetVectorSize() > > > > > > print sr,vs > > > > > > T1 = sndobj.SndThread() > > > > > > sndin = sndobj.SndIn(af,1) > > > > > > outp = sndobj.SndCoreAudio() > > > > > > aif1 = sndobj.SndIn(af,1) > > > > > > #aif1 = sndobj.SndIn(af,1,vs,sr) > > > > > > #aif1.SetSr(sr) > > > > > > aif2 = sndobj.SndIn(af,2) > > > > > > #aif2 = sndobj.SndIn(af,2, vs, sr) > > > > > > #aif2.SetSr(sr) > > > > > > outp.SetOutput(1,aif1) > > > > > > outp.SetOutput(2,aif2) > > > > > > T1.AddObj(af,sndobj.SNDIO_IN) > > > > > > T1.AddObj(aif1) > > > > > > T1.AddObj(aif2) > > > > > > T1.AddObj(outp,sndobj.SNDIO_OUT) > > > > > > T1.ProcOn() > > > > > > time.sleep(5) > > > > > > T1.ProcOff() > > > > > > > > > > > > TIA > > > > > > Ed > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------- > > > > --------------- 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 > > > > > |
From: Victor L. <vic...@nu...> - 2007-08-10 21:58:51
|
Another thing you can try straight away is to use SndRTIO, which on OSX is effectively SndCoreAudio, but with the important difference that its constructor is SndRTIO(short ch, int mode, int bsize = DEF_BSIZE, int period = DEF_PERIOD, int encoding = SHORTSAM, SndObj** input=0, int vsize= DEF_VECSIZE, float sr=DEF_SR, int dev = DEF_DEV) without any Uint32 (in fact, there is a slight bug in there in that the conversion from int to uint is not handled, but I can fix that if there is a problem). Victor > > Problem is the constructor still expects 8 args not the 7 > you suggest I introduced the sndobj.SND_OUTPUT argument to > provide the 8th. I think this is a prototyping issue in > SWIG though my close familiarity with SWIG predates the > C++ extensions. However I note the the cpp source > constructor is SndCoreAudio::SndCoreAudio(int channels,int > bufframes, int buffnos, float norm, SndObj** inObjs, > UInt32 dev, int vecsize, float sr) > i.e. 8 args the 6th being the device. > > The python traceback remains as follows irrespective of > whether 7 or 8 args are provided or whether > sndobj.SND_OUTPUT or a python int is passed. > > > File "aif.py", line 20, in <module> > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp, > 256, 22050.0) #wrong args number > File "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" > , line 2803, in __init__ > this = _sndobj.new_SndCoreAudio(*args) > NotImplementedError: Wrong number of arguments for > overloaded function 'new_SndCoreAudio'. > Possible C/C++ prototypes are: > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int > ,float) > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int) > SndCoreAudio(int,int,int,float,SndObj **,UInt32) > SndCoreAudio(int,int,int,float,SndObj **) > SndCoreAudio(int,int,int,float) > SndCoreAudio(int,int,int) > SndCoreAudio(int,int) > SndCoreAudio(int) > SndCoreAudio() > > I suspect that the constructor is looking for a C++ Uint32 > in the 6th argument but where to pick an appropriate one > from? > > if sndobj.DEF_DEV is substituted for the 6th arg the > following traceback is obtained: > 22050.0 256 which is reasonable enough as this is another > function reference. > > Python(620,0xa000d000) malloc: *** Deallocation of a > pointer not malloced: 0x613158; This could be a double > free(), or free() called with the middle of an allocated > block; Try setting environment variable MallocHelp to see > tools to help debug Python(620,0xa000d000) malloc: *** > Deallocation of a pointer not malloced: 0x709458; This > could be a double free(), or free() called with the middle > of an allocated block; Try setting environment variable > MallocHelp to see tools to help debug > Python(620,0xa000d000) malloc: *** Deallocation of a > pointer not malloced: 0x7bdcf0; This could be a double > free(), or free() called with the middle of an allocated > block; Try setting environment variable MallocHelp to see > tools to help debug > > I can't see anything obvious in SndCoreAudio.h or > AudioDefs.i Ed > > On 8/10/07, Victor Lazzarini <vic...@nu...> > > wrote: Try > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp > > ,256, 22050.0) > > > > There is no sndobj.SND_OUTPUT argument for > > SndCoreAudio (it always opens full-duplex). > > > > Victor > > > > > > > > > > Thanks for the pointer to the solution however > > > > > > now I've removed the constructor > > > > > > outp = sndobj.SndCoreAudio() > > > > > > and after constructing aif1,aif2 replaced it with > > > > > > objs[0]=aif1 > > > objs[1]=aif2 > > > objsp = objs.cast() > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp) > > > which as expected still produces output at the wrong > > > sampling rate however if I extend this to > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > > sndobj.SND_OUTPUT, 256, 22050) > > > or > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > > 1) or variants in between I get tracebacks similar to > > this > > > > File "aif.py", line 20, in <module> > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, > > > objsp, 1) #, 256, 22050) #wrong args number > > > File > > > "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" , > > > line 2803, in __init__ this = > > > _sndobj.new_SndCoreAudio(*args) NotImplementedError: > > > Wrong number of arguments for overloaded function > > > 'new_SndCoreAudio'. Possible C/C++ prototypes are: > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > ,int ,float) > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > ,int) SndCoreAudio(int,int,int,float,SndObj ** > > > ,UInt32) SndCoreAudio(int,int,int,float,SndObj **) > > > SndCoreAudio(int,int,int,float) > > > SndCoreAudio(int,int,int) > > > SndCoreAudio(int,int) > > > SndCoreAudio(int) > > > SndCoreAudio() > > > > > > Best > > > Ed > > > > > > On 8/9/07, Victor Lazzarini <vic...@nu...> > > > > wrote: You will need to set the SR on all objects > > > > to 22050. It is generally the last argument > > > > (which defaults to 44100) of each object. You > > > > have done it with all SndObjs, but it looks > > > > like you left the SndCoreAudio to its default. > > > > You need to create it with the right SR. > > > > > > > > Victor > > > > > > > > > > > > > > Hi > > > > > I've been tinkering with PySndObj on the Mac . > > > > > BTW it built out of the box for python 2.5 with > > > > > the MacPython framework and appropriate build > > > > > switches to build the python wrapper. The examples > > > > > work OK as does the I have now got to the point > > > > > where I'm able to read an AIF file and providing > > > > > it's a PCM file get it to play back OK apart from > > > > > when the sampling rate is not the default 44100. > > > > > In the case in question it is 22050 but it plays > > > > > back as if 44100. (Thanks BTW to the wav file > > > > > example post) I have tried the commented options > > > > > shown in the code below, I'm new to the API so I'm > > > > > not sure if this is a bug or I'm not setting the > > > > > sampling rate in the right place. So suggestions > > > > welcomed. The example file is in the > > > > > /Developer/Examples/Java/Sound source tree. > > > > > > import sndobj fn = '22-new.aif' > > > > > #fn = 'sound.aif' > > > > > af = sndobj.SndAiff(fn,sndobj.READ,2) > > > > > sr = af.GetSr() > > > > > vs = af.GetVectorSize() > > > > > print sr,vs > > > > > T1 = sndobj.SndThread() > > > > > sndin = sndobj.SndIn(af,1) > > > > > outp = sndobj.SndCoreAudio() > > > > > aif1 = sndobj.SndIn(af,1) > > > > > #aif1 = sndobj.SndIn(af,1,vs,sr) > > > > > #aif1.SetSr(sr) > > > > > aif2 = sndobj.SndIn(af,2) > > > > > #aif2 = sndobj.SndIn(af,2, vs, sr) > > > > > #aif2.SetSr(sr) > > > > > outp.SetOutput(1,aif1) > > > > > outp.SetOutput(2,aif2) > > > > > T1.AddObj(af,sndobj.SNDIO_IN) > > > > > T1.AddObj(aif1) > > > > > T1.AddObj(aif2) > > > > > T1.AddObj(outp,sndobj.SNDIO_OUT) > > > > > T1.ProcOn() > > > > > time.sleep(5) > > > > > T1.ProcOff() > > > > > > > > > > TIA > > > > > Ed > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------- > > > --------------- 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 > > > |
From: Victor L. <vic...@nu...> - 2007-08-10 21:46:06
|
yes, it is a swig thing alright. I remember having had some trouble with things like Uint32 as arguments before. A quick solution is to write yet another overloaded constructor, eg.: SndCoreAudio(int vecsize, float sr) But the crash with the malloc messages you listed sounds strange to me. I might need to investigate. In fact, to be honest on a Mac, I never used anything but 44100. There could be a bug lurking in there. Victor > > Problem is the constructor still expects 8 args not the 7 > you suggest I introduced the sndobj.SND_OUTPUT argument to > provide the 8th. I think this is a prototyping issue in > SWIG though my close familiarity with SWIG predates the > C++ extensions. However I note the the cpp source > constructor is SndCoreAudio::SndCoreAudio(int channels,int > bufframes, int buffnos, float norm, SndObj** inObjs, > UInt32 dev, int vecsize, float sr) > i.e. 8 args the 6th being the device. > > The python traceback remains as follows irrespective of > whether 7 or 8 args are provided or whether > sndobj.SND_OUTPUT or a python int is passed. > > > File "aif.py", line 20, in <module> > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp, > 256, 22050.0) #wrong args number > File "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" > , line 2803, in __init__ > this = _sndobj.new_SndCoreAudio(*args) > NotImplementedError: Wrong number of arguments for > overloaded function 'new_SndCoreAudio'. > Possible C/C++ prototypes are: > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int > ,float) > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int) > SndCoreAudio(int,int,int,float,SndObj **,UInt32) > SndCoreAudio(int,int,int,float,SndObj **) > SndCoreAudio(int,int,int,float) > SndCoreAudio(int,int,int) > SndCoreAudio(int,int) > SndCoreAudio(int) > SndCoreAudio() > > I suspect that the constructor is looking for a C++ Uint32 > in the 6th argument but where to pick an appropriate one > from? > > if sndobj.DEF_DEV is substituted for the 6th arg the > following traceback is obtained: > 22050.0 256 which is reasonable enough as this is another > function reference. > > Python(620,0xa000d000) malloc: *** Deallocation of a > pointer not malloced: 0x613158; This could be a double > free(), or free() called with the middle of an allocated > block; Try setting environment variable MallocHelp to see > tools to help debug Python(620,0xa000d000) malloc: *** > Deallocation of a pointer not malloced: 0x709458; This > could be a double free(), or free() called with the middle > of an allocated block; Try setting environment variable > MallocHelp to see tools to help debug > Python(620,0xa000d000) malloc: *** Deallocation of a > pointer not malloced: 0x7bdcf0; This could be a double > free(), or free() called with the middle of an allocated > block; Try setting environment variable MallocHelp to see > tools to help debug > > I can't see anything obvious in SndCoreAudio.h or > AudioDefs.i Ed > > On 8/10/07, Victor Lazzarini <vic...@nu...> > > wrote: Try > > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp > > ,256, 22050.0) > > > > There is no sndobj.SND_OUTPUT argument for > > SndCoreAudio (it always opens full-duplex). > > > > Victor > > > > > > > > > > Thanks for the pointer to the solution however > > > > > > now I've removed the constructor > > > > > > outp = sndobj.SndCoreAudio() > > > > > > and after constructing aif1,aif2 replaced it with > > > > > > objs[0]=aif1 > > > objs[1]=aif2 > > > objsp = objs.cast() > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp) > > > which as expected still produces output at the wrong > > > sampling rate however if I extend this to > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > > sndobj.SND_OUTPUT, 256, 22050) > > > or > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > > 1) or variants in between I get tracebacks similar to > > this > > > > File "aif.py", line 20, in <module> > > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, > > > objsp, 1) #, 256, 22050) #wrong args number > > > File > > > "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" , > > > line 2803, in __init__ this = > > > _sndobj.new_SndCoreAudio(*args) NotImplementedError: > > > Wrong number of arguments for overloaded function > > > 'new_SndCoreAudio'. Possible C/C++ prototypes are: > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > ,int ,float) > > > SndCoreAudio(int,int,int,float,SndObj **,UInt32 > > > ,int) SndCoreAudio(int,int,int,float,SndObj ** > > > ,UInt32) SndCoreAudio(int,int,int,float,SndObj **) > > > SndCoreAudio(int,int,int,float) > > > SndCoreAudio(int,int,int) > > > SndCoreAudio(int,int) > > > SndCoreAudio(int) > > > SndCoreAudio() > > > > > > Best > > > Ed > > > > > > On 8/9/07, Victor Lazzarini <vic...@nu...> > > > > wrote: You will need to set the SR on all objects > > > > to 22050. It is generally the last argument > > > > (which defaults to 44100) of each object. You > > > > have done it with all SndObjs, but it looks > > > > like you left the SndCoreAudio to its default. > > > > You need to create it with the right SR. > > > > > > > > Victor > > > > > > > > > > > > > > Hi > > > > > I've been tinkering with PySndObj on the Mac . > > > > > BTW it built out of the box for python 2.5 with > > > > > the MacPython framework and appropriate build > > > > > switches to build the python wrapper. The examples > > > > > work OK as does the I have now got to the point > > > > > where I'm able to read an AIF file and providing > > > > > it's a PCM file get it to play back OK apart from > > > > > when the sampling rate is not the default 44100. > > > > > In the case in question it is 22050 but it plays > > > > > back as if 44100. (Thanks BTW to the wav file > > > > > example post) I have tried the commented options > > > > > shown in the code below, I'm new to the API so I'm > > > > > not sure if this is a bug or I'm not setting the > > > > > sampling rate in the right place. So suggestions > > > > welcomed. The example file is in the > > > > > /Developer/Examples/Java/Sound source tree. > > > > > > import sndobj fn = '22-new.aif' > > > > > #fn = 'sound.aif' > > > > > af = sndobj.SndAiff(fn,sndobj.READ,2) > > > > > sr = af.GetSr() > > > > > vs = af.GetVectorSize() > > > > > print sr,vs > > > > > T1 = sndobj.SndThread() > > > > > sndin = sndobj.SndIn(af,1) > > > > > outp = sndobj.SndCoreAudio() > > > > > aif1 = sndobj.SndIn(af,1) > > > > > #aif1 = sndobj.SndIn(af,1,vs,sr) > > > > > #aif1.SetSr(sr) > > > > > aif2 = sndobj.SndIn(af,2) > > > > > #aif2 = sndobj.SndIn(af,2, vs, sr) > > > > > #aif2.SetSr(sr) > > > > > outp.SetOutput(1,aif1) > > > > > outp.SetOutput(2,aif2) > > > > > T1.AddObj(af,sndobj.SNDIO_IN) > > > > > T1.AddObj(aif1) > > > > > T1.AddObj(aif2) > > > > > T1.AddObj(outp,sndobj.SNDIO_OUT) > > > > > T1.ProcOn() > > > > > time.sleep(5) > > > > > T1.ProcOff() > > > > > > > > > > TIA > > > > > Ed > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------- > > > --------------- 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 > > > |
From: Edward H. <ed....@gm...> - 2007-08-10 20:41:05
|
Problem is the constructor still expects 8 args not the 7 you suggest I introduced the sndobj.SND_OUTPUT argument to provide the 8th. I think this is a prototyping issue in SWIG though my close familiarity with SWIG predates the C++ extensions. However I note the the cpp source constructor is SndCoreAudio::SndCoreAudio(int channels,int bufframes, int buffnos, float norm, SndObj** inObjs, UInt32 dev, int vecsize, float sr) i.e. 8 args the 6th being the device. The python traceback remains as follows irrespective of whether 7 or 8 args are provided or whether sndobj.SND_OUTPUT or a python int is passed. File "aif.py", line 20, in <module> outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp, 256, 22050.0) #wrong args number File "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py", line 2803, in __init__ this = _sndobj.new_SndCoreAudio(*args) NotImplementedError: Wrong number of arguments for overloaded function 'new_SndCoreAudio'. Possible C/C++ prototypes are: SndCoreAudio(int,int,int,float,SndObj **,UInt32,int,float) SndCoreAudio(int,int,int,float,SndObj **,UInt32,int) SndCoreAudio(int,int,int,float,SndObj **,UInt32) SndCoreAudio(int,int,int,float,SndObj **) SndCoreAudio(int,int,int,float) SndCoreAudio(int,int,int) SndCoreAudio(int,int) SndCoreAudio(int) SndCoreAudio() I suspect that the constructor is looking for a C++ Uint32 in the 6th argument but where to pick an appropriate one from? if sndobj.DEF_DEV is substituted for the 6th arg the following traceback is obtained: 22050.0 256 which is reasonable enough as this is another function reference. Python(620,0xa000d000) malloc: *** Deallocation of a pointer not malloced: 0x613158; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug Python(620,0xa000d000) malloc: *** Deallocation of a pointer not malloced: 0x709458; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug Python(620,0xa000d000) malloc: *** Deallocation of a pointer not malloced: 0x7bdcf0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug I can't see anything obvious in SndCoreAudio.h or AudioDefs.i Ed On 8/10/07, Victor Lazzarini <vic...@nu...> wrote: > Try > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp ,256, > 22050.0) > > There is no sndobj.SND_OUTPUT argument for > SndCoreAudio (it always opens full-duplex). > > Victor > > > > > > Thanks for the pointer to the solution however > > > > now I've removed the constructor > > > > outp = sndobj.SndCoreAudio() > > > > and after constructing aif1,aif2 replaced it with > > > > objs[0]=aif1 > > objs[1]=aif2 > > objsp = objs.cast() > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp) > > which as expected still produces output at the wrong > > sampling rate however if I extend this to > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > > sndobj.SND_OUTPUT, 256, 22050) > > or > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , 1) > > or variants in between I get tracebacks similar to this > > > > File "aif.py", line 20, in <module> > > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp, > > 1) #, 256, 22050) #wrong args number > > File "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" > > , line 2803, in __init__ > > this = _sndobj.new_SndCoreAudio(*args) > > NotImplementedError: Wrong number of arguments for > > overloaded function 'new_SndCoreAudio'. > > Possible C/C++ prototypes are: > > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int > > ,float) > > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int) > > SndCoreAudio(int,int,int,float,SndObj **,UInt32) > > SndCoreAudio(int,int,int,float,SndObj **) > > SndCoreAudio(int,int,int,float) > > SndCoreAudio(int,int,int) > > SndCoreAudio(int,int) > > SndCoreAudio(int) > > SndCoreAudio() > > > > Best > > Ed > > > > On 8/9/07, Victor Lazzarini <vic...@nu...> > > > wrote: You will need to set the SR on all objects > > > to 22050. It is generally the last argument > > > (which defaults to 44100) of each object. You > > > have done it with all SndObjs, but it looks > > > like you left the SndCoreAudio to its default. > > > You need to create it with the right SR. > > > > > > Victor > > > > > > > > > > > Hi > > > > I've been tinkering with PySndObj on the Mac . > > > > BTW it built out of the box for python 2.5 with the > > > > MacPython framework and appropriate build switches to > > > > build the python wrapper. The examples work OK as does > > > > the I have now got to the point where I'm able to > > > > read an AIF file and providing it's a PCM file get it > > > > to play back OK apart from when the sampling rate is > > > > not the default 44100. In the case in question it is > > > > 22050 but it plays back as if 44100. (Thanks BTW to > > > > the wav file example post) I have tried the commented > > > > options shown in the code below, I'm new to the API so > > > > I'm not sure if this is a bug or I'm not setting the > > > > sampling rate in the right place. So suggestions > > > > welcomed. The example file is in the > > > /Developer/Examples/Java/Sound source tree. > > > > > import sndobj > > > > fn = '22-new.aif' > > > > #fn = 'sound.aif' > > > > af = sndobj.SndAiff(fn,sndobj.READ,2) > > > > sr = af.GetSr() > > > > vs = af.GetVectorSize() > > > > print sr,vs > > > > T1 = sndobj.SndThread() > > > > sndin = sndobj.SndIn(af,1) > > > > outp = sndobj.SndCoreAudio() > > > > aif1 = sndobj.SndIn(af,1) > > > > #aif1 = sndobj.SndIn(af,1,vs,sr) > > > > #aif1.SetSr(sr) > > > > aif2 = sndobj.SndIn(af,2) > > > > #aif2 = sndobj.SndIn(af,2, vs, sr) > > > > #aif2.SetSr(sr) > > > > outp.SetOutput(1,aif1) > > > > outp.SetOutput(2,aif2) > > > > T1.AddObj(af,sndobj.SNDIO_IN) > > > > T1.AddObj(aif1) > > > > T1.AddObj(aif2) > > > > T1.AddObj(outp,sndobj.SNDIO_OUT) > > > > T1.ProcOn() > > > > time.sleep(5) > > > > T1.ProcOff() > > > > > > > > TIA > > > > Ed > > > > > > > > > > > > > > ---------------------------------------------------------- > > > > --------------- 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 > > > > |
From: Victor L. <vic...@nu...> - 2007-08-10 18:46:17
|
Try outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp ,256, 22050.0) There is no sndobj.SND_OUTPUT argument for SndCoreAudio (it always opens full-duplex). Victor > > Thanks for the pointer to the solution however > > now I've removed the constructor > > outp = sndobj.SndCoreAudio() > > and after constructing aif1,aif2 replaced it with > > objs[0]=aif1 > objs[1]=aif2 > objsp = objs.cast() > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp) > which as expected still produces output at the wrong > sampling rate however if I extend this to > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , > sndobj.SND_OUTPUT, 256, 22050) > or > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , 1) > or variants in between I get tracebacks similar to this > > File "aif.py", line 20, in <module> > outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp, > 1) #, 256, 22050) #wrong args number > File "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py" > , line 2803, in __init__ > this = _sndobj.new_SndCoreAudio(*args) > NotImplementedError: Wrong number of arguments for > overloaded function 'new_SndCoreAudio'. > Possible C/C++ prototypes are: > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int > ,float) > SndCoreAudio(int,int,int,float,SndObj **,UInt32,int) > SndCoreAudio(int,int,int,float,SndObj **,UInt32) > SndCoreAudio(int,int,int,float,SndObj **) > SndCoreAudio(int,int,int,float) > SndCoreAudio(int,int,int) > SndCoreAudio(int,int) > SndCoreAudio(int) > SndCoreAudio() > > Best > Ed > > On 8/9/07, Victor Lazzarini <vic...@nu...> > > wrote: You will need to set the SR on all objects > > to 22050. It is generally the last argument > > (which defaults to 44100) of each object. You > > have done it with all SndObjs, but it looks > > like you left the SndCoreAudio to its default. > > You need to create it with the right SR. > > > > Victor > > > > > > > > Hi > > > I've been tinkering with PySndObj on the Mac . > > > BTW it built out of the box for python 2.5 with the > > > MacPython framework and appropriate build switches to > > > build the python wrapper. The examples work OK as does > > > the I have now got to the point where I'm able to > > > read an AIF file and providing it's a PCM file get it > > > to play back OK apart from when the sampling rate is > > > not the default 44100. In the case in question it is > > > 22050 but it plays back as if 44100. (Thanks BTW to > > > the wav file example post) I have tried the commented > > > options shown in the code below, I'm new to the API so > > > I'm not sure if this is a bug or I'm not setting the > > > sampling rate in the right place. So suggestions > > > welcomed. The example file is in the > > /Developer/Examples/Java/Sound source tree. > > > > import sndobj > > > fn = '22-new.aif' > > > #fn = 'sound.aif' > > > af = sndobj.SndAiff(fn,sndobj.READ,2) > > > sr = af.GetSr() > > > vs = af.GetVectorSize() > > > print sr,vs > > > T1 = sndobj.SndThread() > > > sndin = sndobj.SndIn(af,1) > > > outp = sndobj.SndCoreAudio() > > > aif1 = sndobj.SndIn(af,1) > > > #aif1 = sndobj.SndIn(af,1,vs,sr) > > > #aif1.SetSr(sr) > > > aif2 = sndobj.SndIn(af,2) > > > #aif2 = sndobj.SndIn(af,2, vs, sr) > > > #aif2.SetSr(sr) > > > outp.SetOutput(1,aif1) > > > outp.SetOutput(2,aif2) > > > T1.AddObj(af,sndobj.SNDIO_IN) > > > T1.AddObj(aif1) > > > T1.AddObj(aif2) > > > T1.AddObj(outp,sndobj.SNDIO_OUT) > > > T1.ProcOn() > > > time.sleep(5) > > > T1.ProcOff() > > > > > > TIA > > > Ed > > > > > > > > > > ---------------------------------------------------------- > > > --------------- 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 > > |
From: Edward H. <ed....@gm...> - 2007-08-10 11:16:24
|
Thanks for the pointer to the solution however now I've removed the constructor outp = sndobj.SndCoreAudio() and after constructing aif1,aif2 replaced it with objs[0]=aif1 objs[1]=aif2 objsp = objs.cast() outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp) which as expected still produces output at the wrong sampling rate however if I extend this to outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , sndobj.SND_OUTPUT, 256, 22050) or outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp , 1) or variants in between I get tracebacks similar to this File "aif.py", line 20, in <module> outp = sndobj.SndCoreAudio(2, 512, 4, 32767.0, objsp, 1) #, 256, 22050) #wrong args number File "/Users/edh/Contracts/StAndrews_1/sndobj/sndobj.py", line 2803, in __init__ this = _sndobj.new_SndCoreAudio(*args) NotImplementedError: Wrong number of arguments for overloaded function 'new_SndCoreAudio'. Possible C/C++ prototypes are: SndCoreAudio(int,int,int,float,SndObj **,UInt32,int,float) SndCoreAudio(int,int,int,float,SndObj **,UInt32,int) SndCoreAudio(int,int,int,float,SndObj **,UInt32) SndCoreAudio(int,int,int,float,SndObj **) SndCoreAudio(int,int,int,float) SndCoreAudio(int,int,int) SndCoreAudio(int,int) SndCoreAudio(int) SndCoreAudio() Best Ed On 8/9/07, Victor Lazzarini <vic...@nu...> wrote: > You will need to set the SR on all objects > to 22050. It is generally the last argument > (which defaults to 44100) of each object. You > have done it with all SndObjs, but it looks > like you left the SndCoreAudio to its default. > You need to create it with the right SR. > > Victor > > > > > Hi > > I've been tinkering with PySndObj on the Mac . > > BTW it built out of the box for python 2.5 with the > > MacPython framework and appropriate build switches to > > build the python wrapper. The examples work OK as does the > > I have now got to the point where I'm able to read an AIF > > file and providing it's a PCM file get it to play back OK > > apart from when the sampling rate is not the default > > 44100. In the case in question it is 22050 but it plays > > back as if 44100. (Thanks BTW to the wav file example > > post) I have tried the commented options shown in the code > > below, I'm new to the API so I'm not > > sure if this is a bug or I'm not setting the sampling rate > > in the right place. So suggestions welcomed. The example > > file is in the /Developer/Examples/Java/Sound source tree. > > > > import sndobj > > fn = '22-new.aif' > > #fn = 'sound.aif' > > af = sndobj.SndAiff(fn,sndobj.READ,2) > > sr = af.GetSr() > > vs = af.GetVectorSize() > > print sr,vs > > T1 = sndobj.SndThread() > > sndin = sndobj.SndIn(af,1) > > outp = sndobj.SndCoreAudio() > > aif1 = sndobj.SndIn(af,1) > > #aif1 = sndobj.SndIn(af,1,vs,sr) > > #aif1.SetSr(sr) > > aif2 = sndobj.SndIn(af,2) > > #aif2 = sndobj.SndIn(af,2, vs, sr) > > #aif2.SetSr(sr) > > outp.SetOutput(1,aif1) > > outp.SetOutput(2,aif2) > > T1.AddObj(af,sndobj.SNDIO_IN) > > T1.AddObj(aif1) > > T1.AddObj(aif2) > > T1.AddObj(outp,sndobj.SNDIO_OUT) > > T1.ProcOn() > > time.sleep(5) > > T1.ProcOff() > > > > TIA > > Ed > > > > ---------------------------------------------------------- > > --------------- 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 > |
From: Victor L. <vic...@nu...> - 2007-08-09 19:56:41
|
You will need to set the SR on all objects to 22050. It is generally the last argument (which defaults to 44100) of each object. You have done it with all SndObjs, but it looks like you left the SndCoreAudio to its default. You need to create it with the right SR. Victor > > Hi > I've been tinkering with PySndObj on the Mac . > BTW it built out of the box for python 2.5 with the > MacPython framework and appropriate build switches to > build the python wrapper. The examples work OK as does the > I have now got to the point where I'm able to read an AIF > file and providing it's a PCM file get it to play back OK > apart from when the sampling rate is not the default > 44100. In the case in question it is 22050 but it plays > back as if 44100. (Thanks BTW to the wav file example > post) I have tried the commented options shown in the code > below, I'm new to the API so I'm not > sure if this is a bug or I'm not setting the sampling rate > in the right place. So suggestions welcomed. The example > file is in the /Developer/Examples/Java/Sound source tree. > > import sndobj > fn = '22-new.aif' > #fn = 'sound.aif' > af = sndobj.SndAiff(fn,sndobj.READ,2) > sr = af.GetSr() > vs = af.GetVectorSize() > print sr,vs > T1 = sndobj.SndThread() > sndin = sndobj.SndIn(af,1) > outp = sndobj.SndCoreAudio() > aif1 = sndobj.SndIn(af,1) > #aif1 = sndobj.SndIn(af,1,vs,sr) > #aif1.SetSr(sr) > aif2 = sndobj.SndIn(af,2) > #aif2 = sndobj.SndIn(af,2, vs, sr) > #aif2.SetSr(sr) > outp.SetOutput(1,aif1) > outp.SetOutput(2,aif2) > T1.AddObj(af,sndobj.SNDIO_IN) > T1.AddObj(aif1) > T1.AddObj(aif2) > T1.AddObj(outp,sndobj.SNDIO_OUT) > T1.ProcOn() > time.sleep(5) > T1.ProcOff() > > TIA > Ed > > ---------------------------------------------------------- > --------------- 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 |
From: Edward H. <ed....@gm...> - 2007-08-09 19:19:13
|
Hi I've been tinkering with PySndObj on the Mac . BTW it built out of the box for python 2.5 with the MacPython framework and appropriate build switches to build the python wrapper. The examples work OK as does the I have now got to the point where I'm able to read an AIF file and providing it's a PCM file get it to play back OK apart from when the sampling rate is not the default 44100. In the case in question it is 22050 but it plays back as if 44100. (Thanks BTW to the wav file example post) I have tried the commented options shown in the code below, I'm new to the API so I'm not sure if this is a bug or I'm not setting the sampling rate in the right place. So suggestions welcomed. The example file is in the /Developer/Examples/Java/Sound source tree. import sndobj fn = '22-new.aif' #fn = 'sound.aif' af = sndobj.SndAiff(fn,sndobj.READ,2) sr = af.GetSr() vs = af.GetVectorSize() print sr,vs T1 = sndobj.SndThread() sndin = sndobj.SndIn(af,1) outp = sndobj.SndCoreAudio() aif1 = sndobj.SndIn(af,1) #aif1 = sndobj.SndIn(af,1,vs,sr) #aif1.SetSr(sr) aif2 = sndobj.SndIn(af,2) #aif2 = sndobj.SndIn(af,2, vs, sr) #aif2.SetSr(sr) outp.SetOutput(1,aif1) outp.SetOutput(2,aif2) T1.AddObj(af,sndobj.SNDIO_IN) T1.AddObj(aif1) T1.AddObj(aif2) T1.AddObj(outp,sndobj.SNDIO_OUT) T1.ProcOn() time.sleep(5) T1.ProcOff() TIA Ed |
From: Bosko&Toma M. <bos...@gm...> - 2007-08-01 07:57:55
|
That was quick! osc2 has 500Hz and osc3 has 1500Hz. They don't have same frequencies. But I tried with different order: when I put osc2 before osc1 and try to delete osc2(now first on the list), osc2 and osc3 doesn't sound... It seems that problematic one is always the osc who's first on the list. On 8/1/07, Victor Lazzarini <vic...@nu...> wrote: > > I'll be surprised if it's a bug. Perhaps because > osc2 and osc3 are harmonically-related, they sound > like one, when you take osc1 out (which is not). Try > a) changing the frequencies to see if that is the > case. Otherwise b) try adding the oscillators to > the mixer in a different order (eg. osc2 before osc1) > to see if it matters. I can't test this as I am away > from work at the moment. > > Victor > > > > > Hi Victor! > > Thanks for your help and example, it helped a lot. Now I > > run out into another problem with mixing object. Here's > > example code: import sndobj > > import time > > > > tab = sndobj.HarmTable() > > env = sndobj.Interp(5000, 0, 4, 2) > > osc1 = sndobj.Oscili(tab,60,0, None, env) > > osc2 = sndobj.Oscili(tab,500,0, None, env) > > osc3 = sndobj.Oscili(tab,1500,0, None, env) > > > > mix1 = sndobj.Mixer() > > mix1.AddObj(osc1) > > mix1.AddObj(osc2) > > mix1.AddObj(osc3) > > > > out = sndobj.SndRTIO(1) > > out.SetOutput(1,mix1) > > t = sndobj.SndThread() > > t.AddObj(osc1) > > t.AddObj(osc2) > > t.AddObj(osc3) > > t.AddObj(mix1) > > t.AddObj(env) > > t.AddObj(out, sndobj.SNDIO_OUT) > > > > t.ProcOn() > > time.sleep(2) > > > > mix1.DeleteObj(osc1) > > time.sleep(2) > > > > t.ProcOff() > > > > As you can see, after 2 seconds I want to delete osc1 from > > mixer but this doesn't work as expected: for some reason > > it deletes osc1 and osc3 from mix1. Also I tried to put > > print mix1.GetObjNo() > > after > > mix1.DeleteObj(osc1) > > to see is it really only one osc left but it says that > > ther's still 2 osc left but I can hear only one. > > Strange thing is that when I tried to delete osc2 or osc3 > > it's working fine. Only osc1 is problematic. Why? > > Is it a bug or I'm doing something wrong? > > Thanks. > > > > Bosko > > > > On 7/28/07, Victor Lazzarini <vic...@nu...> > > wrote: > > > > Something like this: > > > > > > mix1 = Mixer() > > > mix2 = Mixer() > > > osc1 = Oscili(...) > > > osc2 = Oscili(...) > > > echo = Comb(0.5, 0.5, mix1) > > > > > > mix1.AddObj(osc1) > > > mix1.AddObj(osc2) > > > mix2.AddObj(mix1) > > > mix2.AddObj(echo) > > > > > > t = SndThread() > > > t.AddObj(osc1) > > > t.AddObj(osc2) > > > t.AddObj(mix1) > > > t.AddObj(echo) > > > t.AddObj(mix2) > > > > > > outp = SndRTIO(mix2) > > > > > > t.AddObj(mix2, SNDIO_OUT) > > > > > > t.ProcOn() > > > > > > etc... > > > > > > Victor > > > > > > > > > > > > Hi! > > > > Thanks for reply. Could you pass some example of how > > > > to do that? I've been trying for 2 days to do what > > > > you've sad but with no luck. Thanks. > > > > > > > > Bosko > > > > > > > > On 7/27/07, Victor Lazzarini > > > > <vic...@nu...> wrote: > > > > > > 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 > > > > > > > > > > > |
From: Victor L. <vic...@nu...> - 2007-08-01 07:42:22
|
I'll be surprised if it's a bug. Perhaps because osc2 and osc3 are harmonically-related, they sound like one, when you take osc1 out (which is not). Try a) changing the frequencies to see if that is the case. Otherwise b) try adding the oscillators to the mixer in a different order (eg. osc2 before osc1) to see if it matters. I can't test this as I am away from work at the moment. Victor > > Hi Victor! > Thanks for your help and example, it helped a lot. Now I > run out into another problem with mixing object. Here's > example code: import sndobj > import time > > tab = sndobj.HarmTable() > env = sndobj.Interp(5000, 0, 4, 2) > osc1 = sndobj.Oscili(tab,60,0, None, env) > osc2 = sndobj.Oscili(tab,500,0, None, env) > osc3 = sndobj.Oscili(tab,1500,0, None, env) > > mix1 = sndobj.Mixer() > mix1.AddObj(osc1) > mix1.AddObj(osc2) > mix1.AddObj(osc3) > > out = sndobj.SndRTIO(1) > out.SetOutput(1,mix1) > t = sndobj.SndThread() > t.AddObj(osc1) > t.AddObj(osc2) > t.AddObj(osc3) > t.AddObj(mix1) > t.AddObj(env) > t.AddObj(out, sndobj.SNDIO_OUT) > > t.ProcOn() > time.sleep(2) > > mix1.DeleteObj(osc1) > time.sleep(2) > > t.ProcOff() > > As you can see, after 2 seconds I want to delete osc1 from > mixer but this doesn't work as expected: for some reason > it deletes osc1 and osc3 from mix1. Also I tried to put > print mix1.GetObjNo() > after > mix1.DeleteObj(osc1) > to see is it really only one osc left but it says that > ther's still 2 osc left but I can hear only one. > Strange thing is that when I tried to delete osc2 or osc3 > it's working fine. Only osc1 is problematic. Why? > Is it a bug or I'm doing something wrong? > Thanks. > > Bosko > > On 7/28/07, Victor Lazzarini <vic...@nu...> > wrote: > > > Something like this: > > > > mix1 = Mixer() > > mix2 = Mixer() > > osc1 = Oscili(...) > > osc2 = Oscili(...) > > echo = Comb(0.5, 0.5, mix1) > > > > mix1.AddObj(osc1) > > mix1.AddObj(osc2) > > mix2.AddObj(mix1) > > mix2.AddObj(echo) > > > > t = SndThread() > > t.AddObj(osc1) > > t.AddObj(osc2) > > t.AddObj(mix1) > > t.AddObj(echo) > > t.AddObj(mix2) > > > > outp = SndRTIO(mix2) > > > > t.AddObj(mix2, SNDIO_OUT) > > > > t.ProcOn() > > > > etc... > > > > Victor > > > > > > > > > Hi! > > > Thanks for reply. Could you pass some example of how > > > to do that? I've been trying for 2 days to do what > > > you've sad but with no luck. Thanks. > > > > > > Bosko > > > > > > On 7/27/07, Victor Lazzarini > > > <vic...@nu...> wrote: > > > > > 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 > > > > > > > |
From: Bosko&Toma M. <bos...@gm...> - 2007-08-01 06:56:34
|
Hi Victor! Thanks for your help and example, it helped a lot. Now I run out into another problem with mixing object. Here's example code: import sndobj import time tab = sndobj.HarmTable() env = sndobj.Interp(5000, 0, 4, 2) osc1 = sndobj.Oscili(tab,60,0, None, env) osc2 = sndobj.Oscili(tab,500,0, None, env) osc3 = sndobj.Oscili(tab,1500,0, None, env) mix1 = sndobj.Mixer() mix1.AddObj(osc1) mix1.AddObj(osc2) mix1.AddObj(osc3) out = sndobj.SndRTIO(1) out.SetOutput(1,mix1) t = sndobj.SndThread() t.AddObj(osc1) t.AddObj(osc2) t.AddObj(osc3) t.AddObj(mix1) t.AddObj(env) t.AddObj(out, sndobj.SNDIO_OUT) t.ProcOn() time.sleep(2) mix1.DeleteObj(osc1) time.sleep(2) t.ProcOff() As you can see, after 2 seconds I want to delete osc1 from mixer but this doesn't work as expected: for some reason it deletes osc1 and osc3 from mix1. Also I tried to put print mix1.GetObjNo() after mix1.DeleteObj(osc1) to see is it really only one osc left but it says that ther's still 2 osc left but I can hear only one. Strange thing is that when I tried to delete osc2 or osc3 it's working fine. Only osc1 is problematic. Why? Is it a bug or I'm doing something wrong? Thanks. Bosko On 7/28/07, Victor Lazzarini <vic...@nu...> wrote: > > Something like this: > > mix1 = Mixer() > mix2 = Mixer() > osc1 = Oscili(...) > osc2 = Oscili(...) > echo = Comb(0.5, 0.5, mix1) > > mix1.AddObj(osc1) > mix1.AddObj(osc2) > mix2.AddObj(mix1) > mix2.AddObj(echo) > > t = SndThread() > t.AddObj(osc1) > t.AddObj(osc2) > t.AddObj(mix1) > t.AddObj(echo) > t.AddObj(mix2) > > outp = SndRTIO(mix2) > > t.AddObj(mix2, SNDIO_OUT) > > t.ProcOn() > > etc... > > Victor > > > > > > Hi! > > Thanks for reply. Could you pass some example of how to do > > that? I've been trying for 2 days to do what you've sad > > but with no luck. Thanks. > > > > Bosko > > > > On 7/27/07, Victor Lazzarini <vic...@nu...> > > wrote: > > > > 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 > > > > > > > |
From: Victor L. <vic...@nu...> - 2007-07-28 19:49:36
|
Something like this: mix1 = Mixer() mix2 = Mixer() osc1 = Oscili(...) osc2 = Oscili(...) echo = Comb(0.5, 0.5, mix1) mix1.AddObj(osc1) mix1.AddObj(osc2) mix2.AddObj(mix1) mix2.AddObj(echo) t = SndThread() t.AddObj(osc1) t.AddObj(osc2) t.AddObj(mix1) t.AddObj(echo) t.AddObj(mix2) outp = SndRTIO(mix2) t.AddObj(mix2, SNDIO_OUT) t.ProcOn() etc... Victor > > > Hi! > Thanks for reply. Could you pass some example of how to do > that? I've been trying for 2 days to do what you've sad > but with no luck. Thanks. > > Bosko > > On 7/27/07, Victor Lazzarini <vic...@nu...> > wrote: > > > 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 > > > > |
From: Bosko&Toma M. <bos...@gm...> - 2007-07-28 18:28:36
|
Hi! Thanks for reply. Could you pass some example of how to do that? I've been trying for 2 days to do what you've sad but with no luck. Thanks. Bosko On 7/27/07, Victor Lazzarini <vic...@nu...> wrote: > > 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 > > > |
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 > |
From: Bosko&Toma M. <bos...@gm...> - 2007-07-25 23:47:21
|
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 |
From: Rory W. <ror...@ea...> - 2007-07-24 11:15:36
|
Apologies for cross-posting Sounds Electric '07 - Call for Papers Sounds Electric '07 is a festival of new electro-acoustic and instrumental music taking place at Dundalk Institute of Technology, Ireland, 20-24 November 2007. The festival will feature leading international composers and performers in an intense week of concerts, workshops and talks. EAR are now inviting submissions of papers examining aesthetic, compositional, pedagogical, scientific, and technological aspects of computer music. Submissions(by abstract only) should be sent to sou...@ea... All submissions are subject to peer review and the accepted papers will be published in full on the conference website. Deadline for submissions is Friday 21 September 2007. Contact: EAR / Sounds Electric '07 3 Radcliffe Binn Eadair View Dublin 13 Ireland web: www.ear.ie |
From: Bosko&Toma M. <bos...@gm...> - 2007-07-12 20:03:05
|
Thanks very much, now it's working. Bosko On 7/12/07, Victor Lazzarini <Vic...@nu...> wrote: > > Use a Mixer object and mix the two signals: > > Mixer mix > mix.AddObj(delay) > mix.AddObj(osc) > outp.SetOutput(mix) > > (Or use a SndRTThread object that has a builtin mixer for each output > channel.) > > Victor > > At 19:28 11/07/2007, you wrote: > >Hi all! > > > >I'm new to SndObj. Hope someone can help me with this. I was trying a > >DelayLine object but with no luck. Here is what I've got: > >import sndobj > >import time > > > >tab = sndobj.HarmTable() > >env = sndobj.Interp(5000, 0, 0.1, 2) > >osc = sndobj.Oscili(tab, 440, 0, None, env) > >delay = sndobj.DelayLine(0.5, osc) > >outp = sndobj.SndRTIO(1) > >outp.SetOutput(1, osc) > >outp.SetOutput(1, delay) > >thread = sndobj.SndThread () > >thread.AddObj(osc) > >thread.AddObj(env) > >thread.AddObj(delay) > >thread.AddObj(outp, sndobj.SNDIO_OUT) > >thread.ProcOn() > >time.sleep(2) > >thread.ProcOff() > > > >Now, I can hear only delayed signal. But how can hear the original also? > >It should be possible(?). > >Thanks. > > > >Bosko > >------------------------------------------------------------------------- > >This SF.net email is sponsored by DB2 Express > >Download DB2 Express C - the FREE version of DB2 express and take > >control of your XML. No limits. Just data. Click to get it now. > >http://sourceforge.net/powerbar/db2/ > >_______________________________________________ > >Sndobj-devel mailing list > >Snd...@li... > >https://lists.sourceforge.net/lists/listinfo/sndobj-devel > > Victor Lazzarini > Music Technology Laboratory > Music Department > National University of Ireland, Maynooth > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Sndobj-devel mailing list > Snd...@li... > https://lists.sourceforge.net/lists/listinfo/sndobj-devel > |
From: Victor L. <Vic...@nu...> - 2007-07-12 11:05:06
|
Use a Mixer object and mix the two signals: Mixer mix mix.AddObj(delay) mix.AddObj(osc) outp.SetOutput(mix) (Or use a SndRTThread object that has a builtin mixer for each output channel.) Victor At 19:28 11/07/2007, you wrote: >Hi all! > >I'm new to SndObj. Hope someone can help me with this. I was trying a >DelayLine object but with no luck. Here is what I've got: >import sndobj >import time > >tab = sndobj.HarmTable() >env = sndobj.Interp(5000, 0, 0.1, 2) >osc = sndobj.Oscili(tab, 440, 0, None, env) >delay = sndobj.DelayLine(0.5, osc) >outp = sndobj.SndRTIO(1) >outp.SetOutput(1, osc) >outp.SetOutput(1, delay) >thread = sndobj.SndThread () >thread.AddObj(osc) >thread.AddObj(env) >thread.AddObj(delay) >thread.AddObj(outp, sndobj.SNDIO_OUT) >thread.ProcOn() >time.sleep(2) >thread.ProcOff() > >Now, I can hear only delayed signal. But how can hear the original also? >It should be possible(?). >Thanks. > >Bosko >------------------------------------------------------------------------- >This SF.net email is sponsored by DB2 Express >Download DB2 Express C - the FREE version of DB2 express and take >control of your XML. No limits. Just data. Click to get it now. >http://sourceforge.net/powerbar/db2/ >_______________________________________________ >Sndobj-devel mailing list >Snd...@li... >https://lists.sourceforge.net/lists/listinfo/sndobj-devel Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth |
From: Bosko&Toma M. <bos...@gm...> - 2007-07-11 18:28:28
|
Hi all! I'm new to SndObj. Hope someone can help me with this. I was trying a DelayLine object but with no luck. Here is what I've got: import sndobj import time tab = sndobj.HarmTable() env = sndobj.Interp(5000, 0, 0.1, 2) osc = sndobj.Oscili(tab, 440, 0, None, env) delay = sndobj.DelayLine(0.5, osc) outp = sndobj.SndRTIO(1) outp.SetOutput(1, osc) outp.SetOutput(1, delay) thread = sndobj.SndThread() thread.AddObj(osc) thread.AddObj(env) thread.AddObj(delay) thread.AddObj(outp, sndobj.SNDIO_OUT) thread.ProcOn() time.sleep(2) thread.ProcOff() Now, I can hear only delayed signal. But how can hear the original also? It should be possible(?). Thanks. Bosko |
From: Victor L. <vic...@nu...> - 2007-03-25 20:21:00
|
I suppose _sndobj.so should go in the same dir as sndobj.py. As for libsndobj.dylib, I think the best thing is to put it in /usr/local/lib; but for that to work, the link path on _sndobj.so has to be made /usr/local/lib/libsndobj.so and the lib ID of libsndobj.dylib has to be changed to that full path too. This can be done with install_lib_tool; to check the links and IDs, you can use otool -L <filename> I really have to put all these things in SConstruct in the 'install' target. Victor > > Hi Victor, all, > > I'v been trying to work out the most appropriate way of > installing pysndobj in the OSX framework structure. > > Giiven > /Library/Frameworks/Python.framework/Versions/Current/lib/ > python2.4 > > the /site-packages/ sub directory seems to be the right > place for the sndobj.py > but I'm not sure where the best/most usual place is for > libsndobj.dylib and _sndobj.so > > can someone tell where the best/most usual places are for > the libraries? > > thanks, > > David > _________________________________________________ > experimental polymedia: www.avatar.com.au > Sonic Communications Research Group, > University of Canberra: > www.canberra.edu.au/vc-forum/scrg > > > > _____________________________ > David Worrall: so...@av... > > > > > ---------------------------------------------------------- > --------------- Take Surveys. Earn Cash. Influence the > Future of IT Join SourceForge.net's Techsay panel and > you'll get the chance to share your opinions on IT & > business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Sndobj-devel mailing list > Snd...@li... > https://lists.sourceforge.net/lists/listinfo/sndobj-devel |
From: sonify <so...@av...> - 2007-03-21 14:41:26
|
Hi Victor, all, I'v been trying to work out the most appropriate way of installing pysndobj in the OSX framework structure. Giiven /Library/Frameworks/Python.framework/Versions/Current/lib/python2.4 the /site-packages/ sub directory seems to be the right place for the sndobj.py but I'm not sure where the best/most usual place is for libsndobj.dylib and _sndobj.so can someone tell where the best/most usual places are for the libraries? thanks, David _________________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: www.canberra.edu.au/vc-forum/scrg _____________________________ David Worrall: so...@av... |
From: Victor L. <Vic...@nu...> - 2007-03-20 08:44:21
|
would it be because somehow the objects have been destroyed before the Read() etc calls? Sometimes it can happen, depending on how your code is arranged that they get destroyed, esp. if they are local variables. Try using a class and making the SndObjs class members (as in the manual example). Victor At 22:34 19/03/2007, Rory Walsh wrote: >Sorry I should have mentioned that the crash only happen when I call >either Read(), DoProcess() or Write()... > >Rory Walsh wrote: > > I'm getting some odd behaviour with a simple Sndobj app I'm building > > with wxWidgets. I have the following simple code: > > > > ... > > SndWave input("Radiohead.wav", READ); > > SndRTIO output(1, SND_OUTPUT); > > SndIn signal(&input); > > output.SetOutput(1, &signal); > > > > for(int i=0; i<dur*(DEF_SR/DEF_VECSIZE); i++) > > { > > input.Read(); > > signal.DoProcess(); > > output.Write(); > > } > > ... > > > > When ran as a command line app it works fine and plays the audio. If I > > insert it to an OnButtonPress() method it causes a crash. I know I > > should be using threads but I'm trying to show some students why threads > > are necessary. Running this code should play some audio even though the > > application will freeze for 10 seconds. I'm using windows and MinGW. > > Any ideas? > > > > Rory. > > > > > >------------------------------------------------------------------------- >Take Surveys. Earn Cash. Influence the Future of IT >Join SourceForge.net's Techsay panel and you'll get the chance to share your >opinions on IT & business topics through brief surveys-and earn cash >http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >_______________________________________________ >Sndobj-devel mailing list >Snd...@li... >https://lists.sourceforge.net/lists/listinfo/sndobj-devel Victor Lazzarini Music Technology Laboratory Music Department National University of Ireland, Maynooth |
From: Rory W. <ror...@ea...> - 2007-03-19 22:34:42
|
Sorry I should have mentioned that the crash only happen when I call either Read(), DoProcess() or Write()... Rory Walsh wrote: > I'm getting some odd behaviour with a simple Sndobj app I'm building > with wxWidgets. I have the following simple code: > > ... > SndWave input("Radiohead.wav", READ); > SndRTIO output(1, SND_OUTPUT); > SndIn signal(&input); > output.SetOutput(1, &signal); > > for(int i=0; i<dur*(DEF_SR/DEF_VECSIZE); i++) > { > input.Read(); > signal.DoProcess(); > output.Write(); > } > ... > > When ran as a command line app it works fine and plays the audio. If I > insert it to an OnButtonPress() method it causes a crash. I know I > should be using threads but I'm trying to show some students why threads > are necessary. Running this code should play some audio even though the > application will freeze for 10 seconds. I'm using windows and MinGW. > Any ideas? > > Rory. > > |