wackazong Posted October 2, 2008 Report Share Posted October 2, 2008 Hi,at the risk of being a bit off-topic:I want to program a driver for a MIDIBox project in Cocoa/Objective C/Xcode. Since some of you are using that as well: Do you have any tips for good classes that provide Core Midi and Serial Port functionality?Thanks,ALEXander. Quote Link to comment Share on other sites More sharing options...
Narwhal Posted October 2, 2008 Report Share Posted October 2, 2008 Yeah I have some code for this at home that works very nicely. Actually its a framework that you link into your code and it simplifies communications to, and management of, the midi endpoints.Check out Pete Yandell's PYMIDI framework. Quote Link to comment Share on other sites More sharing options...
Narwhal Posted October 2, 2008 Report Share Posted October 2, 2008 Also I'd be happy to share the last application I was working on that used PYMIDI, but I can't guarantee that it's the best cocoa programming the world since I'm still learning its quirks. Quote Link to comment Share on other sites More sharing options...
sineSurfer Posted October 2, 2008 Report Share Posted October 2, 2008 I'd like to see your source/app narwahl ;) Quote Link to comment Share on other sites More sharing options...
Narwhal Posted October 2, 2008 Report Share Posted October 2, 2008 Ok I'll gather it up when I get home. The application finds a connected Waldorf XT then requests all the patches from it so that it can extract the patch names, and hopefully someday it'll write them out to a file in the format that logic uses so that my logic environment objects can have all the real current patch names. I've always wanted to take this application way further, but it rarely comes up very high on my list of things to do :-)It current does succeed at receiving all of the patches and remember it's window settings. Quote Link to comment Share on other sites More sharing options...
wackazong Posted October 3, 2008 Author Report Share Posted October 3, 2008 Yep, would be very nice if I could have a look at that!Thanks and best, ALEXander. Quote Link to comment Share on other sites More sharing options...
Narwhal Posted October 3, 2008 Report Share Posted October 3, 2008 I just wanted to let you know that I'm working on getting this ready, but the last time I looked at this code I had a PPC Mac and the previous version of XCode, so it's going a little rocky at the moment.I'm having to update the PYMIDI framework so it will contain PPC and Intel code. Pete has posted his framework in a less than useable format right now. I have it building successfully but it's failing to load the framework library for some reason.If anyone knows anything about cocoa frameworks, this is the error I'm getting:dyld: Library not loaded: /Users/kurtarnlund/Library/Frameworks/PYMIDI_2008.framework/Versions/A/PYMIDI_2008 Referenced from: /Users/kurtarnlund/Documents/Software Projects/My Midi Apps/XT Patch Grabber.2008/build/Debug/XT Patch Grabber.2008.app/Contents/MacOS/XT Patch Grabber.2008 Reason: image not foundKurt Quote Link to comment Share on other sites More sharing options...
Narwhal Posted October 3, 2008 Report Share Posted October 3, 2008 From the error message I was quite dumb. I just needed to copy the framework into my ~/Library/Frameworks directory.I have it running, but here is the gotcha. I have two versions of this program.The first version I named "XT Patch Grabber 2007", catchy name I know. This one works and grabs patches and puts the names into the columns of a table view. But.. its code is super super horrible, and some of the interface items are broken. It's really the first time I ever started to play with cocoa, so the code is all in one file, and may be exceedingly hard to follow.The second version I named "XT Patch Grabber 2008". This one has been built from the ground up to have a clean code organization, with view controllers and data controllers and the whole works. I think it's a darn good example of how I'd like build a cocoa app and interface. But this version of the program seems to be more of a work in progress, in that it doesn't yet actually do anything (that I can tell yet). It does however have most of the code to actually do the same things as the 2007 version. I just need to hook up the buttons, and fix the things that the new XCode complains about.I have all of next week off for vacation and this is a prime example of the kind of things I want to work on during that time. If you can wait until early next week, I'll share what I can get going because I don't think anyone should learn how to do this by looking at the 2007 version.Kurt Quote Link to comment Share on other sites More sharing options...
sineSurfer Posted October 4, 2008 Report Share Posted October 4, 2008 hey, no hurry on this side, I guess we can wait some more time to learn from your app ;)Thanks Kurt! Quote Link to comment Share on other sites More sharing options...
Narwhal Posted October 6, 2008 Report Share Posted October 6, 2008 Ok here we go. While it's far from done, it is at least doing something usable now, and demonstrated using the PYMIDI framework. There are three attachments below.1) PYMIDI_RELEASE_FRAMEWORK.zip - Take the contents of this and place the PYMIDI_2008.framework in ~/Library/frameworks folder. NOTE: You will most likely need to create the frameworks folder, I did. The app will not run without this framework in place. I've included Pete Yandell's license and other files just so you know I didn't create them.The reason that I named this PYMIDI_2008 is because it now contains both i386 and PPC code, so it should be useable by most os x users here. There may be other ways for the code to locate this framework. If you know of a way that is cleaner than the frameworks folder, please let me know.2) Shows you how to setup xcode to get the PYMIDI source.. its super simple to make a framework project for this code, but I'm lazy and don't feel like going into those details. Just use the framework that I've already built and reference this code to see how it works. http://notahat.com/pymidi3) XT Patch Grabber 2008.zip - This is is my code tree for the patch name grabber app. Currently, the search button works very nicely. When you click search, it will setup a timer and send a LCD screen request to all of your MIDI output ports to located the first Waldorf XT that responds. Additionally, it tries all device ID's starting from zero and incrementing to 126 until it gives up. The window saves all of its setting, but for some reason it never saves the setting unless its an item that the user has clicked on. This means that it doesn't save the selected ports and device id that it determined from a scan.The app is probably pretty close to grabbing patch names, but I want to build it all the correct cocoa way and not use char pointers all over the place. At least it shows you how to deal with the endpoint lists and sending and receiving midi. If you have a microwave XT and want help out with this, let me know.** UPDATE 2008-10-07 **XT Patch Grabber.2008.zip - contains memory leak fixes and now actually grabs patch names in both batch and single patch mode.KurtPYMIDI_RELEASE_FRAMEWORK.zipXT Patch Grabber.2008.zipPYMIDI_RELEASE_FRAMEWORK.zipXT Patch Grabber.2008.zip Quote Link to comment Share on other sites More sharing options...
sineSurfer Posted October 7, 2008 Report Share Posted October 7, 2008 Thanks a lot Kurt, as soon as I get out of some freelances i'll take a look at your files and see what I can learn hehee Quote Link to comment Share on other sites More sharing options...
Narwhal Posted October 10, 2008 Report Share Posted October 10, 2008 For those that care, I've updated the patch grabber zip file in my post above. It's now much much better, and is about 80-90% functional. You will want to reference this version because the last post had memory leaks and was pretty incomplete.Kurt Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.