# 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

- 12.4K All Categories
- 21 Welcome
- 566 Hangout
- 69 NI News
- 273 Tech Talks
- 1.3K Native Access
- 5.8K Komplete
- 766 Komplete General
- 1.4K Komplete Kontrol
- 2.1K Kontakt
- 568 Reaktor
- 186 Battery 4
- 316 Guitar Rig & FX
- 222 Massive X & Synths
- 280 Other Software & Hardware
- 2.6K Maschine
- 24 Sampling Room
- 3.1K Traktor
- 2.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