another idea i had would be to generate code from the gmegabuf data that is read from a file for the VM and directly compiling&executing it.
file -> APE -> AVS code -> compile -> execute
that's the only way to access the gmegabuf in an APE for now 🙁
hmm and maybe someone with ASM knowledge could look at the output of the VM compiler to maybe see how to do it directly (maybe) 🙂
[edit]
declarations:
VM_CONTEXT vmcontext;
VM_CODEHANDLE vmc_gmegabuf_write;
double *ind;
double *val;
code:
vmcontext = g_extinfo->allocVM();
vmc_gmegabuf_write = g_extinfo->compileVMcode(vmcontext, "assign(gmegabuf(ind),val)");
ind = g_extinfo->regVMvariable(vmcontext, "ind");
val = g_extinfo->regVMvariable(vmcontext, "val");
*ind = 0.0;
*val = 1.1;
g_extinfo->executeCode(vmc_gmegabuf_write, visdata);
g_extinfo->freeCode(vmc_gmegabuf_write);
g_extinfo->freeVM(vmcontext);
works 🙂
Set ind to an index and val to a value and do the executeCode line.
"val" is then stored in the specified gmegabuf index.
if someone could put that sloppy piece of s...ourcecode in an APE, we'd have a nice gmegabuf saver APE 🙂
[/edit]