Matching list item change with knob CC value change

Discuss Lemur and share techniques.
Post Reply
dogblessyou
Newbie
Posts:6
Joined:10 May 2013 11:34
Matching list item change with knob CC value change

Post by dogblessyou » 07 Oct 2017 12:43

I have knob that send CC 0-103 that select waveform on my DSI Tetra synth. Beside the knob I have a text object that display list items to show corresponding waveform. But I'm having a hard time matching them up precisely.

The knob label is set to value= x*103.

The list items:

Code: Select all

modsrc={'Off','Saw','Tri','Saw-Tri','Pulse 0','Pulse 1','Pulse 2','Pulse 3','Pulse 4','Pulse 5','Pulse 6','Pulse 7','Pulse 8','Pulse 9','Pulse 10','Pulse 11','Pulse 12','Pulse 13','Pulse 14','Pulse 15','Pulse 16','Pulse 17','Pulse 18','Pulse 19','Pulse 20','Pulse 21','Pulse 22','Pulse 23','Pulse 24','Pulse 25','Pulse 26','Pulse 27','Pulse 28','Pulse 29','Pulse 30','Pulse 31','Pulse 32','Pulse 33','Pulse 34','Pulse 35','Pulse 36','Pulse 37','Pulse 38','Pulse 39','Pulse 40','Pulse 41','Pulse 42','Pulse 43','Pulse 44','Pulse 45','Pulse 46','Pulse 47','Pulse 48','Pulse 49','Pulse 50','Pulse 51','Pulse 52','Pulse 53','Pulse 54','Pulse 55','Pulse 56','Pulse 57','Pulse 58','Pulse 59','Pulse 60','Pulse 61','Pulse 62','Pulse 63','Pulse 64','Pulse 65','Pulse 66','Pulse 67','Pulse 68','Pulse 69','Pulse 70','Pulse 71','Pulse 72','Pulse 73','Pulse 74','Pulse 75','Pulse 76','Pulse 77','Pulse 78','Pulse 79','Pulse 80','Pulse 81','Pulse 82','Pulse 83','Pulse 84','Pulse 85','Pulse 86','Pulse 87','Pulse 88','Pulse 89','Pulse 90','Pulse 91','Pulse 92','Pulse 93','Pulse 94','Pulse 95','Pulse 96','Pulse 97','Pulse 98','Pulse 99'};
I've tried some different ways and can't figure out what I am doing wrong:

Code: Select all

setattribute(txtStatModSrc2,'content',textShape2_26.modsrc[x*103]);
setattribute(txtStatModSrc2,'content',textShape2_26.modsrc[round(x*103)]);
setattribute(txtStatModSrc2,'content',textShape2_26.modsrc[floor(x*103.999999999999999999999999)]);
setattribute(txtStatModSrc2,'content',textShape2_26.modsrc[ceil(x*103)]);
setattribute(txtStatModSrc2,'content',textShape2_26.modsrc[range(x,0,103)]);
and a few variations more. I couldn't get any of them matching precisely.
What am I doing wrong? A bug in my script? Is the math off? Am I going about this the wrong way?
Last edited by dogblessyou on 07 Oct 2017 13:25, edited 2 times in total.

dogblessyou
Newbie
Posts:6
Joined:10 May 2013 11:34

Re: Matching list item change with knob CC value change

Post by dogblessyou » 07 Oct 2017 13:16

Well that's just typical. I struggle with this for hours. Right after posting here I find the best matching formula so far, I'm quite happy with this one:

Code: Select all

setattribute(txtStatModSrc2,'content',textShape2_26.modsrc[range(x,0.5,103.5)]);
But I'm still interested in your thoughts. Shouldn't the math for the knob label value and list items be the same to match up?

Post Reply