Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

New DLL feature - Library Resource Thread

DSP related issues, mathematics, processing and techniques

Re: New DLL feature - Library Resource Thread

Postby Tronic » Sat Dec 14, 2013 10:13 pm

No need to reinvent the wheel, ever again.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: New DLL feature - Library Resource Thread

Postby Attic » Sun Dec 15, 2013 12:59 am

Sheesh .. thats one cynical streak MegaHurtz has. Hehe

I wasn't implying with this thread that we should all go find DLL's to pillage and plunder. I was more curious if some time could be saved looking for a library to meet our particular needs. I'm not looking to create an uninspired vst. I just want to create a couple vst's that work the way I think. I have 4 years into 2 vst's but they have issue's due to Synthmakers shortcomings ... so I hope the DLL thing changes that.

I have wanted some midi note sorting and midi chord storage functions that Synthmaker could not handle. (Million+ Modules were kicking the cpu's but.) Would it be better to use Ruby or a DLL for this kind of thing? Do I learn Ruby or C?
Also can we make internal mp3 playback happen with a dll? Another question would be how fast can we expect data to move through a wrapped, sandboxed dll? Can we send an audio stream through the DLL or no?
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
User avatar
Attic
 
Posts: 30
Joined: Sat Feb 13, 2010 1:40 pm
Location: San Francisco California

Re: New DLL feature - Library Resource Thread

Postby trogluddite » Sun Dec 15, 2013 2:44 pm

Build-it wrote:Can we send an audio stream through the DLL or no?

Yes, but only in chunks (frames) - so latency will likely be an issue more than raw processing power.

In speed terms, there's no reason that 'frames' should be particularly slow - I think maybe they are a little misunderstood. A Ruby frame is a very small object - just a pointer to a memory address where the buffer (as raw floats) is held. Ruby's relative slowness only kicks in if you process a frame within Ruby - it then has to turn the raw binary data into Ruby Float objects so that you can use them within your code. Doing that conversion (and back again!) for hundreds or thousands of objects is really what kills Ruby for audio processing.

However, when you pass a Ruby frame to a .dll component, you are not doing any conversion or copying - all that happens is that the pointer and data size are passed to the .dll - just a few bytes. Once inside the .dll you can access that memory directly any way you like - and you are always manipulating the data "in place", there's no need to copy it anywhere unless your DSP algorithm requires it. The rest is down to the quality of the .dll programming and the effectiveness of the compiler used to make the .dll.

The limitation is that you need to pass chunks of data - not "one sample at a time" processing as we see with the DSP code and ASM primitives. That's pretty much to be expected - "one sample at a time" is an illusion created by the FS "compiler" to make DSP programming easier; in reality, processing is done "per buffer" as with any other kind of VST.
Calling a .dll for every single sample would be very inefficient anyway - buffers aren't just there to prevent audio glitches, they also enable much more efficient code to be used, and far less thread switching for the CPU.

But that means that there'll be an extra buffer of latency on the .dll processed signal. I don''t know without testing, but possibly this will be cumulative if you chain .dll objects in series, too - so I suspect it will be better to write big .dlls that do a lot rather than many small "primitive" style one; though that assumption could well be wrong.

Incidentally, using the buffer method is probably an advantage if we want to use audio libraries. I would imagine that it's usual to assume that any audio is buffered when writing general-purpose libraries for dealing with streams(i.e. just hand them the memory pointer) - that would be the default method of dealing with them in most app's.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: New DLL feature - Library Resource Thread

Postby tester » Sun Dec 15, 2013 3:26 pm

In other words - will it be possible to use free dll's like (if I remember correctly)

http://www.fftw.org/

for external FFT processing at higher resolution, and then get data, splitted into smaller paralel arrays?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: New DLL feature - Library Resource Thread

Postby trogluddite » Sun Dec 15, 2013 3:38 pm

tester wrote:In other words - will it be possible to use free dll's like

As far as I can tell; "Use", yes, but embedding them into a module/schematic no.

To do it, you would have to make a "custom" .dll that matches the FS specification. Then use that as an interface to call the 'library' .dll.
The "custom" .dll can be stored into the schematic/export file, so the end user doesn't need that .dll on their system. However, the 'library' cannot be stored into the schematic - the export would only work if the end-user has the same 'libraries' installed on their PC.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: New DLL feature - Library Resource Thread

Postby tester » Sun Dec 15, 2013 3:49 pm

I don't wan't to put external dll's into my schematics; it is a rediculous idea for me. External dll's should be external, so that they can be upgraded (by their devs?) without interference on my side (as long as they are compatible with previous templates).

In fact - it would be interesting to have the ability to use modulatized FSM schematics, so that you upgrade only "partials" and not whole "single-schematic" projects.

Though - I still have no idea how to connect such dll to my part. :-)
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: New DLL feature - Library Resource Thread

Postby Nubeat7 » Sun Dec 15, 2013 4:05 pm

so the big question is for what it makes sense to create dll`s , i would think about drawing data intensive stuff, everything which uses big arrays of data like drawing audiowaves, manipulating picture data... in general all the non audio thread intenive stuff

maybe there would be also better ways to get midi data out of mono data? (like midi sync to host)
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: New DLL feature - Library Resource Thread

Postby trogluddite » Sun Dec 15, 2013 4:15 pm

Nubeat7 wrote:midi data out of mono data? (like midi sync to host)

Good idea! All the PPQ sync stuff so far is having to convert to Ruby objects, so they take far too much CPU for a "little utility module" - that would be a really good candidate for conversion.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: New DLL feature - Library Resource Thread

Postby Tronic » Sun Dec 15, 2013 4:39 pm

Yes, but can only work with PDC setted accordly with your buffer audio.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: New DLL feature - Library Resource Thread

Postby Tzarls » Sun Dec 15, 2013 4:50 pm

trogluddite wrote:
tester wrote:In other words - will it be possible to use free dll's like

As far as I can tell; "Use", yes, but embedding them into a module/schematic no.

To do it, you would have to make a "custom" .dll that matches the FS specification. Then use that as an interface to call the 'library' .dll.
The "custom" .dll can be stored into the schematic/export file, so the end user doesn't need that .dll on their system. However, the 'library' cannot be stored into the schematic - the export would only work if the end-user has the same 'libraries' installed on their PC.



For achieving what Build-it wants you would need the source code of the library, build it as stati (not dynamic) library. That will produce .lib file, not a .dll file. Then when making your custom dll for FS link to the static library, which will effectively embed the library into the final .dll, at least the part needed for your code to run. SO of course there´s some work to be done, but nothing too extreme.
Tzarls
 
Posts: 54
Joined: Thu Oct 21, 2010 2:10 am

PreviousNext

Return to DSP

Who is online

Users browsing this forum: No registered users and 46 guests

cron