General
Current limitations ram and midi
Started by mbncp on .
Sign in or create an account to join the conversation.
Havn't been coding lemur much lately, but I have a project running in my head for a while, but would like to know if it's possible.
I want to create some midi/event loop recorder/player, some external midi and some internal events (xy pads,..).
The idea is to control up to 8 ipads from a mini or a iphone 4s, using each at least one or all of the following: midi app, synth, fx, audio recorder(loopy,..)
The max loop length would be 128 bars so this could generate a lot of events as I would send the clock as well.
So...
A)
Is lemur/ios capable of sending all these events ? Here I will use the laptop to distribute the differnt "tracks" to the right port/channel to avoid too much traffic on each ipad.
B)
The biggest problem is the array size, is it still limited to 256 elements ? I don't remember, can we use pointers to access arrays, otherwise the coding will be awfull.
thanks for any help
I want to create some midi/event loop recorder/player, some external midi and some internal events (xy pads,..).
The idea is to control up to 8 ipads from a mini or a iphone 4s, using each at least one or all of the following: midi app, synth, fx, audio recorder(loopy,..)
The max loop length would be 128 bars so this could generate a lot of events as I would send the clock as well.
So...
A)
Is lemur/ios capable of sending all these events ? Here I will use the laptop to distribute the differnt "tracks" to the right port/channel to avoid too much traffic on each ipad.
B)
The biggest problem is the array size, is it still limited to 256 elements ? I don't remember, can we use pointers to access arrays, otherwise the coding will be awfull.
thanks for any help
I can tell you for sure, the 256 limit still exists.
Thanks,Softcore wrote:I can tell you for sure, the 256 limit still exists.
A real shame, lemur could be such a great tool without these silly limitations.
It seems that creating an array of pointers to array isn't possible.
Workaround would be to create a bunch of hiden objects like multisliders and use getfirst/next to store these events but this may drastically increase ram usage.
Btw, didn't find this in the doc, but is it possible to create objects dinamically ?
Uhmmm, sorry....thats a second "no" - as in you can't create dynamically an object...you can only have it shown or hidden but it has to be there, in the template, in the first place.
Thanks again for the bad news, I had in mind this was possible.
One more thing, it seems that if I make changes to some objects even within a script, and save it as a new project it will reload as is, working a bit as a preset handler. As I will have to configure ports,channels, cc's, ranges, well a bunch of different things, it could be handy to use it or are there things that I should be aware.
Another option is to create different init scripts but I find it a bit painfull to enter edit mode and start to type things each time.
Another trick I was thinking of is create presets on new pages.
Lets say that that page 1 is the main working page, page 2 being used for settings. Now if I duplicate (copy/paste) that page I should have a new preset and so on. Then the first page would get the setting from the last visited page. Using getfirst/getnext should do the trick, or am I dreaming again ?
Last option would be to plunge into ios coding, that's why I got a macbook air btw
One more thing, it seems that if I make changes to some objects even within a script, and save it as a new project it will reload as is, working a bit as a preset handler. As I will have to configure ports,channels, cc's, ranges, well a bunch of different things, it could be handy to use it or are there things that I should be aware.
Another option is to create different init scripts but I find it a bit painfull to enter edit mode and start to type things each time.
Another trick I was thinking of is create presets on new pages.
Lets say that that page 1 is the main working page, page 2 being used for settings. Now if I duplicate (copy/paste) that page I should have a new preset and so on. Then the first page would get the setting from the last visited page. Using getfirst/getnext should do the trick, or am I dreaming again ?
Last option would be to plunge into ios coding, that's why I got a macbook air btw
Actually guys, it is possible to create objects dynamically - here's how:
http://forum.liine.net/viewtopic.php?f=25&t=929&hilit=undocumented+functions#p3266
The problems lie in what you can then do with those dynamically created objects - without explicit naming (and arrays / vectors) . . . not so much. So you're faced with the task of building a more involved constructor - something I'd like to attempt myself but have abandoned plans to.
Too steep a learning-curve for this user just to address the shortcomings of a pretty fundamentally broken programming-model in Lemur (IMO). I'm astonished that Liine persisted with the original codebase since these shortcomings are well-known to them from the early JM days.
http://forum.liine.net/viewtopic.php?f=25&t=929&hilit=undocumented+functions#p3266
The problems lie in what you can then do with those dynamically created objects - without explicit naming (and arrays / vectors) . . . not so much. So you're faced with the task of building a more involved constructor - something I'd like to attempt myself but have abandoned plans to.
Too steep a learning-curve for this user just to address the shortcomings of a pretty fundamentally broken programming-model in Lemur (IMO). I'm astonished that Liine persisted with the original codebase since these shortcomings are well-known to them from the early JM days.
LOL, I even posted in that thread.
If the object can't do anything then it's not very usefull in most situation, but in my case I could create a bunch of multi something and use them to store my data. A bit ugly but at least I can then access these object like pointers.
AFAIK, getfirst/next(obj) returns a pointer to the object that I could store in one or a few arrays.
I'm not sure lemur will let me create 2000 multisliders, but it's worth a try.
It was probably much easier to start with the old code and now, just increasing the array size may be complicated.
It's a bit frustrating when you use just lemur on a single ipad, having a few hundreds of MB and dealing with arrays of 256 bytes or ints.
But IMO, the ipad editor was a big priority, and probably a lot of work, they could have charged me at least 10 bucks for it.
If the object can't do anything then it's not very usefull in most situation, but in my case I could create a bunch of multi something and use them to store my data. A bit ugly but at least I can then access these object like pointers.
AFAIK, getfirst/next(obj) returns a pointer to the object that I could store in one or a few arrays.
I'm not sure lemur will let me create 2000 multisliders, but it's worth a try.
It was probably much easier to start with the old code and now, just increasing the array size may be complicated.
It's a bit frustrating when you use just lemur on a single ipad, having a few hundreds of MB and dealing with arrays of 256 bytes or ints.
But IMO, the ipad editor was a big priority, and probably a lot of work, they could have charged me at least 10 bucks for it.
Wow I didnt know that!
But yeah kind of useless if you can't further control it.....and I assume you can't even delete it afterwards.....
But yeah kind of useless if you can't further control it.....and I assume you can't even delete it afterwards.....
There is a destroyobject(obj); function, and also getattributelist(object) that returns the name of all attributes.
Then you can set/get the values of these attributes. Now I'm not sure if you can get the x,y,.. values.
If so you could then create an On Frame callback somewhere and check if these values have changed, and trigger a midi/osc message or whatever.
Then you can set/get the values of these attributes. Now I'm not sure if you can get the x,y,.. values.
If so you could then create an On Frame callback somewhere and check if these values have changed, and trigger a midi/osc message or whatever.
Interesting.....just tried it and I got the following "oxymoron" - "paradox"....
Once FaderX was destroyed, the script that was set to destroy it became red because there was no FaderX anymore to destroy lol!
Good to know though!
BTW, we are not able to set any midi-OSC mappings via scripting so we are limited to scripted outputs for the created object I guess.
Once FaderX was destroyed, the script that was set to destroy it became red because there was no FaderX anymore to destroy lol!
Good to know though!
BTW, we are not able to set any midi-OSC mappings via scripting so we are limited to scripted outputs for the created object I guess.
I hate when these scripts get red. I guess that in this case, the idea would be to create an array of object names or just store the getobject value in an array, then access these object indirectly to avoid scipting errors.Softcore wrote: Once FaderX was destroyed, the script that was set to destroy it became red because there was no FaderX anymore to destroy lol!
Not sure I get this right, but of course you would have to create the mapping yourself in a user function likeBTW, we are not able to set any midi-OSC mappings via scripting so we are limited to scripted outputs for the created object I guess.
midibyte = scale(x, imin,imax, omin,omax)
For simple things I find it better to use the settings directly on the object in the editor, but for more complex coding I found it way easier to deal with that stuff myself. I use to set all my settings in some global init function where I could write some info, which is much easier than having to go thru a bunch of objects to see what's going on.
Yup, the object array and indirect access to objects was the first thing that came to mind.mbncp wrote: I hate when these scripts get red. I guess that in this case, the idea would be to create an array of object names or just store the getobject value in an array, then access these object indirectly to avoid scipting errors.
Not sure I get this right, but of course you would have to create the mapping yourself in a user function like
midibyte = scale(x, imin,imax, omin,omax)
For simple things I find it better to use the settings directly on the object in the editor, but for more complex coding I found it way easier to deal with that stuff myself. I use to set all my settings in some global init function where I could write some info, which is much easier than having to go thru a bunch of objects to see what's going on.
As for the mappings, yeah we ar ein the same boat, although the problem is, when you dont have the "factory" midi-OSC mappings, you dont have bi-directional communication.
Not exactly, but then again you need to deal with it yourself, which gives you also far more possibilities, you decide when and what to update, doing fancy remapping, ...you dont have bi-directional communication
IMO, there are two ways to work with Lemur, either you do everything using the editor with maybe a few scripts here and there or you do (almost) everything with scripts, using "global" functions that can be re-used in every project.
The first approach is easier but can be limited and painful to make just a few changes.
With the second one and if it's well done it's quick to make a single change on 50 objects, most of the code can be re-used in every project and there is (almost) no limit to what you can do.
In that case, the only function you need on any object is an On Expression that calls a global function with GetObject() and the value as parameter. And even this can be avoid by using a global on frame callback.
When I say global functions it's probably not the best as AFAIK it's not possible to copy them from one project to the other.
Best is to use some dummy objects and fill them with user functions. So you could have an object that deals with array functions, one with midi stuff, object specific, ... then a simple copy/paste and you have all you need in your new project.
Oops sorry, I'm speaking to myself, again
It's just that I have a couple of ipads now and have some "ambitious" project in mind using lemur and really want to start on the right feet, with reusable code, simple to maintain and quick to configure. When I try user project and I have to change port,channel, cc assignment on every control I get depressed lol
Of course, I meant, right out of the "box"....
Yeah hear ya but the whole thing accumulates to be lots and lots of work hours - when you want everything in scripts, while it's a matter of simple mapping when you are using the "factory" mappings. Not to mention various shortcomings like stuttering controls which require more "thought-out" scripts for output AND input (feedback). (here's some thoughts on this)
My personal way of working is to avoid, therefore, things that can be done with the "factory" settings - fields and rely on scripts only for certain occasions where there cant be any other way...
For example, a well-thought out template which uses many objects in many containers and one or two "parent" objects. The end user can easily change the MIDI - OSC target if the developer provisioned to have all the contained elements set to "parent" target - a change of the "parent" object target will also force the rest of the objects to follow. Have I personally done it in my user-library contributions? No, I havent in most of them, because I learn as I go!
Yeah hear ya but the whole thing accumulates to be lots and lots of work hours - when you want everything in scripts, while it's a matter of simple mapping when you are using the "factory" mappings. Not to mention various shortcomings like stuttering controls which require more "thought-out" scripts for output AND input (feedback). (here's some thoughts on this)
My personal way of working is to avoid, therefore, things that can be done with the "factory" settings - fields and rely on scripts only for certain occasions where there cant be any other way...
For example, a well-thought out template which uses many objects in many containers and one or two "parent" objects. The end user can easily change the MIDI - OSC target if the developer provisioned to have all the contained elements set to "parent" target - a change of the "parent" object target will also force the rest of the objects to follow. Have I personally done it in my user-library contributions? No, I havent in most of them, because I learn as I go!
Agree not for every situation, I was just thinking loud.
I did some more testing with createobject and this looks good.
My idea is to create small modules that I'll send on a server (probably to lemur on my iphone) and being able to recall them from any of my ipads. So I could have up to 6 of these modules on a single page controlling midi apps, synth, fx,.. great for performing. The tricky part will probably be the auto resizing.
I don't think I will use feedback on this project, but I'll remember the z trick for sure.
I noticed that turnado does that, so when I wanted to loop recording in an daw this would screw up everything.
That's why I though it would be much easier to control it from lemur and record from within Lemur.
If I touch the control record the events, but once released, play what has been recorded previously, a bit like Figure or some korg apps do it.
I did some more testing with createobject and this looks good.
My idea is to create small modules that I'll send on a server (probably to lemur on my iphone) and being able to recall them from any of my ipads. So I could have up to 6 of these modules on a single page controlling midi apps, synth, fx,.. great for performing. The tricky part will probably be the auto resizing.
I don't think I will use feedback on this project, but I'll remember the z trick for sure.
I noticed that turnado does that, so when I wanted to loop recording in an daw this would screw up everything.
That's why I though it would be much easier to control it from lemur and record from within Lemur.
If I touch the control record the events, but once released, play what has been recorded previously, a bit like Figure or some korg apps do it.