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

xy to control 4 source levels

For general discussion related FlowStone

xy to control 4 source levels

Postby blatantleesly » Fri Jul 03, 2015 2:09 pm

xY to control 4 source levels.fsm
(2.8 KiB) Downloaded 791 times


Hi Guys,
I'm having a bit of a mental melt down as I am trying to do something that seems simple but for some reason is frying my brain, I'm trying to create a control interface that controls and mixes between 4 separate audio sources. The idea is that each corner effectively selects a source but when the position of the cursor is moved it mixes evenly between them, I have a kind of working version of this but the mix is not even between the sources. If anyone could help me getting this working that would be great or suggest a better technique to do what I am trying to achieve. Here is a basic template.

Many thanks In advance.
blatantleesly
 
Posts: 21
Joined: Wed May 20, 2015 2:46 pm

Re: xy to control 4 source levels

Postby tulamide » Fri Jul 03, 2015 5:22 pm

Here you are :)

Let's assume top-left stands for source 1, top-right for source 2, bottom-right for source 3, and bottom-left for source 4.

Since you use a rectangular pad and not a circular, the longest distance are the diagonals. So, if source 1 = level 1.0 then source 3 = level 0.0, etc. That also means, source 1 is not at level 0.0 when source 4 is at level 1.0

In the center they are evenly leveled. At a scale of 1 they sum up to a total level of 2.0 (4 times 0.5). If you prefer a lower total level, just look for this line

Code: Select all
@scale = 1.0


and change the number to whatever seems reasonable to you. (Example: @scale = 0.5 means the max level is 0.5, so they sum up to 1.0 when centered = 4 times 0.25)
Attachments
xY to control 4 source levels (tula).fsm
(3.03 KiB) Downloaded 877 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: xy to control 4 source levels

Postby Spogg » Sat Jul 04, 2015 6:08 pm

Hi tulamide
This looks potentially very useful for Lissajou stuff and more. Unfortunately I get an error in the Ruby Component, see below.

Ruby error in 4 channel xy controller.png
Ruby error in 4 channel xy controller.png (65.19 KiB) Viewed 12278 times


The hex code at the end of the error line changes with the x/y position on the 'joystick' but all the 4 float output values stay at 0.25.
I'm on the latest FS 3.08.1 and I wish I knew some Ruby to fix this because it looks great!
Cheers
Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: xy to control 4 source levels

Postby martinvicanek » Sat Jul 04, 2015 7:36 pm

I got the same error. If you rename x by z (both input and code) it disappears. Ugly FS bug that is!
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: xy to control 4 source levels

Postby tulamide » Sat Jul 04, 2015 8:21 pm

As Martin says, we just determined '@x' being the cause. It is not the automatically generated variable that belongs to the input named 'x', but seems to be overriden by something internal. It is a bug from my point of view, since this was never before an issue and only happens under 3.0.8.1 (3.0.8 also?)

Until this is fixed, avoid naming any input 'x'

EDIT: Also, if you wish to use the RubyEdit-Code without the x/y-pad, keep in mind that this was made for that special pad, which means, it will only work correctly, if the bottom/highest y refers to 0, and the top/lowest to 1. It has to be mentioned because most of Computer graphics work the other way round (top = 0, bottom = 1)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

ab (was xy) to control 4 source levels

Postby martinvicanek » Sat Jul 04, 2015 10:14 pm

Now that we have this sorted out let me offer a simple alternative based on bilinear interpolation.
Attachments
xY to control 4 source levels MV.fsm
(2.79 KiB) Downloaded 816 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: xy to control 4 source levels

Postby Spogg » Sun Jul 05, 2015 3:53 pm

Thanks for that Martin. Works fine for me :D
Cheers
Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: xy to control 4 source levels

Postby blatantleesly » Mon Jul 06, 2015 4:50 pm

Thanks guys, You are lifesavers!!!!
blatantleesly
 
Posts: 21
Joined: Wed May 20, 2015 2:46 pm


Return to General

Who is online

Users browsing this forum: No registered users and 72 guests