# Control surface for XVA1 Synthesizer Module

**URL:** <https://forum.midibox.org/t/control-surface-for-xva1-synthesizer-module/20978>\
**Category:** MIDIbox NG\
**Created:** [February 7, 2021, 11:28am UTC](https://forum.midibox.org/t/control-surface-for-xva1-synthesizer-module/20978 "2021-02-07T11:28:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinama](https://forum.midibox.org/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dinama](https://forum.midibox.org/u/dinama)\
**Post date:** [February 7, 2021, 11:28am UTC](https://forum.midibox.org/t/control-surface-for-xva1-synthesizer-module/20978/1 "2021-02-07T11:28:36Z")

</div>

I’d like to make an hardware control surface for fantastic XVA1 synth  
([XVA1 Synthesizer | High-end DIY Subtractive Virtual-Analog Sound Generator | futur3soundz](https://www.futur3soundz.com/xva1-synthesizer))  
The synth use a 24LC1025 I2C EEPROM memory to store preset.

All parameters in XVA1 can be controlled via MIDI System Exclusive messages.  
The message format for the messages is as follows:  
F0 44 00 P1 P2 V1 V2 F7  
Where:  
P1 P2 = Parameter number, 0~511 in two hexadecimal 7-bit values.  
V1 V2 = Value, 0~255 in two hexadecimal 7-bit values .

So i use encoder on MBNG to change value like this ( example for filter-1-cutoff where P1=0x00 and P2=0x48)  
EVENT\_ENC&nbsp; id=&nbsp; 1&nbsp; hw\_id =&nbsp; 1&nbsp; bank=1&nbsp; fwd\_id=LED\_MATRIX:1&nbsp; fwd\_to\_lcd=1&nbsp; range=&nbsp; 0:255 type=SysEx&nbsp; stream=“0xf0 0x44 0x00 0x00 0x48 ^val\_h ^val 0xf7”&nbsp;&nbsp; ports=100011000000000&nbsp; lcd\_pos=1:1:1&nbsp; label=“filter1\_cutoff %3d”  
All is ok

It is also possible to request a SysEx Dump  
Get&nbsp; Program Dump (512 parameter values)  
F0 43 uu 04 04 00 00 F7

Where uu = unit number.( In my case 0x00)

So i implemented a button to request a dump and store it in a general receiver

EVENT\_BUTTON id= 80&nbsp; button\_mode=OnOnly type=SysEx&nbsp; stream=“0xf0 0x44 0x00 0x04 0x04 0x00 0x00 0xf7” chn= 1&nbsp; range=&nbsp; 0:1 offset= 0&nbsp; ports=100011000000000&nbsp; lcd\_pos=1:1:1&nbsp; label=“get dump”

EVENT\_RECEIVER id=&nbsp; 1&nbsp; type=SysEx&nbsp; stream=“0xf0 0x43 0x00 ^dump 0xf7”&nbsp; ports=1000100000001000 fwd\_to\_lcd=1 lcd\_pos=1:1:2 label=“Received SyxDump”

This part is ok. Using MIDI-OX software i can see the 1024 byte of the dump that synth out of its midi out port.

Now the problem.  
I’d like to use syxdump\_pos parameter to update the value af any controller to reflect the current value stored in the current selected program in the synth memory.  
syxdump\_pos fails because it&nbsp; points to a single byte in the ^dump , while the parameter value consists of two bytes.

I’m not a programmer but in&nbsp; MIDIbox NG repository i find this section in mbng\_event.c file

case MBNG\_EVENT\_SYSEX\_VAR\_VAL:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; match = 1; pool\_item-\>value = (pool\_item-\>value & 0xff80) | (midi\_in & 0x7f); break;  
case MBNG\_EVENT\_SYSEX\_VAR\_VAL\_H:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; match = 1; pool\_item-\>value = (pool\_item-\>value & 0xf07f) | (((u16)midi\_in & 0x7f) \<\< 7); break;  
case MBNG\_EVENT\_SYSEX\_VAR\_VAL\_N1:&nbsp;&nbsp;&nbsp;&nbsp; match = 1; pool\_item-\>value = (pool\_item-\>value & 0xfff0) | (((u16)midi\_in \<\<&nbsp; 0) & 0x000f); break;  
case MBNG\_EVENT\_SYSEX\_VAR\_VAL\_N2:&nbsp;&nbsp;&nbsp;&nbsp; match = 1; pool\_item-\>value = (pool\_item-\>value & 0xff0f) | (((u16)midi\_in \<\<&nbsp; 4) & 0x00f0); break;  
case MBNG\_EVENT\_SYSEX\_VAR\_VAL\_N3:&nbsp;&nbsp;&nbsp;&nbsp; match = 1; pool\_item-\>value = (pool\_item-\>value & 0xf0ff) | (((u16)midi\_in \<\<&nbsp; 8) & 0x0f00); break;  
case MBNG\_EVENT\_SYSEX\_VAR\_VAL\_N4:&nbsp;&nbsp;&nbsp;&nbsp; match = 1; pool\_item-\>value = (pool\_item-\>value & 0x0fff) | (((u16)midi\_in \<\< 12) & 0xf000); break;

Is it possible to edit this file to get a solution to my problem?how?  
Can anyone help me find a solution?  
Thanks in advance.  
UCapps is a fantastic place.

&nbsp;

---

<div class="post-metadata">

**Author:** ![dinama](https://forum.midibox.org/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dinama](https://forum.midibox.org/u/dinama)\
**Post date:** [March 27, 2021, 3:40pm UTC](https://forum.midibox.org/t/control-surface-for-xva1-synthesizer-module/20978/2 "2021-03-27T15:40:34Z")

</div>

No news?

Is there&nbsp;a way to read two consecuitive bytes from a received sysex and assign to a hardware controller?

&nbsp;

From pag. 35 of Xva1 manual:

XVA1 can be controlled also by using the dedicated external UART, by using pins 26 (TX) and 27 (RX) in the CMOD-A7 module.

The external UART is set to send/receive at 500 kbps, 8-bit, one stop bit, no parity.

Command are:&nbsp;

r =&nbsp;Loads a program from EEPROM

w =Writes active program into EEPROM.

s=&nbsp;Sets specified parameter to specified value.  
&nbsp;

g =Gets active value for specified parameter

…

is there a way to use these commands&nbsp;in my midibox?

is possible to send command like this from a midibox to the synth?

&nbsp;

If there is no solution the last thing i can do is to manually copy all preset from&nbsp;eeprom and save every preset in the sd card. I fear that 500 parameters for every preset are too many to save on sd card. I have bad experience with sd card. I prefer eeprom.

&nbsp;

&nbsp;

thanks

---

<div class="post-metadata">

**Author:** ![Antichambre](https://forum.midibox.org/user_avatar/forum.midibox.org/antichambre/32/201_2.png) [@Antichambre](https://forum.midibox.org/u/Antichambre)\
**Post date:** [March 27, 2021, 9:57pm UTC](https://forum.midibox.org/t/control-surface-for-xva1-synthesizer-module/20978/3 "2021-03-27T21:57:37Z")

</div>

Hi,

By default the UART are configured for regular MIDI DIN speed, 31250 baud.  
But you can change their configuration, in the mios32\_config.h file of your project.

The default value(if not previously defined in mios32\_config.h) are found in **[include/mios32/mios32\_uart.h](https://github.com/midibox/mios32/blob/master/include/mios32/mios32_uart.h)**

```
// Baudrate of UART first interface #ifndef MIOS32\_UART0\_BAUDRATE #define MIOS32\_UART0\_BAUDRATE 31250 #endif

```

Others settings are not easily accessible, they are dependant of the cpu.&nbsp; They are set in mios32\_uart.c  
But they meet your requirement, example for stm32f4xx:

```
 USART\_InitTypeDef USART\_InitStructure; USART\_InitStructure.USART\_WordLength = USART\_WordLength\_8b; USART\_InitStructure.USART\_StopBits = USART\_StopBits\_1; USART\_InitStructure.USART\_Parity = USART\_Parity\_No; USART\_InitStructure.USART\_HardwareFlowControl = USART\_HardwareFlowControl\_None; USART\_InitStructure.USART\_Mode = USART\_Mode\_Rx | USART\_Mode\_Tx;

```

Best regards  
Bruno  
&nbsp;
