SndObj compile on OSX?

Posted this on the SndObj forums, but figured I’d try here too. Has anyone compiled SndObj on OSX? It looks really cool from the little I’ve seen of it (just heard of it earlier this evening) and I want to play around with it, but I get a bunch of odd errors when I try to compile it for OSX:

include/SndObj/SndRTIO.h:97: error: ‘AudioDeviceID’ does not name a type
include/SndObj/SndRTIO.h:166: error: ‘AudioDeviceID’ has not been declared
include/SndObj/SndRTIO.h:161: error: ‘DEF_BSIZE’ was not declared in this scope
include/SndObj/SndRTIO.h:161: error: ‘DEF_PERIOD’ was not declared in this scope
include/SndObj/SndRTIO.h:161: error: ‘SHORTSAM’ was not declared in this scope
include/SndObj/SndRTIO.h:166: error: ‘DEF_DEV’ was not declared in this scope
include/SndObj/SndRTIO.h:173: error: ‘DEF_BSIZE’ was not declared in this scope
include/SndObj/SndRTIO.h:174: error: ‘DEF_PERIOD’ was not declared in this scope
include/SndObj/SndRTIO.h:174: error: ‘SHORTSAM’ was not declared in this scope
include/SndObj/SndRTIO.h:179: error: ‘DEF_DEV’ was not declared in this scope
include/SndObj/SndRTIO.h: In constructor ‘SndRTIO::SndRTIO(short int, SndObj**)’:
include/SndObj/SndRTIO.h:204: error: ‘DEF_BSIZE’ was not declared in this scope
include/SndObj/SndRTIO.h:204: error: ‘DEF_PERIOD’ was not declared in this scope
include/SndObj/SndRTIO.h:204: error: ‘SHORTSAM’ was not declared in this scope

seems like a misconfiguration thing because all those variables are defined in SndCoreAudio.h, but I’m not sure what’s up with it. Be curious to see if anyone else has had any luck or similar issues. Thanks!

figured it out: gotta add -DMACOSX to the args to GCC

ah nice,

I’ve added a zip here:

openFrameworks.cc/files/sndObj_mac.zip

with an xcode sndobj compile project and an example app (with the compiled sndobj in the src of the example for now). it doesn’t do much (just some basic synthesis) but it looks really promising for exploration

take care!
zach

so what are the main differences between this and stk
http://ccrma.stanford.edu/software/stk/

I have a very small amount of experience with either - they seem pretty similar, but somehow sndobj seems a bit easier for me to get to the kinds of things I really like to do with synthesis. sndobj seems to have more support for input and input processing, etc.

I’ve used CSL before too, although the current version seems to not compile, the older version is quite well designed and easy to play with.

there are some intro texts here:

http://www.iua.upf.es/~xamat/Thesis/htm-…-sub:SndObj
http://www.iua.upf.es/~xamat/Thesis/htm-…-ml#sub:STK

and a text where they seem to diss every synthesis library :wink:

http://www.iua.upf.es/~xamat/Thesis/html/node133.html

it’s on the CLAM page, which is another alternative, but for which I couldn’t see an easy way to hook into OF.

take care!
zach

I’ve been playing with SndObj more and have gotten it to do some pretty cool stuff without a ton of effort. I think ofxSndObj would be pretty easy to put together and could be really useful, I’m going to give it a crack this weekend. The one thing that’s still tripping me up is mic access on my MacBook. I’ve asked Victor Lazzarini about it (he’s a super nice guy btw) but still haven’t gotten anything back, so maybe I’ll put it here:

  
  
	core = new SndCoreAudio();// this being SndCoreAudio *core;  
	  
	insoundL = new SndIn(core, 1);   
	insoundR = new SndIn(core, 2);   
	  
	core->SetOutput(1, insoundL);  
	core->SetOutput(2, insoundR);  
	  
	sndThread.AddObj(&audio);  
	sndThread.AddObj(core, SNDIO_IN);// core audio is in and out  
	sndThread.AddObj(insoundL);  
	sndThread.AddObj(insoundR);  
	sndThread.AddObj(core, SNDIO_OUT);//   
	sndThread.ProcOn();  
	ofSetFrameRate(30);   
  

I get nothing from this. No errors, but no sound back out. Anyone successfully done this?

Can anyone help me out on this? I’ve got it compiled on Linux and OSX but I don’t have a win machine. Ping me here or joshuajnoble@gmail.com. Thanks!

bumpity bump bump. Can anyone compile SndObj for me on Win so’s I can post the addon? Drop me a line. Cheers.

maybe you can just post the addon, and pc / linux folks will jump in ?

yeah, that makes a lot more sense :slight_smile:

I just ran into a problem linking against the SndObj libraries that I’m trying to get figured out. I wondered if someone else had run into this:

Here’s what XCode gives me:

/Developer/usr/bin/g+±4.0 -o /Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2/build/sndobj_two.build/Release/sndobj_two.build/Objects-normal/ppc/openFrameworks -L/Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2 -L/Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2/src/sndObj -F/Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Headers -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions/A -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions/Current -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions/A/Headers -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions/Current/Headers -filelist /Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2/build/sndobj_two.build/Release/sndobj_two.build/Objects-normal/ppc/openFrameworks.LinkFileList -lsndObjTry_v01 -framework CoreAudio -arch ppc -mmacosx-version-min=10.4 …/…/…/libs/freetype/lib/freetype.a …/…/…/libs/freeimage/lib/freeimage.a …/…/…/libs/fmodex/lib/libfmodex.dylib …/…/…/libs/GLee/lib/GLee.a …/…/…/libs/rtAudio/lib/rtAudio.a -framework Carbon -framework GLUT -framework CoreFoundation -framework OpenGL -framework QuickTime -framework ApplicationServices -framework AudioToolbox -framework CoreAudio -framework CoreServices -framework AGL -isysroot /Developer/SDKs/MacOSX10.4u.sdk
Undefined symbols:
“_usleep$UNIX2003”, referenced from:
SndBuffer::Read() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Read() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Write() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Write() in libsndObjTry_v01.a(SndBuffer.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
“_usleep$UNIX2003”, referenced from:
SndBuffer::Read() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Read() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Write() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Write() in libsndObjTry_v01.a(SndBuffer.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
cd /Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2
/Developer/usr/bin/g+±4.0 -o /Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2/build/sndobj_two.build/Release/sndobj_two.build/Objects-normal/i386/openFrameworks -L/Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2 -L/Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2/src/sndObj -F/Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2 -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Headers -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions/A -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions/Current -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions/A/Headers -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreAudio.framework/Versions/Current/Headers -filelist /Users/base/openframeworks/CLEAN_of_clean/apps/examples/sndobj2/build/sndobj_two.build/Release/sndobj_two.build/Objects-normal/i386/openFrameworks.LinkFileList -lsndObjTry_v01 -framework CoreAudio -arch i386 -mmacosx-version-min=10.4 …/…/…/libs/freetype/lib/freetype.a …/…/…/libs/freeimage/lib/freeimage.a …/…/…/libs/fmodex/lib/libfmodex.dylib …/…/…/libs/GLee/lib/GLee.a …/…/…/libs/rtAudio/lib/rtAudio.a -framework Carbon -framework GLUT -framework CoreFoundation -framework OpenGL -framework QuickTime -framework ApplicationServices -framework AudioToolbox -framework CoreAudio -framework CoreServices -framework AGL -isysroot /Developer/SDKs/MacOSX10.4u.sdk
Undefined symbols:
“_usleep$UNIX2003”, referenced from:
SndBuffer::Read() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Read() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Write() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Write() in libsndObjTry_v01.a(SndBuffer.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
“_usleep$UNIX2003”, referenced from:
SndBuffer::Read() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Read() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Write() in libsndObjTry_v01.a(SndBuffer.o)
SndBuffer::Write() in libsndObjTry_v01.a(SndBuffer.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

so the _usleep$UNIX2003 is something that was available in 10.5.2 and not 10.5.3+ I think. Has anyone else run into this? I’m guessing all I need to do is recompile the .a but I wonder if this or something like this (system props getting compiled into the libs) might continue to be problem.

Oh - yeah - I had this problem too.

Basically the problem is when you compile a library using a 10.5 target and then try and use it in a project that is compiling for 10.4 (as OF does). $UNIX2003 is a 10.5 specific variable.

The trick is to recompile the library (in your case sndObj) with the flags specifying that it should be linked against the 10.4u sdk.

If you are doing this on the commandline you need to set CFLAGS and CPPFLAGS before configure / make to:

set CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -mmacosx-version-min=10.4"

set CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -mmacosx-version-min=10.4"

then again changing the -arch to ppc
then lipo to join the ppc and i386 versions of the lib

If you are compiling sndObj in xcode then life is a lot easier - in project settings -> general - change Target SDK to 10.4u

didn’t realize I already had it compiled for 10.4u intel/ppc
here is the folder from ofxSndObj - with the updated .a

http://www.openframeworks.cc/files/sndO-…-ledOSX.zip

  • could you post an example project demoing the ofxSndObj addon?

it looks great - I just don’t know how to go about using it.

cheers,
theo

Hey theo, was getting to that, and was going to make a little announcement, as soon as I added buffer sharing between the SndObj thread and the OF app and FFT. A little later today I think.

Oops didn’t see the rest of your replies…I’m going to add this to the next release in place of the other lib I compiled. Strange, that is only 1.2m, i.e. so it can actually get uploaded to addons (you guys might want to tweak the redmine settings to allow larger file uploads, I’ve had trouble uploading larger files).