SynthMaker

Linking 2 sliders

Archive · 2007 16 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

wayfaerer ·

Hello all. I'm trying to create a re-tuning system for a synth and I'm at a loss for how to begin. If anyone can offer some suggestions, I would greatly appreciate it.

The input and output for the module need to be frequency. I would like the user to see an ellipse in the GUI. The user should be able to click and drag a pointer anywhere within the ellipse. Wherever they click will determine an x and y value which can be negative or positive. The x and y values will each influence the output frequency separately and with different equations.

The basic premise would be overlapping a horizontal and vertical slider, but I don't know if that's the best way to do this.

Oh and if it is impossible to do this with an ellipse, then I would also settle for having a rectangle, but only if there is no way to have an ellipse.

Thanks in advance, and sorry if this question has a really obvious answer that I should have figured out on my own! I'm pretty new to SynthMaker.

oddson ·

Sounds like an x-y pad with an elliptical restriction... but I'm not sure why it should have one.

It sounds feasible but the ellipse part has me confused. It would add significantly to the complexity and I don't see where the benefit is.

Search on 'xy' and you will find some examples that should help.

wayfaerer ·

Thanks for your help! Sorry, I should have explained better why I want an elliptical restriction.

I'm trying to make a synth which will complement a prototype version of a new instrument. The prototype is designed to be an alternative to the piano style keyboard. Besides "regular" notes, it also has a joystick control in which the user can control extra parameters in the synth - in this case a tuning equation.

For now, I'm not attempting to actually link the instrument with the synth. I'm just trying to recreate the joystick inside the synth, so the user can click anywhere within the ellipse and it would be the same as if they would move around the joystick.

Hope that makes sense.

I've looked into the XY Pads and some of the forum posts about them. This is definitely my starting point. Again, if someone has an idea how to make the elliptical restriction work, I'd be most appreciative!

wayfaerer ·

Oh, actually, it doesn't need to be constrained to an ellipse shape, but rather a diamond shape. Don't know if that makes things any easier. 🙂

oddson ·

It sounds like you want to extract rotation direction and magnitude from the control... so a circular constraint would make the most sense to me.

The algebra to work it all out shouldn't be too hard but I'm a little out of practise. I'll give it a go and post again in the next day or so if no one beats me to it.

BTW- you should use a 'xy accumulator' version (like Jorge's) and not one like my example (or those based on it) which use the Mouse Drag component.

wayfaerer ·

Hey Oddson. Thanks again. Actually, I should have elaborated more (again). The controller on the instrument is like a joystick that stays where you leave it. So I think it's actually your XY Pad or one of the ones based on it that would be best.

In this case the graph actually SHOULD be a diamond shape. However, an elliptical shape would also be fun to experiment with.

I appreciate your help!!!

oddson ·

I still think an accumulator version would be best. It doesn't mean it snaps back to zero but it is always adjusted from it's last position. The drag versions allow discontinuous jumps of position based on clicks outside of the current location of the pointer.

As for the diamond restriction, it's not hard to make it stick to a diamond shape - I had a version of my xy pad doing that within 20 minutes - its getting the control to behave as you want when the control is being dragged outside the restricted area that's tough. My quick version did some wonky thinks like heading north-east when you were dragging north-west (an x restriction was causing the y value to take precedence and as y increased it headed to the top of the diamond even though I was dragging to the north-west corner).

I'll post an example as soon as I get one working remotely like I think you're looking for.

oddson ·

Okay... I give up for now. I want to be sure I'm not chasing wild goose on this one. Here's the version with the wonky outside of limit behaviour. xypaddiamond.osm

Is this what you're looking for (assuming there's a reasonable fix to the out-of-bounds behaviour)?

Because I don't understand why anyone would want controls limited like this. 😕

The only alternative I can see that might make sense is a standard xy pad with [-1,1] range in both directions but with the control rotated 45 degrees (ccw) so that South=-1,-1; West=-1,1, North=1,1 and East=1,-1

If that's what you're really after the solution to it would be dramatically different so I don't want to spend any more of my time until I'm sure we're on the same page.

wayfaerer ·

That's great and yes, what I'm looking for!

oddson ·

I got your PM and I still think the rotated xy pad is what you need.

The rotation math in 2D is pretty simple and made easier at 45 degrees as cos and sin theta are the same (0.707-ish).

x' = x * cos(theta) + y * sin(theta) y' = -x * sin(theta) + y * cos(theta)

given the equality cos(45º)=sin(45º)

x' = (x + y) * sin(45º) y' = (y - x) * sin(45º)

The SynthMaker stuff will be a bit tricky -- mostly in getting the rotated coordinates fed back to the display after being limited in the rotated plane and rotated back in the other direction (and thereby limited to a diamond).

I'll give it a try tonight if I get a minute or 20.

Acrobat ·

oddson wrote: The SynthMaker stuff will be a bit tricky -- mostly in getting the rotated coordinates fed back to the display after being limited in the rotated plane and rotated back in the other direction

True, I tried some cool things with rotations but I had lots of trouble, because the redraw area must be everytime reconsidered when translating and rotating things, and also because of that damn top left reference point which needs complex coordinates computation somehow... 😉

oddson ·

Here's a basic version of what I think you need.

diamond.osm

There some finishing work and I've not tested the MIDI/CC/Preset behaviour at all but if it doesn't work right it's not too far off.

But for a proof-of-concept it should be sufficient. In particular you can see how the rotation idea differs from limiting xy coordinates to a diamond shape.

wayfaerer ·

That looks great! Thanks so much.

It's a bit funky how when you click various places (without dragging), the cursor seems to jump around a bit before arriving at its destination. It's still awesome, though. If you make any updates to this, I'd be anxious to see! Thanks again.

Acrobat ·

oddson wrote: (assuming there's a reasonable fix to the out-of-bounds behaviour)?

I think that fix would involve clipping a view area in diagonal, which is not allowed. I tried many times to solve this but failed: the fact clipping works only for rectangular shapes is is a big limitation for me ... sob... 🙁

EDIT: maybe it's doabe working with pixels... but that's an unfair work with lot of math!!

edit2 - oh you solved with second post... 😇

Cool, it acts like my Wavestation... ! 😀

Acrobat ·

http://www.kvraudio.com/get/2983.html

35 !! dollars synthedit XY virtual pad .... 😮 😠 😉

TomC ·

Acrobat wrote: http://www.kvraudio.com/get/2983.html

35 !! dollars synthedit XY virtual pad .... 😮 😠 😉

If someone pays that amount for it it's worth that money. I don't think it's a bad thing to set that price if the programmer things this amount compensates for what he invested (time/money wise). Whether he would make more money if he'd sell it for

0 is a completely different question. I know most people around here could do the same effect in a weekends worth of time and offer it for free. But that's absolutely not the point. (Heck, if it was most software companies wouldn't make any money anymore, see OSS software).

And I think it's a good idea when even more SynthEdit/SynthMaker effects go commercial, it would ADD to both software's reputation.

If no one buys the effect the price will drop down anyway. Free market and stuff...

Tom

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.