Porting Max/MSP .app to iOS - iphone

I've read a number of posts on Apple's forums, and a number of posts on the Cycling '74 forums (with my own questions scattered around both) and nobody seems to be able to help me.
I used Max/MSP to write a 'patch' that takes samples and generates music. I'm going to release it as an album similar to Brian Eno's Thursday Afternoon, but wanted to make it available to people so they can have the music last for more than the hour a CD can hold.
What I don't know how to do, and can't figure out is HOW. It looks just like a regular OS X app, and the only difference I see in the directory structure is that my Max/MSP made application has extra .framework folders as well as the objects I use (which I guess are similar to 'functions' in JScript). I've looked at the package contents of both OS X files and the unpacked .ipa files from the App Store. Being so similar I would imagine it'd be pretty easy.
Where do I start? Has anybody on this forum done this? Thanks for your time!
[edit] - I just wanted to let you know I've discovered RJDJ, an iOS app that allows users to create 'scenes' in Puredata (Pd) and load them on their RJDJ program. I'd rather not go this route.
[edit2] - ok. I agree that it's very different. Especially having 4 (i could cut it down to 3) additional frameworks that aren't part of the SDK. But Ive been thinking. I can add a JavaScript object inside of my program, or make a special new object (object in max is sort of like a class in JS, i think) using C. Is there anything in these languages that would be able to convert a simple 'touch' to a 'mouseclick' in my app?
My application is very very simple. Basically just samples, played at randomly generated time intervals with some a 'conductor' to bring in/out the groups the samples are drawn from (piano, fx, etc...). So the user just clicks the 'start' button and off it goes. So the .nib file I would need to create is very simple. In my head it seems like the .ipa package/ios .app both contain unix executables and so long as these are basically the same it should work, right?

Max6 has been released.
A new object/concept named gen~ is available.
As far as I discussed with C74 dev, I know gen~ WILL provide its source code output. This code produce by the gen~ object could be useable in any other framework. basically, it will be C++
So it would really open A LOT of possibilities ; Max becoming a real graphical framework producing output that can be used in programming world.
It would save time for some part of the code.

As far as I can see from poking around at the Cycling '74 site and forums, there's currently no Max engine available for iOS. libpd is probably your best bet, really. (I'd note that the Inception app uses this Pure Data engine with a custom interface and it works very well.)

Unfortunately OSX and iOS apps are completely different under the hood. Outwardly they look similar (eg. you've noted the .app extension) but the internals are completely different.

Related

Ebook with Ionic 3

Working with latest version of Ionic (3.x). I am working simply on programming an Ebook with almost 200 pages (in 4 languages).
I find not good to embed the whole html textes in a one <ion-content>. So I thought about a solution more sophisticated, such as dividing into chapters, so I am between 2 solutions (none of them works btw).
1. Use ng-include which after hours I found out that it is not more supported in Ionic (I hope I'm wrong).
2. Create a component for each chapter (the template is the chapter text wrapped in HTML). But I think that this one is performance-costly because at program launch there will be creation of many views of the components.
Any better advice?
I don't think I would try to load the entire book's content into the app. I would fetch content on an as-needed basis. You also need a solution that will scale with size of the device display, so the one-component-per-chapter idea is probably not the best choice.
(Additionally, I would take a step back and ask why the book isn't being distributed on already established platforms, e.g. mobi, ePub, etc. But this is outside of the scope of your posted question, of course.)

Embed/Read Command Line Tool in a Cocoa App (Swift 3)

I'm new here, so please be kind - I am open for tips and corrections ;)
Actually I'm trying to write an OS for a Sportsmachine. It basically contains a Joystick (JoyWarrior A8) input via USB. After some time I am now able to read the axes of the Controller using XCode, a Swift Command Line Tool with OpenGL and GLFW. The axes position is put out into the console.
What I would like to do now is to use this output in a Cocoa App to write the UI.
My questions to you are:
Is there a way to integrate and read a Command Line Tool within a Cocoa Application?
Or is there a better way to directly integrate the input into my Cocoa App?
Thank you in advance! Please let me know if something isn't explained well enough or if you need some code snippet!
As a rule-of-thumb, if you ever find yourself wondering whether Apple has an off-the-shelf solution for a feature you're trying to implement, ask yourself if the feature would be of use to a significant number of other developers. If you think that it would, you should do some googling, because there's a good chance that you're right, and that Apple will already have a library/framework that does what you need. It's fair to say that interacting with a game controller is just such a feature, and, true to form Apple, provides API to save you from having to re-invent the wheel (or use third-party wheels) - here's the guide.

Objective C- Obtaining Page Screenshot/Image from URL

I'm writing an app that will take a csv file of URLs and should be able to display images of the URL pages that can be looked through. I'm wondering if anyone knows a way in Objective-C to get an image of a page from a URL? I know that it can be done with python and the qtWebKit, but I'm hoping that I don't have to write another script in python and that there is a way it can be done in Obj-C.
Thanks
At the bottom of this page you find the link to the source of Paparazzi!, a Mac app written in Objective-C and using WebKit that does pretty much what you're after.
Its current version's (v0.5) source is not available, but up to v0.3 it is and should be enough to get you started (or at least give you an idea).
Paparazzi! is a small utility for Mac OS X that makes screenshots of
webpages.
It’s written in Objective-C using the Cocoa API and the WebKit
framework.
It was inspired by webkit2png, a commandline tool written by Paul
Hammond in pyObjC.
http://derailer.org/paparazzi/

Is there a good iphone sdk documentation site that provides good examples / common usage?

The problem? I look up stuff in the xcode documentation and find very useful lists of objects, methods, etc... But then I still have to go somewhere else to find useful example code of how to use that object. For example, I looked up NSNumber yesterday and found all of the neat stuff it can do, but I still had no clue how to use it. That's just an example. I'm sure I could read the objective c pdf front to back and learn something there (which I plan on doing) but what about later? When I'm looking up some UIKit object? Do I have to go find a tutorial each time (or lately, I just ask StackOverflow and you guys take care of me).
Is there a part of the apple website / xcode documentation that shows the example code I'm looking for?
Is there a wiki site out there or something that has what I'm looking for? (I just tried a simple google search "iphone sdk wiki". this site could be good. iphone sdk wiki . I'll check it out. Anyone else have one they like? )
This is also sort of a mild complaint to Apple. Why not a section on each code definition page that shows usage?
I've found the sample code section on Apple's iPhone Developer Connection be extremely useful not only for samples of complete applications but also a best practices source. Going through the code of The Elements, for example, will expose you to how to use particular classes as well as how to structure your code. It is a wonderful example of how to create a non-trivial iPhone app.
Look in developer.apple.com/iphone they have pretty good documentation (you can use the search bar there) on all the classes and have a lot of good sample code..
I really would emphasize the "Related sample code" section on many, if not most, of the documented classes.
But, IMHO, there isn't any easy way of acquiring the knowledge to develop in Cocoa/Cocoa Touch. The API's are so numerous that it simply takes a lot of time and experience. You just have to work on it, look at a lot of books and study the sample source code where available.
I've tried to take a purposeful approach by carving out some time every week to learning a new API/class irrespective of whether my current project needs it or not.
Alternatively, search Joe Hewitt. He's the developer for iPhone facebook. He has a project you can download that demonstrates all the features of facebook. It's an awesome open source project!
When you look something up in Xcode Developer Documentation, you sometimes get a Related Sample Code: text that tells you what Sample the method or property is used in. Too bad you can't click on it to see the code, but if you do click it takes you to the page to download the sample. – mahboudz 0 secs ago
Apple Developer site has all kinds of code examples. Try searching google for a UICatalog project, it will show you all the basic UI stuff you can do, like adding buttons and progressbars through using only code.

Reference for the C methods used in iPhone development

Is there a good reference somewhere with all the C functions that can be used by default in iPhone development (I guess they lie in the Foundation framework)? I mean functions like:
arc4random(), cos(), sinf(), hypot(), sqrt(), sqrtf() etc...
They are so many considering their variations too (sin(), sinf()) and googling every single time is ineffective.
Thanks :)
XCode/Help/Documentation
Then look in the Core Library. You may need to subscribe to one or more documentation sets first. Check that you search is not limited to Objective-C also.
If you're looking for all of the math functions, they can be found in the header file
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include/math.h
For more generic functions, in addition to the documentation, I often find it helpful to right-(or Control-)click on a function in my code and choose "Jump to Definition". This takes you to the related header, which might also have similar functions and constants.
The Apple iPhone OS Man Pages doc is the handiest guide for this kind of thing.
http://developer.apple.com/iphone/library/documentation/System/Conceptual/ManPages_iPhoneOS/
Unfortunately being HeaderDoc driven, there's no PDF version. I thought at one point Apple indexed these symbols in the Xcode docset API indexes, but they don't seem to be there now.
Good luck!