Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Bonjour OSCReceiver TextLCD mbed mbed-rpc BurstSPI DebouncedInterrupt FastIO MIDI OSC OSCtoCV ClockControl
example.h
- Committer:
- casiotone401
- Date:
- 2014-03-09
- Revision:
- 13:3f42e451a8d3
- Parent:
- 12:33c8f06c2e03
File content as of revision 13:3f42e451a8d3:
//-------------------------------------------------------------
// TI DAC8568 OSC-CV Converter
//
// DAC8568 16bit Octal DAC http://www.ti.com/product/dac8568
//
// referred to
// xshige's OSCReceiver
// http://mbed.org/users/xshige/programs/OSCReceiver/
// radiojunkbox's OSC-CV_Example
// http://mbed.org/users/radiojunkbox/code/KAMUI_OSC-CV_Example/
// Robin Price's Homebrew midi-cv box
// http://crx091081gb.net/?p=69
// Masahiro Hattori's TextLCD Module Functions
// http://www.eleclabo.com/denshi/device/lcd1602/gcram.html
// Dirk-Willem van Gulik's BonjourLib
// http://mbed.org/users/dirkx/code/BonjourLib/file/bb6472f455e8/services/mDNS
//
// Released under the MIT License: http://mbed.org/license/mit
//-------------------------------------------------------------
#pragma O3
#pragma Otime
#include "mbed.h"
#include "TextLCD.h" //edit "writeCommand" "writeData" protected -> public
#include "EthernetNetIf.h"
#include "HTTPServer.h"
#include "mDNSResponder.h" // mDNS response to announce oneselve
#include "UDPSocket.h"
#include "OSCReceiver.h"
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
//-------------------------------------------------------------
// Define
#define MODE_LIN 0 // Linear ~LinearCV Mode
#define MODE_QChr 1 // Chromatic ~Quantize Mode
#define MODE_QMaj 2 // Major
#define MODE_QDor 3 // Dorian
#define MODE_Q5th 4 // 5th
#define MODE_QWht 5 // Wholetone
#define MODE_Calb 6 // Calibration
#define QUAN_RES1 116 // Quantize voltage Steps
#define QUAN_RES2 69
#define QUAN_RES3 68
#define QUAN_RES4 17
#define QUAN_RES5 58
#define MODE_NUM 7 // Modes
#define SPI_RATE 40000000 // 40Mbps SPI Clock
#define SCALING_N 38400.0
#define INPUT_PORT 12345 // Input Port Number
#define POLLING_INTERVAL 20 // Polling Interval (us)
//-------------------------------------------------------------
// DAC8568 Control Bits
#define WRITE 0x00
#define UPDATE 0x01
#define WRITE_UPDATE_ALL 0x02 // LDAC Write to Selected Update All
#define WRITE_UPDATE_N 0x03 // LDAC Write to Selected Update Respective
#define POWER 0x04
#define CLR 0x05 // Clear Code Register
#define WRITE_LDAC_REG 0x06
#define RESET 0x07 // Software Reset DAC8568
#define SETUP_INTERNAL_REF 0x08
//-------------------------------------------------------------
#define _DISABLE 0
#define _ENABLE 1
//-------------------------------------------------------------
// Functions
inline void NetPoll(void);
void InitOSCCV(void);
inline void UpdateCV(int, int, const unsigned int*);
void SetCV(void);
void CheckSW(void);
void CVMeter(int, const unsigned int*);
void WriteCustomChar(unsigned char, unsigned char*);
int SetupEthNetIf(void);
void onUDPSocketEvent(UDPSocketEvent);
//-------------------------------------------------------------
// Silentway Calibration Data Mapping
// http://www.expert-sleepers.co.uk/silentway.html
// Chromatic Scale
const float calibMap1[QUAN_RES1] = {
0.00663080, 0.01433030, 0.02202980, 0.02972930, 0.03742880,
0.04512830, 0.05282781, 0.06052731, 0.06822681, 0.07592630,
0.08362581, 0.09132531, 0.09902481, 0.10672431, 0.11442380,
0.12212331, 0.12951356, 0.13671936, 0.14392516, 0.15113096,
0.15833676, 0.16554256, 0.17274836, 0.17995416, 0.18715996,
0.19436575, 0.20157155, 0.20877735, 0.21598317, 0.22318897,
0.23039477, 0.23760056, 0.24480636, 0.25202271, 0.25926629,
0.26650983, 0.27375340, 0.28099698, 0.28824055, 0.29548413,
0.30272770, 0.30997124, 0.31721482, 0.32445839, 0.33170196,
0.33894554, 0.34618911, 0.35343266, 0.36067623, 0.36791980,
0.37516347, 0.38241133, 0.38965923, 0.39690709, 0.40415496,
0.41140282, 0.41865072, 0.42589858, 0.43314645, 0.44039431,
0.44764221, 0.45489007, 0.46213794, 0.46938580, 0.47663370,
0.48388156, 0.49112943, 0.49837729, 0.50566339, 0.51296055,
0.52025765, 0.52755481, 0.53485191, 0.54214907, 0.54944617,
0.55674326, 0.56404042, 0.57133752, 0.57863468, 0.58593178,
0.59322894, 0.60052603, 0.60782319, 0.61512029, 0.62241745,
0.62976688, 0.63714498, 0.64452308, 0.65190119, 0.65927929,
0.66665739, 0.67403549, 0.68141359, 0.68879169, 0.69616979,
0.70354789, 0.71092600, 0.71830410, 0.72568226, 0.73306036,
0.74043846, 0.74781656, 0.75820577, 0.76986063, 0.78151548,
0.79317033, 0.80482519, 0.81648004, 0.82813489, 0.83978975,
0.85144460, 0.86309946, 0.87475431, 0.90686423, 0.93941462,
0.97196496
};
// Major Scale
const float calibMap2[QUAN_RES2] = {
0.00663080, 0.01433030, 0.02972930, 0.04512830, 0.05282781,
0.06822681, 0.08362581, 0.09902481, 0.10672431, 0.12212331,
0.13671936, 0.14392516, 0.15833676, 0.17274836, 0.18715996,
0.19436575, 0.20877735, 0.22318897, 0.23039477, 0.24480636,
0.25926629, 0.27375340, 0.28099698, 0.29548413, 0.30997124,
0.31721482, 0.33170196, 0.34618911, 0.36067623, 0.36791980,
0.38241133, 0.39690709, 0.40415496, 0.41865072, 0.43314645,
0.44764221, 0.45489007, 0.46938580, 0.48388156, 0.49112943,
0.50566339, 0.52025765, 0.53485191, 0.54214907, 0.55674326,
0.57133752, 0.57863468, 0.59322894, 0.60782319, 0.62241745,
0.62976688, 0.64452308, 0.65927929, 0.66665739, 0.68141359,
0.69616979, 0.71092600, 0.71830410, 0.73306036, 0.74781656,
0.75820577, 0.78151548, 0.80482519, 0.82813489, 0.83978975,
0.86309946, 0.90686423, 0.93941462
};
// Dorian Scale
const float calibMap3[QUAN_RES3] = {
0.00663080, 0.01433030, 0.02972930, 0.04512830, 0.06052731,
0.06822681, 0.08362581, 0.09902481, 0.10672431, 0.12212331,
0.13671936, 0.15113096, 0.15833676, 0.17274836, 0.18715996,
0.19436575, 0.20877735, 0.22318897, 0.23760056, 0.24480636,
0.25926629, 0.27375340, 0.28099698, 0.29548413, 0.30997124,
0.32445839, 0.33170196, 0.34618911, 0.36067623, 0.36791980,
0.38241133, 0.39690709, 0.41140282, 0.41865072, 0.43314645,
0.44764221, 0.45489007, 0.46938580, 0.48388156, 0.49837729,
0.50566339, 0.52025765, 0.53485191, 0.54214907, 0.55674326,
0.57133752, 0.58593178, 0.59322894, 0.60782319, 0.62241745,
0.62976688, 0.64452308, 0.65927929, 0.67403549, 0.68141359,
0.69616979, 0.71092600, 0.71830410, 0.73306036, 0.74781656,
0.76986063, 0.78151548, 0.80482519, 0.82813489, 0.83978975,
0.86309946, 0.90686423, 0.97196496
};
// 5th
const float calibMap4[QUAN_RES4] = {
0.00663080, 0.06052731, 0.11442380, 0.16554256, 0.21598317,
0.26650983, 0.31721482, 0.36791980, 0.41865072, 0.46938580,
0.52025765, 0.57133752, 0.62241745, 0.67403549, 0.72568226,
0.79317033, 0.87475431
};
// Whole tone
const float calibMap5[QUAN_RES5] = {
0.00663080, 0.02202980, 0.03742880, 0.05282781, 0.06822681,
0.08362581, 0.09902481, 0.11442380, 0.12951356, 0.14392516,
0.15833676, 0.17274836, 0.18715996, 0.20157155, 0.21598317,
0.23039477, 0.24480636, 0.25926629, 0.27375340, 0.28824055,
0.30272770, 0.31721482, 0.33170196, 0.34618911, 0.36067623,
0.37516347, 0.38965923, 0.40415496, 0.41865072, 0.43314645,
0.44764221, 0.46213794, 0.47663370, 0.49112943, 0.50566339,
0.52025765, 0.53485191, 0.54944617, 0.56404042, 0.57863468,
0.59322894, 0.60782319, 0.62241745, 0.63714498, 0.65190119,
0.66665739, 0.68141359, 0.69616979, 0.71092600, 0.72568226,
0.74043846, 0.75820577, 0.78151548, 0.80482519, 0.82813489,
0.85144460, 0.87475431, 0.93941462
};
//-------------------------------------------------------------
// CV Meter Custom Character
const unsigned char str1[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F};
const unsigned char str2[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x1F};
const unsigned char str3[8] = {0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x1F};
const unsigned char str4[8] = {0x00,0x00,0x00,0x00,0x1F,0x1F,0x1F,0x1F};
const unsigned char str5[8] = {0x00,0x00,0x00,0x1F,0x1F,0x1F,0x1F,0x1F};
const unsigned char str6[8] = {0x00,0x00,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
const unsigned char str7[8] = {0x00,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
const unsigned char str8[8] = {0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
//-------------------------------------------------------------
// Global Variables
static float gOSC_cv[8];
static float gGlide;
unsigned int gMode;
//-------------------------------------------------------------
// mbed Functions
TextLCD gLCD(p9, p10, p11, p12, p13, p14); // rs, e, d4-d7
SPI gSPI(p5,p6,p7); // SPI (p6 unconnected)
DigitalOut gSYNCMODE(p15); // SYNC DAC8568
DigitalOut gLDAC(p16); // LDAC DAC8568
DigitalOut gGATES[4] = {p21, p22, p23, p24}; // GateOut
DigitalOut gLEDS[4] = {p18, p19, p20, p28}; // LED
DigitalOut gCLOCKOUT(p25); // ClockOut
AnalogIn gAIN(p17); // Glide Potentiometer
InterruptIn gSW(p30); // Mode SW
Ticker gSetter; // Ticker SetCV
Ticker gPoller; // Ticker Polling
// Ethernet
EthernetNetIf gEth;
UDPSocket gUdp;
//-------------------------------------------------------------
// main
int main()
{
int i;
float pot, _pot;
if(SetupEthNetIf() == -1)
{
for(i = 0; i < 4; i++)
{
gLEDS[i] = 1;
wait(0.25);
}
return -1;
}
// mdns (Bonjour)
HTTPServer svr;
mDNSResponder mdns;
svr.addHandler<SimpleHandler>("/");
svr.bind(INPUT_PORT);
IpAddr ip = gEth.getIp();
mdns.announce(ip, "OSCtoCV", "_osc._udp", INPUT_PORT, "mbed(OSCtoCV)", (char *[]) {"path=/",NULL});
InitOSCCV();
pot = _pot = 0;
gGlide = gMode = 0;
gLCD.locate( 9, 0 );
gLCD.printf("OSC-CV");
gLCD.locate( 0, 1 );
gLCD.printf("12345678 G>>%3.2f", gGlide);
// loop
while(1)
{
gGlide = pot = gAIN.read();
if(abs(pot - _pot) > 0.01f)
{
gLCD.locate( 0, 1 );
gLCD.printf("12345678 G>>%3.2f", gGlide);
_pot = gAIN.read();
}
SetCV();
}
}
//-------------------------------------------------------------
// Ethernet Polling
inline void NetPoll()
{
Net::poll();
}
//-------------------------------------------------------------
// Initialize OSC-CV
void InitOSCCV()
{
// write custom char LCD CGRAM
WriteCustomChar(0x00, str1);
WriteCustomChar(0x01, str2);
WriteCustomChar(0x02, str3);
WriteCustomChar(0x03, str4);
WriteCustomChar(0x04, str5);
WriteCustomChar(0x05, str6);
WriteCustomChar(0x06, str7);
WriteCustomChar(0x07, str8);
// Init. SPI
gLDAC = _ENABLE;
gSPI.format(8,1); // Data word length 8bit, Mode=1
gSPI.frequency(SPI_RATE);
UpdateCV(CLR, 0, 0); // Ignore CLR Pin
gSW.mode(PullUp); // Use internal pullup for ModeSW
wait(.001);
gSW.rise(&CheckSW); // InterruptIn rising edge(ModeSW)
gPoller.attach_us(&NetPoll, POLLING_INTERVAL); // Ticker Polling
wait(0.2);
}
//-------------------------------------------------------------
// SPI Transfer
// DAC8568 data word length 32bit (8bit shift out)
inline void UpdateCV(int control, int address, const unsigned int *data)
{
__disable_irq();
switch(control)
{
case WRITE_UPDATE_N:
{
gSYNCMODE = _DISABLE;
gSPI.write(00000000|control); // padding at beginning of byte and control bits
gSPI.write(address << 4 | *data >> 12); // address(ch) bits
gSPI.write((*data << 4) >> 8); // middle 8 bits of data
gSPI.write((*data << 12) >> 8 | 00001111);
gSYNCMODE = _ENABLE;
gLDAC = _DISABLE;
gLDAC = _ENABLE;
break;
}
case RESET:
{
gSYNCMODE = _DISABLE;
gSPI.write(00000111); // Software RESET
gSPI.write(00000000);
gSPI.write(00000000);
gSPI.write(00000000);
gSYNCMODE = _ENABLE;
break;
}
case CLR:
{
gSYNCMODE = _DISABLE;
gSPI.write(00000101); // CLR Register
gSPI.write(00000000);
gSPI.write(00000000);
gSPI.write(00000011); // Ignore CLR Pin
gSYNCMODE = _ENABLE;
break;
}
}
__enable_irq();
}
//-------------------------------------------------------------
// Calculate CV
void SetCV()
{
static int ch;
float glidecv[8];
unsigned int cv[8];
static float oldcv[8];
static unsigned int quan;
float qcv;
switch(gMode)
{
case MODE_LIN:
glidecv[ch] = oldcv[ch] * gGlide + gOSC_cv[ch] * (1.0f - gGlide);
oldcv[ch] = glidecv[ch];
cv[ch] = (unsigned int)glidecv[ch];
UpdateCV(WRITE_UPDATE_N, ch, &cv[ch]);
break;
case MODE_QChr:
quan = 40616 / QUAN_RES1;
qcv = calibMap1[(unsigned int)(gOSC_cv[ch] / quan)];
glidecv[ch] = oldcv[ch] * gGlide + (qcv * SCALING_N) * (1.0f - gGlide);
oldcv[ch] = glidecv[ch];
cv[ch] = (unsigned int)glidecv[ch];
UpdateCV(WRITE_UPDATE_N, ch, &cv[ch]);
break;
case MODE_QMaj:
quan = 40616 / QUAN_RES2;
qcv = calibMap2[(unsigned int)(gOSC_cv[ch] / quan)];
glidecv[ch] = oldcv[ch] * gGlide + (qcv * SCALING_N) * (1.0f - gGlide);
oldcv[ch] = glidecv[ch];
cv[ch] = (unsigned int)glidecv[ch];
UpdateCV(WRITE_UPDATE_N, ch, &cv[ch]);
break;
case MODE_QDor:
quan = 40616 / QUAN_RES3;
qcv = calibMap3[(unsigned int)(gOSC_cv[ch] / quan)];
glidecv[ch] = oldcv[ch] * gGlide + (qcv * SCALING_N) * (1.0f - gGlide);
oldcv[ch] = glidecv[ch];
cv[ch] = (unsigned int)glidecv[ch];
UpdateCV(WRITE_UPDATE_N, ch, &cv[ch]);
break;
case MODE_Q5th:
quan = 40616 / QUAN_RES4;
qcv = calibMap4[(unsigned int)(gOSC_cv[ch] / quan)];
glidecv[ch] = oldcv[ch] * gGlide + (qcv * SCALING_N) * (1.0f - gGlide);
oldcv[ch] = glidecv[ch];
cv[ch] = (unsigned int)glidecv[ch];
UpdateCV(WRITE_UPDATE_N, ch, &cv[ch]);
break;
case MODE_QWht:
quan = 40616 / QUAN_RES5;
qcv = calibMap5[(unsigned int)(gOSC_cv[ch] / quan)];
glidecv[ch] = oldcv[ch] * gGlide + (qcv * SCALING_N) * (1.0f - gGlide);
oldcv[ch] = glidecv[ch];
cv[ch] = (unsigned int)glidecv[ch];
UpdateCV(WRITE_UPDATE_N, ch, &cv[ch]);
break;
case MODE_Calb:
cv[ch] = 19212; // A440.0Hz
UpdateCV(WRITE_UPDATE_N, ch, &cv[ch]);
break;
}
CVMeter(ch, &cv[ch]);
ch++;
ch &= 0x07;
}
//-------------------------------------------------------------
// Check SW
void CheckSW()
{
if(gMode < MODE_NUM - 1)
{
gMode++;
} else {
gMode = 0;
}
switch(gMode)
{
case MODE_LIN:
gLCD.locate( 9, 0 );
gLCD.printf("OSC-CV ");
break;
case MODE_QChr:
gLCD.locate( 9, 0 );
gLCD.printf("QUAN_C ");
break;
case MODE_QMaj:
gLCD.locate( 9, 0 );
gLCD.printf("QUAN_M ");
break;
case MODE_QDor:
gLCD.locate( 9, 0 );
gLCD.printf("QUAN_D ");
break;
case MODE_Q5th:
gLCD.locate( 9, 0 );
gLCD.printf("QUAN_5 ");
break;
case MODE_QWht:
gLCD.locate( 9, 0 );
gLCD.printf("QUAN_W ");
break;
case MODE_Calb:
gLCD.locate( 9, 0 );
gLCD.printf("Calibr ");
break;
}
}
//-------------------------------------------------------------
// CV meter
void CVMeter(int ch, const unsigned int *level)
{
unsigned int cvmeter;
cvmeter = *level / 4860;
// cvmeter = *level / (SCALING_N / 7.9);
gLCD.locate ( ch, 0 );
gLCD.putc(cvmeter); // put custom char
}
//-------------------------------------------------------------
// Write command Custom Char LCD CGRAM(CV Meter)
void WriteCustomChar(unsigned char addr, unsigned char *c)
{
char cnt = 0;
addr = ((addr << 3) | 0x40);
while(cnt < 0x08)
{
gLCD.writeCommand(addr | cnt);
gLCD.writeData(*c);
cnt++;
c++;
}
}
//-------------------------------------------------------------
// Setup Ethernet port
int SetupEthNetIf()
{
gLCD.locate( 0, 1 );
gLCD.printf("Setting up... ");
// printf("Setting up...\r\n");
EthernetErr ethErr = gEth.setup();
if(ethErr)
{
gLCD.locate( 0, 1 );
gLCD.printf("Error in setup.");
// printf("Error %d in setup.\r\n", ethErr);
return -1;
}
// printf("Setup OK\r\n");
// printf("IP address %d.%d.%d.%d\r\n", gEth.getIp()[0], gEth.getIp()[1], gEth.getIp()[2], gEth.getIp()[3]);
Host broadcast(IpAddr(gEth.getIp()[0], gEth.getIp()[1], gEth.getIp()[2], 255), INPUT_PORT, NULL);
gUdp.setOnEvent(&onUDPSocketEvent);
gUdp.bind(broadcast);
gLCD.locate( 0, 1 );
gLCD.printf("%03d.%03d.%03d.%03d", gEth.getIp()[0], gEth.getIp()[1], gEth.getIp()[2], gEth.getIp()[3]);
wait(2.0);
return 0;
}
//-------------------------------------------------------------
// Handller receive UDP Packet
void onUDPSocketEvent(UDPSocketEvent e)
{
union OSCarg msg[10];
static int num;
switch(e)
{
case UDPSOCKET_READABLE: // The only event for now
char buf[256] = {0};
Host host;
while( int len = gUdp.recvfrom( buf, 256, &host ))
{
if(len <= 0) break;
// printf("\r\nFrom %d.%d.%d.%d:\r\n",
// host.getIp()[0], host.getIp()[1], host.getIp()[2], host.getIp()[3]);
getOSCmsg(buf,msg);
// printf("OSCmsg: %s %s %f %i\r\n",
// msg[0].address, msg[1].typeTag, msg[2].f, msg[2].i);
len = strlen(msg[0].address);
if(isdigit(msg[0].address[len-1])) num = msg[0].address[len-1] - '0' - 1;
else num = -1;
unsigned int absv = msg[2].f + 0; //convert -0 to 0
// address pattern SYNC & GATE (Type Tag int, float)
if((strncmp(msg[0].address+(len-1)-4, "sync", 4)==0) && (num == -1)) {
if(num > 1) break;
if(absv >= 1 || msg[2].i >= 1) gCLOCKOUT = 1;
else gCLOCKOUT = 0;
break;
} else if ((strncmp(msg[0].address+(len-1)-4, "gate", 4)==0) && (num != -1)) {
if(num > 3) break;
if(absv >= 1 || msg[2].i >= 1) gLEDS[num] = gGATES[num] = 1;
else gLEDS[num] = gGATES[num] = 0;
break;
// (touchOSC Control push, toggle)
} else if ((strncmp(msg[0].address+(len-1)-4, "push", 4)==0) && (num != -1)) {
if(num > 3) break;
if(absv >= 1 || msg[2].i >= 1) gLEDS[num] = gGATES[num] = 1;
else gLEDS[num] = gGATES[num] = 0;
break;
} else if ((strncmp(msg[0].address+(len-1)-6, "toggle", 6)==0) && (num != -1)) {
if(num > 3) break;
if(absv >= 1 || msg[2].i >= 1) gLEDS[num] = gGATES[num] = 1;
else gLEDS[num] = gGATES[num] = 0;
break;
} else if ((strncmp(msg[0].address,"/1/multipush",12)==0) && (num != -1)) {
if(num > 3) break;
if(absv >= 1 || msg[2].i >= 1) gLEDS[num] = gGATES[num] = 1;
else gLEDS[num] = gGATES[num] = 0;
break;
}
// address pattern CV (Type Tag float)
if((strncmp(msg[0].address+(len-1)-2, "cv", 2)==0) && (num != -1)) {
if(num > 7) break;
if(msg[1].typeTag[1] == 'f') gOSC_cv[num] = msg[2].f * (SCALING_N);
break;
// (touchOSC Control fader, rotary, xy, multixy, multifader)
} else if ((strncmp(msg[0].address+(len-1)-5, "fader", 5)==0) && (num != -1)) {
if(num > 7) break;
if(msg[1].typeTag[1] == 'f') gOSC_cv[num] = msg[2].f * (SCALING_N);
break;
} else if ((strncmp(msg[0].address+(len-1)-6, "rotary", 6)==0) && (num != -1)) {
if(num > 7) break;
if(msg[1].typeTag[1] == 'f') gOSC_cv[num] = msg[2].f * (SCALING_N);
break;
} else if ((strncmp(msg[0].address+(len-1)-2, "xy", 2)==0) && (num != -1)) {
if(num > 7) break;
if(msg[1].typeTag[1] == 'f') gOSC_cv[num] = msg[2].f * (SCALING_N);
if(msg[1].typeTag[1] == 'f') gOSC_cv[++num] = msg[3].f * (SCALING_N);
break;
} else if ((strncmp(msg[0].address+(len-1)-9, "multixy1/", 9)==0) && (num != -1)) {
if(num > 7) break;
if(msg[1].typeTag[1] == 'f') gOSC_cv[num] = msg[2].f * (SCALING_N);
if(msg[1].typeTag[1] == 'f') gOSC_cv[++num] = msg[3].f * (SCALING_N);
break;
} else if ((strncmp(msg[0].address+(len-1)-12, "multifader1/", 12)==0) && (num != -1)) {
if(num > 7) break;
if(msg[1].typeTag[1] == 'f') gOSC_cv[num] = msg[2].f * (SCALING_N);
}
}
}
}