Continuous XY Pad


#1

XY Pad

[Overview of module]
I built a continuous XY pad, I thought it might be interesting to share, even though it is simple.

I used the spline node and the computation of the intersection of straight lines.

[Controls]
The XY Pad is controlled by moving the middle control point of the Spline node (the left and right points should perfectly stay in the corners, or you will have unpredictable behaviors)

Bug Report: By the way, doing this I noticed that connecting a monotostereo node to a stereotomono node ends up switching the right and left signals.


XY Pad.audulus (4.9 KB)

Edit: So I actually tried it in a musical context and noticed that the modulation wasn’t very smooth (probably because of the division by 0.01) so I added a couple of biquad filters to regularize the modulation without adding too much latency:

XY Pad 2.audulus (6.5 KB)

Edit 2: I removed one of the biquads that wasn’t really necessary.

XY Pad 3.audulus (6.1 KB)


#2

A very elegant solution.


#3

Thank you!


#4

The modulation wasn’t smooth so I added biquad filters to regularize it.


#5

Just curious about what advantages the biquad has over the lowpass dsp node?


#6

Oh probably none, it’s just that I like to know what exactly happens to the signal, so I tend to use only nodes that are mathematically explicit, like the biquad and the delay nodes (and having the possibility to do that is why I like Audulus).

The biquad filter’s formula is given in the help menu but the lowpass formula isn’t. Anyway the lowpass node can probably be made out of biquads with the right parameters.

So yeah it’s just a personal preference :slight_smile:


#7

Really awesome solution! Love this :slight_smile: We’ll definitely have a legit XY pad in Audulus 4, but this is a neat hack.

The Lowpass node is essentially the same as the Biquad node, it’s just pre-filled out in a sense so all you have to do is control the alpha.


#8

Ok thank you. Could you tell me what the parameters of the biquad would be in terms of alpha in order to emulate/recreate the lowpass node?


#9

http://shepazu.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html

I believe it’s the first one there under LPF - my guess is the LPF node uses marginally less CPU since you’d have to have separate expression nodes going into the BiQuad node, and the way expressions are (not) optimized at the moment means any math that goes on within a node is faster than without. However, if you just want it to be the way it is, that’s no problem either! :slight_smile:

@stschoen @robertsyrett correct me if I’m wrong but @taylor did something with Alpha where it’s like the inverse or something? I remember people were having some difficulty translating directly from filter cookbook to Audulus, but can’t remember why or where that discussion took place.


#10

Yeah I have to admit that when I create a sound I like, I find it even more beautiful when I know exactly the math behind it :slight_smile:

I was also wondering if the official XY Pad could be sensitive to the force and tilt of the Apple Pencil. That would allow one to control 4 parameters at a time with one pencil, so possibly a lot of expressivity. That’s not implemented in any other virtual synth on the iPad so that’s more of an experimental proposition.


#11

The lowpass node is a first order filter and has a 6dB per octave cutoff slope. The bi-quad (or bi-quadratic) is a second order filter and has a 12 dB cutoff. For the low-pass node, the formula for alpha is: alpha = 1-(fc*2*pi)/(fs+fc*2*pi) where fc is the desired cutoff frequency and fs is the sample frequency (44.1 kHZ for Audulus).


I’ve attached a module that includes the formula so you can just input the cutoff frequency. low-pass filter.audulus (1.9 KB) The same formula will also work for the high pass filter node.
The bi-quad node can be used to construct several different types of filter (low pass, hi pass, band pass, shelf, etc.) There was a pretty good collection on the old forum. I’ll see if I can dig them up.


#12

OK thank you now I can combine this with the cookbook link from @biminiroad to get the coefficients for the biquad. For the other kinds of filter, I actually downloaded the patch collection from the old forum so I already have their internal structure. I was just curious about the lowpass node since I can’t see inside this one :slight_smile:

The computations for the parameters seem indeed quite CPU intensive.

In my patch, though, I used fixed coefficients for the biquads so they shouldn’t cost more than using a fixed value for the alpha in a lowpass node. It might even be less intensive because the lowpass node has to compute the DSP coefs from the alpha while the biquad node doesn’t.

Edit : I removed one of the biquads to improve performance.


#13

There’s possibilities there! We could also just have an Apple Pencil node that would output whatever parameters are read off the Pencil.


#14

Yeah I also thought about that but then a problem might be that one might want to control different parameters with the Apple Pencil depending on the context it is used in. I mean, if you have a node getting the force value of the Apple Pencil all the time, then it will always be affected by it, but when the Apple Pencil is on the XY Pad of one synth you might not want it to affect the same things as when it is on the XY Pad of another synth (say the force controls the resonance the filter in both (identical) synths, then you might want to control them independently).

Or maybe the Apple Pencil node could only be affected if the Apple Pencil is pressed on its group container? So for example if you want to create a XY Pad or a knob sensitive to the force, you create a standard XY Pad or knob, then an Apple Pencil node, and then group them, so that the inner ApplePencil node is only affected when the Apple Pencil is modifying the XY Pad or knob in the UI of the group.

The other problem is to define what happens when you lift the Apple Pencil and put it back on the Pad later (and ensure the continuity of the tilt parameter for example).


#15

Great ideas!


#16

Thanks :slight_smile:


#17

I’m getting a broken link for XY Pad 3 - is it working for anyone else?


#18

I tried it and it didn’t work either, but now I have clicked on « edit » and, without changing anything, « save the changes », and it seems to work again.


#19

Got it, thank you!