myUniverse project // Statements & questions after some explorations
May 28, 2012 at 8:37pm
myUniverse project // Statements & questions after some explorations
Here are some conclusions, some questions, some feelings for my system myUniverse.
Thanks for your time.
Little abstract before
I’m building a 3D based system in which I’ll placed objects.
What I really need
The system designed following this would be upgradable & totally open for me to create more visuals modules/bits to use them in this map, or that other one.
I’d need a way to place objects in my 3D map and to change their properties.
Some bits I explored
Here are some ways I explored in the previous days.
Each way involve:
-1/ JAVA as the core of all stuff
-2/ JS loading abstractions
Indeed, I’d need to create all getters / setters using a complex system of messnamed/receive/send objects.
-3/ JAVA loading abstractions
Even in the mood of my words, it seems obvious I’d prefer the 2 or 3 parts.
What would you advice to me about the way to follow ?
It makes a bunch of stuff.
I’d be very interested by a global vision about my system.
Especially about the architecture core+bits (where bits would be those famous objects in my 3D maps), and about the GUI to interact with it at composition time.
Last point: I have to begin, choosing one way but I know I’ll refine & sharp the system in the next months, years. Maybe, some parts (GUI, communication system with external) will be translated in C external (using open frameworks for instance) for efficiency. I know that. I mean, I’m conscious I won’t build THE system that fits at the first hours of code. But this step-point is important for me to really begin to code.
May 28, 2012 at 9:41pm
Have you had any sleep in the last week? ;)
Sorry to say I can ‘t give any advice at this level. It stops at pattr, preset and coll text files for me…
But I am very very curious to see how this works out! You’ll have my support with issues closer to my expertise.
May 28, 2012 at 10:00pm
Agreed, get some sleep! kidding…stay awake and keep working! This sounds very ambitious and I’m very interested in the outcome. I assume you’ve seen the video in the Interview with Tarik Barri?
His “Versum” system looks mind-boggling and sounds a bit like your system, maybe. I know he used several languages together to make it all work.
Lots of ways to do things, of course, but this could be a good direction. I would also not instantiate/destroy instances, I’d just load a ton of them and use active/inactive for both the GL drawing and the audio. I don’t think processing would be an issue if you do that, but then again, maybe you’re thinking about thousands of objects… :)
May 29, 2012 at 7:39am
dtr, thanks a lot for your support. I would have needs with pattr & preset. I probably have to design an xml storage system, but I won’t go there if I can do all with native objects. I didn’t check Dictionaries yet… it seems very powerful
seejayjames, thanks for your answer. I even met Tarik at the m4_u event in Leicester. I have been invited to present something but finally I only played music (which was very cool)
About the number of objects.
I feel the design becoming more precise.
May 29, 2012 at 3:43pm
I’d say that if you’re comfortable in approaching this in a procedural language–especially the data portion–that’s really the way to go. You can approach things like this in Max, but after a certain level of complexity, it gets to be a real pain. There’s probably a reason why the object inspectors are no longer written in Max… (well, probably many reasons, but complexity and maintenance probably factor in)
Personally, I would do it in Java because that’s what I know best, and it’s pretty easy to get things happening. If you’re more visual, you can even use the Matisse GUI designer in NetBeans to mock stuff up. MVC is already implemented in Java and it works. This will make your life substantially easier, especially if you have functions (e.g. orbits…) that are altering said celestial bodies. I would say that the biggest knocks on Java in Max are that you can’t do it within the patch (has to be in its own window) and the load time is a bit slow. IIRC there is an OpenGL extension to Java, so it’s possible that you could even keep the rendering in Java. The bigger slowdown from Java comes mainly from memory bloat, but it doesn’t sound like a throw the kitchen sink type project, either; in tight loops, java performance isn’t awful (~1.5X that of C), and I’ve used it to mock up C code since it means not having to reboot Max to test it.
Also, Java has a good set of generic collections, things like HashMap, EnumSet, ArrayList, and they can make your life so much easier. (example, you can define a custom sort function that will sort the list by activity/inactivity). The one thing I would check early is the latency via OSC vs. messages from Java.
Communication: I would highly recommend OSC. That way, if the load becomes too big on one computer, it’s relatively painless to add another as a mini-render-farm for audio/video. Also, you get hierarchical namespaces, which is a very good thing, and SC has native support.
A fun trick in surround is to apply very small (often single-digit) frequency shifts to the different channels to provide a weird spaciousness/detune.
Anyways, my two cents.
May 29, 2012 at 4:06pm
Hello Peter and HUGE hugs for your huge answer.
I’d like to keep Max as the central core.
What would you think about instantiating all Jitter stuff in JAVA VS calling already made patcher/abstractions ?
As you mentioned MVC, I feel the difficulties already around messaging.
I played today with JS & some abstractions (drawing or not OB3D in the opengl renderer ).
In order to have positions of ALL objects I have to send them request (what a “noise” … I mean what a lot of data)
This would mean I’d have all calculation made in JS
Anyway, your answer is very interesting for me.
May 29, 2012 at 4:34pm
I haven’t done scripting with Java, but it’s also one of those things you probably just have to get “over the hump” with and then it’ll be fine. Have you gone through the MXJ api? I think there’s some stuff on scripting in there, IIRC. The important thing to know is that MaxObject is really just a way for your classes to interface with Max, and not all of your classes have to subclass MaxObject; it’s just the ones that directly talk to Max. It’s the part that makes your java code have inlets/outlets/etc. Also, it can talk to pattr, which could be a big plus.
I greatly prefer Java over JS because of the generic question. I know there are ways of removing single values from the middle of arrays in JS, but it’s probably something like slicing and then recombining. You could probably make a lambda function to add this, but it would be nice if JS had more built-in data types… I have a former student of mine who is a JS with Max ninja, and I can send you his info via PM if you like.
You can always keep Max for the rendering. I just find that it becomes a bit cumbersome when you get to problems involving state. (e.g. where you have several functions that could be changing the value of 1 variable, and each needs to know the value of said variable; in a procedural language, there’s more built-in support for this, so it’s less ugly)
Curious as to what the abstractions are doing in terms of calculation (orbits? Any comets?). What sort of classes are you looking at?
May 29, 2012 at 11:19pm
Peter, again big thanks for your answer.
Yes I made things with JAVA in Max.
In my case, my abstractions (made with Max & jitter) are created in the patcher dynamically. (using newdefault : file://localhost/Applications/Max6/java-doc/api/com/cycling74/max/MaxPatcher.html#newDefault(int, int, java.lang.String, com.cycling74.max.Atom) )
This provide me a nice way to assemble my visuals bits on a side (a bunch of abstractions made with Max/Jitter) and the core would placed them as required by my (future) presets system (using probably XML)
All my abstractions will be built on a basic standard (my standard I mean)
I tested with some object, it works fine.
I’ll use data type providing more efficiency than Arrays in JAVA. (Map Object seemss nice)
About the Max and cumbersome side of things.
About abstractions for visual purposes.
asap, I’ll show results for sure
May 30, 2012 at 8:10pm
I made huge progress and I wanted to thank all my precious helpers here :)
Especially, I began to code the core and to design the messaging system.
Now my main question is: would I split that JAVA Core into pieces or not ?
I’ll create a special GUI Patcher plugged into the JAVA Core and, for instance, I could delegate all GUI stuff (basically only for composition my pieces into myUniverse) to another JAVA … sharing the same memory space, variables etc..
what do you think ?
You must be logged in to reply to this topic.