On 3 Mai, 08:43, Martin Robinson <
0x4...@gmail.com> wrote:
> Hello,
>
> > I managed to make it work, a filter type plugin using the examples as
> > a base! Really nice, looking forward to diving more into this neat
> > toolkit (and possibly closing some of the wide gaps in my
> > unfortunately otherwise rather thin linux-vst arsenal).
>
> Great! You're the first I'm aware of that definitely has it running on Linux. Good to know it works with the current Juce too, although I have been using the modules version I haven't officially moved to that version for UGen++.
cool!
>
> > I do have a question or two though: how does the voicing work exactly
> > in the instrument example? The processBlock sends the "voicerUGen"
> > midi messages which calls on the spawnEvent member? Not sure I
> > understand it quite yet.
>
> Yes, each time a new voice is requested (from a key press) this calls spawnEvent() in your custom event class which should return a UGen (this is then linked to the MIDI note that created it). This gets added to an array of live UGens in the voicer. When a key is released, the UGen linked to the relevant MIDI note is released (this relies on your UGen returned from spawnEvent() using an Env that is releasable like End::adsr),
>
thanks for the explanation, it makes this quite a bit clearer!
> > Secondly, one big thing I'm interested in is
> > building filters plugins like the PV UGens in SC. I see there are FFT
> > base classes which also use fftw, so I should be able to get it
> > working on linux, but what structure could a PV ugen take if I were to
> > attempt to re-create them for use with your FFT classes? I suppose, it
> > would probably boil down to processing a buffer with phases &
> > magnitudes, but there is most likely more to it than I think now :)
>
> Yes, have a look in the UGen/convolution folder there is a partitioned convolution UGen (a bit like the SC one although I used different code). There's also a very sketchy SimpleConvolution UGen that just does cross-synthesis of two sources. You need to enable the convolution features with the preprocessor flag UGEN_CONVOLUTION=1.
>
> You should be able to just use the supplied FFTReal library but fftw will be faster (although tricker to get linking etc).d
>
I put together a bare bones project that builds using UGEN_FFTW=1 and
UGEN_CONVOLUTION=1 and actually loads in a vst host, although without
doing anything useful just yet (I don't often find time to sit down
and fiddle with this..). Quite nice! It does post "FFTEngine using
FFTW" in the hosts log output, so I'm fairly sure its working. The
only thing I couldn't figure out (which is arguably not that
important) is how to statically link fftw, but hey... here is a little
patch with all the changes I made for your reference
https://gist.github.com/2640417
- not much, and I re-used the LINUX=1 pre-processor directive that
comes with juce for singling out these includes.
> > Any hints appreciated...
>
> I'm actually in the middle of a fairly major ground-up re-write. The main reason for this is to separate it completely from SC in terms of the GPL license (only a handful of code was actually taken from SC but this means UGen++ has to be GPL).
>
> The new project pl-nk and is herehttp://
code.google.com/p/pl-nk/but has no starter projects yet like UGen++ does. It has a BSD-style license (meaning it can be used in closed source commercial apps).
nice! I had actually noticed it but not actually played with the code
as it seemed less complete than UGen++, so to speak. Now it all makes
sense ;)
> But through the redesign I've added features that will help support what you want to do. The most relevant change is that all units can run at any sample rate and block size (which is how kr vs ar works, but in UGen++ KR is generally no saving over AR). This means it was relatively straightforward to support having subgraphs that run a different rates and this is how you can have a kind-of "spectral rate" like SC does. So a "subgraph" would have an FFT unit at the top (taking some audio data in) and an IFFT unit at the bottom (transforming spectral data back to audio) then you could have your spectral processing in the middle. In pl-nk, blocks can even overlap in time so this makes overlapping FFT-based processing a possibility.
One question I do have regarding the format of fft buffers FFTEngine
will be juggling around: I read here and there (in the SC sources for
example) that the fft buffer contains some padding and/or DC and
Nyquist somewhere at the beginning and end of the buffer, I'd like to
ask for a quick note on how it is structured in your Code. Anyways,
I'm excited about the project, new and old and learning more about it
all.
> The API for pl-nk is like UGen++ so any transition in the future should be simple but some things will have been renamed etc. But it also (theoretically) supports any sample type rather than being locked to 32-bit floats. (Doubles should just work, but I'm hoping to allow support for int-based sample streams and possibly fixed point.)
>
.. meaning it could be built to work on processors without FPU? mmm
interesting!
Thanks!
karsten