# XY Pad controlling volumes of 3 groups

**4**Newcomer

Hi, I was wondering if anyone has any suggestions for the problem I am having. I'm trying to set up an XY pad to control volume levels of 3 groups. I am very new to this, and scripting in general.

Basically at x0y0, it should only be Group 1. At x1y0 it should only be Group 2. And at x1y1 it should only be group 3. And volumes should interpolate between these points.

here is my code so far:

on ui_control(?XY) set_engine_par($ENGINE_PAR_VOLUME, real_to_int(sqrt(1.0 - ?XY[0]) * 600000.0), 0, -1, -1) set_engine_par($ENGINE_PAR_VOLUME, real_to_int(sqrt(?XY[0]) * 550000.0), 1, -1, -1) set_engine_par($ENGINE_PAR_VOLUME, real_to_int(sqrt(1.0 - ?XY[1]) * 600000.0), 0, -1, -1) set_engine_par($ENGINE_PAR_VOLUME, real_to_int(sqrt(?XY[1]) * 600000.0), 2, -1, -1) end on

Right now it is behaving correctly along the y axis, but as I move along the x axis, group 2 increases in level but group 1 level remains consistent. I'm not sure what I'm doing wrong here. Maybe it doesn't know what to do with set_engine_par on both the x and y axis for the same group?

Any suggestions would be appreciated. Thanks!

EDIT: Figured it out. I had to also interpolate between the x and y positions on group 1. Here's the code:

on ui_control(?XY) set_engine_par($ENGINE_PAR_VOLUME, real_to_int(sqrt(1.0 - ?XY[0]) * sqrt(1.0 - ?XY[1]) * 600000.0), 0, -1, -1) set_engine_par($ENGINE_PAR_VOLUME, real_to_int(sqrt(?XY[0]) * 600000.0), 1, -1, -1) set_engine_par($ENGINE_PAR_VOLUME, real_to_int(sqrt(?XY[1]) * 600000.0), 2, -1, -1) end on

#### Categories

- All Categories
- 21 Welcome
- 851 Hangout
- 78 NI News
- 411 Tech Talks
- 1.9K Native Access
- 8.6K Komplete
- 1.1K Komplete General
- 2.2K Komplete Kontrol
- 3.1K Kontakt
- 724 Reaktor
- 252 Battery 4
- 493 Guitar Rig & FX
- 287 Massive X & Synths
- 510 Other Software & Hardware
- 3.4K Maschine
- 23 Sampling Room
- 4.2K Traktor
- 3.9K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators