Identify an instance >> Databases >> FORUM for IT
FORUM for IT

FORUM for IT



SearchSearch   Users   Registration   Entrance
Today: 17.07.2025 - 11:31:26
Pages:  1  2  

Identify an instance

Advertising

.
AuthorMessage

155///MPH

user




Statistics:
Messages: 809
Registration: 10.24.2002

I want to do a JSFX that is to be loaded multiple times. Now the multiple instances of the JSFX need to know who they are (i.e.get an instance number). In fact, they will have slides that of course are stored and re-loaded by Reaper automatically. But the "global" memory is used for storing realtime-values they share, and I need to have an individual pointer to that array, so that each plugin has it's dedicated area to write to. After the complete system configuration, each instance might have a slider that defines it's instance number, and then everything will work fine, but when a new instance is added, the slider should automatically be set to a "free" position. This can't easily be done in the @init section as this might be called multiple times and now the would be correct position is already taken (by the instance itself in a former @init) and it does not know this fact. Any hint's (e.g. appropriate use of @serialize ? ) thanks, -Michael

---------------------
NASA Fanboy
Message # 1 29.06.20 - 16:51:25
RE: Identify an instance

BlackM

user




Statistics:
Messages: 9
Registration: 03.04.2002

I used this strategy in LoopFreek, aeons ago. I can't guarantee that it worked faultlessly but it worked to an extent so it might be helpful... Code:

---------------------
proper propaganda
Message # 2 29.06.20 - 16:56:45
RE: Identify an instance

coupe

user




Statistics:
Messages: 27
Registration: 03.21.2003

Thanks a lot for the replay. I indeed found a way to do what I want to and it seems to work according to some initial testing: - There is a slider that shows the "instance ID" (1 ... 64) - when a new instance is created it gets an instance ID that is not yet taken. - You can move the slider to set the ID to another number that is not yet taken by another instance. - when a project is loaded that includes these plugins, they have the same instance ID as they had when saving the project. If someone in interested I can provide the source code (it will be included in a bigger project I am doing right now and thatI will post when it's ready). -Michael

---------------------
Message # 3 29.06.20 - 17:00:20
RE: Identify an instance

outkastaliens

user




Statistics:
Messages: 3,473
Registration: 02.26.2001

Glad to help. It gets a bit awkward when you start dealing with @serialize and detecting whether instances have been deleted but spent a while on my tracking library today and it's almost there. I've just got one bug to fix before I can let it out.

---------------------
A sports car isn't a car unless you know how to drive it! [br]
Message # 4 29.06.20 - 17:09:26
RE: Identify an instance



user




Statistics:
Messages:
Registration:

---------------------
Message # 6 01.01.70 - 00:00:00
RE: Identify an instance



user




Statistics:
Messages:
Registration:

---------------------
Message # 7 01.01.70 - 00:00:00
RE: Identify an instance

Fissionx

user




Statistics:
Messages: 100
Registration: 01.18.2002

Additional comments: I did not use any @serialize code, but I did include the @serialize section to prevent that the @init code is executed more than once. On top of the design I described I consider to do an unload / deactivate detection. Currently, in gmem I have an array with a variable for each instance ID. it's "0" for "not taken" and "1" for taken. So I happily can move around instance IDs. This concept could be enhanced in the following way: "0" = not taken ">0" for taken. In the @block or @gfx section, each instance sets it's variable to - say - 100. An additional central plugin (which I do have anyway), in it's @block or @gfx section, decrements all the variable that are > 0. So an unloaded / deactivated plugin looses it's ID. -Michael

---------------------
-Dan
Message # 9 29.06.20 - 17:14:24
RE: Identify an instance

MotorWerkz

user




Statistics:
Messages: 88
Registration: 03.24.2003

Yes, the key to handling instances being removed is continuous polling in @block. I've solved all problems with my library now but I want to try a couple of things to see if I can make it more efficient. I'll release it in the next couple of days.

---------------------
Message # 10 29.06.20 - 17:19:53
RE: Identify an instance
Midi Drums Triggering AD in Reaper : Previous topic
Pages:  1  2  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants