FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Another question ... passing D native class to MiniD

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
vertex



Joined: 24 Nov 2007
Posts: 18

PostPosted: Wed Nov 28, 2007 6:09 pm    Post subject: Another question ... passing D native class to MiniD Reply with quote

Sorry ... just can't figure it out.

I plan on returning class instances to MiniD functions (so they can get system objects an work with them). Wrapping with WrapClass is easy (works - no problem there, the class type is in MiniD and all). But I just can't find a way to put a native D instance of said class into an MDValue. How does one do that?

-Mike
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Thu Nov 29, 2007 7:29 am    Post subject: Reply with quote

From a wrapped native function, it's easy -- return an instance of that class. But for the generic case.. Yeah, I'm definitely going to have to make ToDType and ToMiniDType public. Go into minid.bind and make those two functions public. Then you can do ToMiniDType(myInstance) and you'll get an MDValue with the wrapped class instance in it. Of course any instance that you pass to this function must be of a wrapped class type.
Back to top
View user's profile Send private message
vertex



Joined: 24 Nov 2007
Posts: 18

PostPosted: Thu Nov 29, 2007 8:30 am    Post subject: Works ... Reply with quote

Thanks! I screwed something up in the process, but at least it works and I know that I can get my idea to work.

If you're interested ... I'm building a virtual file system for my project (it's - not yet - a VST plugin host, but I've got a rudimentary audio code working already, just need to integrate it with the new code I'm working on right now). There'll be a GUI eventually, but currently I want every single entity in the audio environment exposed to the virtual file system and to MiniD. There'll be a shell with the commands (ls/rm/cp/etc.) written in MiniD (I'll start with that today, now that integration works) and one should be able to create all kinds of crazy stuff by copying/linking data blocks around, all at runtime. I think it's the only way to have your cake and eat it too - total flexibility with the VFS and MiniD and ease of use with the GUI later on. And I hope I can release something before 2030 or so Smile

It's a big relieve to know that I can implement that with MiniD - this whole thing depends on scripting, and I'm glad I can throw away my amateurish attempt at building a scripting environment myself and get back to work.

-Mike
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Thu Nov 29, 2007 11:56 am    Post subject: Reply with quote

Shocked What's creepy is that I've had some kind of an idea for a scriptable VST host that used MiniD in the back of my head for a while now. And now you're doing it! Cool.

The VFS sounds very interesting. Will that be how you access/script all the various parts of the host? Like /channel0/volume is a "file" that you can use to read/write the volume of channel 0?
Back to top
View user's profile Send private message
vertex



Joined: 24 Nov 2007
Posts: 18

PostPosted: Thu Nov 29, 2007 5:13 pm    Post subject: Reply with quote

I'm working on that thing since four years (more or less) now ... first try was in C++, but I scrapped it, started over in D and it died again. Now I've got a pile of somehow-working D code and I'm starting again (like it's said in german: Aller guten Dinge sind drei) Smile

About the VFS: Instantiating a vst plugin works like

"cp /factory/vsti/plugin_name ."

I want to enable mounting of file systems, so you could do something like

"cp /mnt/audiolib/bassdrum.wav /track1/drumsampler"

so that the sampler creates a trigger for that sample. Symlinks are possible, so instead of ghost tracks you create just symlinks to an existing datablock. And changing properties is just overwriting files like you said. It's a completely modular system with the added hierarchy of a file system. Even the sequencer works based on that hierarchy, it's really hard to explain, 'cause it's very different from every existing sequencer.

Anyway, that's the access from the shell. Later on I'll build some GUI editors on top of that, they won't use the cli, but I'm thinking about a MiniD based MIDI processor. That would be awesome Smile

-Mike
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Thu Nov 29, 2007 6:40 pm    Post subject: Reply with quote

Quote:
like it's said in german: Aller guten Dinge sind drei


And English too -- "The third time's the charm" Smile

The VFS sounds awesome. I never would have thought of using a file system to represent something other than a file system! Sweet.
Back to top
View user's profile Send private message
vertex



Joined: 24 Nov 2007
Posts: 18

PostPosted: Fri Nov 30, 2007 8:32 am    Post subject: Reply with quote

If you think about it it makes a lot of sense - you've got some inputs (audio input/midi events) and you distribute that to some processing chains. Then you take the outputs of those chains (again: audio and midi events), mix them together somehow and send the result up one level. If every folder is a little environment with inputs and outputs you've got a very powerful system - and a file system represents that nicely. Input flows from the root to the leaves, output flows from the leaves to the root. And everything in between processes the information and is automatable with the sequencer (which stores its information in the file system as well). There are some rules that differ from a file system, of course.

Btw, do you have any experience with ASIO and D? I thought I'll support only ASIO (I'm cheating and using SDL for now). It was a PITA with MingW and I doubt it'll be any easier with DMD.

-Mike
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Fri Nov 30, 2007 9:07 am    Post subject: Reply with quote

Nope.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group