I study to operate TC Helicon VoiceWorksPlus by means of МТ.

valera

2011-11-12 16:10:37

Hello!

I very much was delighted, when have found in Internet MT! I am grateful to authors of the program for courageous and unique idea!

I have harmonizer TC Helicon VoiceWorksPlus. It has not enough buttons and adjusters for an operational administration all functions. Therefore I dreamt to use for a long time the PC keyboard as the midi-controller for the TC Helicon VoiceWorksPlus.

I while work with Trial version 1.71. I wish to be convinced of possibilities of this program before its purchase. But while for me is a lot of not clear. Especially in writing Rules.

As experiment I have wanted to operate one of parametres TC Helicon VoiceWorksPlus.

F0 00 01 38 00 51 22 03 32 00 00 qq pp F7

Complexity in that the band of changes of this parametre consists for example of 10 steps. Thus the variable "pp" should make two cycles on 5 steps. After each cycle the variable "qq" changes the value with 00h on 01h.

So Incoming Keystroke "H".
For this purpose I have created (Incoming Keystroke "H") two identical cycles "To middle" and "After middle" with check of a peak value of the counter gx> 6. At gx> 6 variables "qq" are appropriated in the beginning value qq=1 (a cycle "To middle"), and next time qq=0 (a cycle "After middle").

Code: Select all

if qq== 0 then Goto "To middle"
if qq== 1 then Goto "After middle"
Label "To middle"
gx=gx+1
if gx> 6 then gx=0
if gx== 0 then qq=1
pp=gx-1
if gx== 0 then Goto "After middle"
exit rules, execute Outgoing Action
Label "After middle"
gx=gx+1
if gx> 6 then gx=0
if gx== 0 then qq=0
pp=gx-1
if gx== 0 then Goto "To middle"
exit rules, execute Outgoing Action

Strange, but this program always starts to work with a cycle "After middle", as though by default qq=1. But it yet all. 
When in a cycle "After middle" the counter reaches a peak value (gx> 6), qq=0 (zeroing). The program passes by first line, the condition satisfies and logically passes to a cycle "To middle". Here again in the first step of this cycle suddenly there is a strange: qq=1 (has seen at debugging). 
After that the program logically passes in the second line, the condition satisfies and again passes to a cycle "After middle".
I long could not understand, where my error. I did not believe, that MT can incorrectly work. But I all the same was convinced, that "qq" receives the values illogically. Then I have set to it value qq=jp and have entered it into the program. And my program began to work at once! 

if jp== 0 then Goto "To middle"
if jp== 1 then Goto "After middle"
Label "To middle"
gx=gx+1
qq=jp
if gx> 6 then gx=0
if gx== 0 then jp=1
pp=gx-1
if gx== 0 then Goto "After middle"
exit rules, execute Outgoing Action
Label "After middle"
gx=gx+1
qq=jp
if gx> 6 then gx=0
if gx== 0 then jp=0
pp=gx-1
if gx== 0 then Goto "To middle"
exit rules, execute Outgoing Action
I do not understand, why "jp" is by default equal "0", and "qq" by default cannot be equal "0"?

I not the mathematician and not the programmer, therefore am possible I in something I am mistaken. Help please council.

Thanks for attention.

florian

2011-11-17 12:20:57

hi,
pp is one of the "local" variables. Unless they're set in the incoming action, they have a non-deterministic value upon entering the rules. If you want to keep the value of pp, use a global variable for that, e.g. "gp".

To fully understand your issue, please post the following:
1) what exactly should be sent upon presses of key H? I understand it to be this series:
F0 00 01 38 00 51 22 03 32 00 00 00 00 F7
F0 00 01 38 00 51 22 03 32 00 00 00 01 F7
...
F0 00 01 38 00 51 22 03 32 00 00 00 04 F7
F0 00 01 38 00 51 22 03 32 00 00 01 00 F7
...
F0 00 01 38 00 51 22 03 32 00 00 01 04 F7

2) your current preset incl. incoming and outgoing actions. You can copy one or more translator in Midi Translator and paste them directly into this forum.

Thanks,
Florian

valera

2011-11-18 14:19:08

Thanks, Florian, for desire to help!

I wrote the recent example proceeding from the supposition, that all variables not declared earlier (by default) are equal to zero.
And my simple Presets in the beginning confirmed it.
Then I have created Preset more difficult (in the first post) and long could not understand, why I Preset not correctly works.
Later has detected, what not all variables not declared (by default) earlier are equal to zero and it has puzzled me.
For example, in the first variant of mine Preset (in the first post) the variable "qq" in any way did not wish to accept value "1" while I have not assigned qq=jp. Then all began to work.
But also "qq", and "jp" equally were not declared earlier and probably both these variables should be equaled to zero? I have not understood it.

And about global and local variables I without fail esteem in Instruction MT and in other literature. Though I and not the programmer but to study never late.

Just now I have understood, that in first my experiences I have undertaken the incorrect approach in the radical. About it will go further...

In the beginning I simply tested the forces and the task of mine Presets was in, that by pressing (and deduction) keys "H" value "pp" increased. There was still a key "J" which reduced "pp", but for simplicity I here did not publish this part.
In a reality completely the dump of a code of one of regulators of mine harmonizer TC HELICON VoiceWorksPlus looks so:

Code: Select all

From zero to the regulator middle (qq=0, pp - progresses)

F0 00 01 38 00 51 22 03 32 00 00 00 00 F7 
F0 00 01 38 00 51 22 03 32 00 00 00 01 F7 
F0 00 01 38 00 51 22 03 32 00 00 00 02 F7 
.....

On the middle regulator position (qq=1, pp=00)

F0 00 01 38 00 51 22 03 32 00 00 00 7F F7 
F0 00 01 38 00 51 22 03 32 00 00 01 00 F7 
F0 00 01 38 00 51 22 03 32 00 00 01 01 F7 
F0 00 01 38 00 51 22 03 32 00 00 01 02 F7 
......
After the middle before finite position of a regulator

F0 00 01 38 00 51 22 03 32 00 00 01 6F F7 
F0 00 01 38 00 51 22 03 32 00 00 01 70 F7 
In a reality (as we see from a dump of data) it has appeared, that parts "To midle" (max. "pp" =7F) and "After middle" (max. "pp" =70) are nonsymmetric
I have understood yesterday, that my small experiment (in the first post) with two symmetric cycles will normally not work in real conditions. There I for simplification have limited value "pp" only to five steps.
In the first Presets at maximum values "pp" and "qq" process started at first. But I have understood, that it too the superfluous.
Now all works wonderfully, I have solved the task so:

Code: Select all

Translator 0.0: Increase with step +1
Options: stop=false
Incoming: Keystroke: H
Rules: 
  gx=gx+1
  if gx>240 then gx=240
  if gx>127 then g1=1
  if g1==1 then gy=127+1
  if g1==0 then gy=0
  qq=g1
  pp=gx-gy
  exit rules, execute Outgoing Action
Outgoing: MIDI F0 00 01 38 00 51 22 03 32 00 00 qq pp F7 

Translator 0.1: Reduction with step -1
Options: stop=false
Incoming: Keystroke: J
Rules: 
  gx=gx-1
  if gx<1 then gx=0
  if gx<128 then g1=0
  if g1==1 then gy=-128
  if g1==0 then gy=0
  qq=g1
  pp=gx+gy
  exit rules, execute Outgoing Action
Outgoing: MIDI F0 00 01 38 00 51 22 03 32 00 00 qq pp F7 
Can to me it is necessary to rename for example into a theme in "The Example of usage PC keyboard as Midi-controller"?

Thanks for the good and necessary program! I will continue with the great pleasure experiments with it.

PS: It would be very good to have possibility of an insert of remarks in any string Rules because the idea (algorithm) of operation of those or other rules in due course is forgotten.

florian

2011-11-18 20:56:20

Hi,

thanks for the explanation, I hope many things make more sense now.

Some notes:
- global variables are guaranteed to be 0 at the start of the project (after loading)
- local variables will take a random value, which may be 0, or may not
- as a workaround, I add labels into the rules as a comment:
Label "the next line will increment the global variable"
- you can also use global variables in the outgoing action, so in the outgoing MIDI string, you do not need qq, as it will always have the same value as g1.
- I assume that you've "discovered" the Log Window for debugging your preset/rules.

Regards,
Florian

valera

2011-11-18 21:42:55

Thanks, Florian, for hints!

Yes, I use a debugger. But it seemed little bit inconvenient that each time it is necessary to press the button for a dump of variables. I think it would be more convenient, that this button at debugging or included constant show of variables, or switched off.

Really, I do not require now in "qq" and I can substitute it in MIDI string on "g1"!

qq=g1 For me remains from the previous experiments when it was not possible to me to receive start value qq=0 in any way. This local variable accepted strange value most likely because fell outside the limits function in which it worked, its binding to "g1" therefore has helped.

It seems to me very inconvenient, that local variables take casual value. Can is better, that instead of randomness they were by default equal to zero? I can be mistaken or add it excessive attention certainly.

I plan to open a theme on one of our forums for musicians for the purpose of popularisation MT and its possibilities.
Only I need most to understand in the beginning a little operation MT to manage to show to the colleagues at least some correct examples ипользования MT in different situations.

In my opinion MT deserves the big attention!

florian

2011-11-19 10:34:04

Hi Valera,

I appreciate it!

regarding local variables:

I agree that it may be cumbersome sometimes that they are not initialized with 0. But this has a reason. Unlike global variables, the set of local variables (pp, qq, rr, ss, tt, ... xx) is bound to an incoming message.

As an example, consider a more complex setup with multiple MIDI inputs. You can have situations where you get two incoming events at exactly the same time. Midi Translator is heavily multi-threaded and it will actually process both MIDI messages at the same time. Now if you change the same global variable in a translator, you get a so-called "race condition" where you cannot be sure which MIDI message will change the global variable first. With local variables that cannot happen: each incoming MIDI message has its own set of local variables attached (so you got 2 or more sets of local variables then). Also, the local variables keep their value if you process the same incoming message in multiple translators. Only when processing of that message is done will this set of local variables be removed.

Sorry for the tech speak, I just wanted to explain the peculiarity of local variables, and the usefulness...
Thanks,
Florian

valera

2011-11-19 20:27:00

Thanks, Florian, for a small lesson. Time I has taken a great interest MT to me all will have to master a technical language and let it happens earlier, than later.
I will study now your message about variables and to fix a lesson practice.
Florian tell please when output MT of version 2 c is planned by the promised improvements and whether will have to pay extra to me for it if now I will gain MT 1.7 Pro?

florian

2011-11-19 20:51:51

Hi Valera,

we're not yet ready for version 2.0, there will be other versions first (1.8, etc.). Those updates are for free.
We do plan for a small update fee for version 2.0.

Regards,
Florian

valera

2011-11-20 08:14:05

Thanks Florian for the information!
While questions are not present. I will access behind the help in process of occurrence of problems.

valera

2011-12-08 15:50:42

I was already ready to publish new examples for handle TC Helicon VoiceWorksPlus by means of МТ. But there was a problem.

I use harmonizer TC Helicon VoiceWorksPlus. It has specially developed editor for handle in all its parametres. The editor is named Vyzor VoiceWorks Plus.
In the absence of the device this editor works as the emulator. It is very convenient.
However there was a problem with speed MT. When the window of editor Vyzor VoiceWorks Plus is initialized then there is an essential strong deceleration of operation МТ. And when I switch in window МТ then МТ works very much very fast.
In what here the reason?
The matter is that I Harmonizer TC Helicon VoiceWorksPlus has many parametres which are hidden in plural tabs of its menu OS. These parametres more than 200. Therefore about process of regulations by means of МТ I can receive complete visualisation only with editor Vyzor VoiceWorks Plus.

Vyzor VoiceWorks Plus shows current customisations of the instrument in the form of certain position of pens of regulators. In addition are still specified also digital value of parametres of each such virtual regulator.
It is conceived as follows. When I press the necessary key on the computer keyboard then МТ sends a continuous series of codes and a virtual regulator is spun. And so before key release. For complete turn of virtual regulators it is necessary to send about 240 values.
At this moment also there is a braking in operation МТ. But only when the window of editor Vyzor VoiceWorks Plus is visible.
Idle time handle of type of inclusion of virtual buttons in panel Vyzor VoiceWorks Plus occurs fast.
I am am surprised with this problem because in one instant only one parametre / a virtual regulator always is controlled.

I have noticed possibilities perspective МТ in operation with files. I guess, that this possibility can be used and for indication of regulations carried out by means of МТ through loading of appropriate graphics files. Only I would not like to invent a bicycle.
At present МТ perfectly consults at designing of my task. While the described problem brings only.
Very much I hope that the given problem is solvable.
Give please to me a piece of good advice.

Thanks for attention!!

PS: I think that it is a problem most likely does not concern directly to МТ.
Probably tomorrow the problem will dare by itself. Then it will be a shame to me with the "loud SOS" at a forum...)))

florian

2011-12-12 11:17:43

Hi,

MT should work with (almost) the same speed when in background or when in foreground, so this does seem like a problem.

To prevent misunderstanding, could you please summarize the problem with a step-by-step description:
1) steps to reproduce the problem
2) what do you expect to happen?
3) what happens in reality?

Also, can you send a portion of MT's log window when the problem occurs?
Can you monitor CPU usage while the problem occurs?

Thanks!
Florian

valera

2011-12-12 13:32:58

Thanks Florian that was called to help!

Here mine preset. It regulates parametre "Low Cut Left" in mine harmonizer.
It is created so that single pressing and keeping of a computer key (H) to increase value of adjustable parametre.
Double short pressing and the subsequent keeping of a key works upside-down and reduces value of adjustable parametre.
For both cases the variable step of a cycle after the first 10 single steps is used. In the given example the step varies with single on value "7".

Code: Select all

Preset 0: Press key H

Translator 0.0: Calculation of pressing
Options: stop=false
Incoming: Key down: H
Rules: 
  gf=gf+1
Outgoing: One-shot timer "timer_1": 300 ms delay

Translator 0.1: Stop timer_1: ga=gf, zeroing "gf"
Options: stop=false
Incoming: On timer "timer_1"
Rules: 
  ga=gf
  gf=0
Outgoing: (none)

Translator 0.2: Stop timer_1: send SYSEX
Options: stop=false
Incoming: Keystroke: H
Rules: 
  if ga==1 then Goto "Increase"
  if ga==2 then Goto "Reduction"
  if ga<1 then exit rules, skip Outgoing Action
  if ga>2 then exit rules, skip Outgoing Action
  Label "Increase"
  gx=gx+1
  if gs>10 then gx=gx+7
  if gx>240 then gx=240
  if gx>127 then g1=1
  if g1==1 then gy=127+1
  if g1==0 then gy=0
  qq=g1
  gs=gs+1
  pp=gx-gy
  exit rules, execute Outgoing Action
  Label "Reduction"
  gx=gx-1
  if gs>10 then gx=gx-7
  if gx<1 then gx=0
  if gx<128 then g1=0
  if g1==1 then gy=-128
  if g1==0 then gy=0
  qq=g1
  gs=gs+1
  pp=gx+gy
  exit rules, execute Outgoing Action
Outgoing: MIDI F0 00 01 38 00 51 22 03 32 00 00 qq pp F7 

Translator 0.3: Zeroing "gs","ga"
Options: stop=false
Incoming: Key up: H
Rules: 
  gs=0
  ga=0
Outgoing: (none)
I have not found in МТ function how to copy for you data from a debugger window.

I developed this algorithm for the purpose of economy of keys. Because in in mine harmonizer such adjustable parametres approximately 200. However midi-messages in data harmonizer have not унифицированую structure. Therefore start, median (when the high double-byte number varies) and finite values of controlling double-byte number are often rather various.
Therefore I should enter values into my algorithm for start of a cycle, finish and value at which occurs change of high double-byte number. I do it for each separate computer key which controls this or that parametre in harmonizer.

I have created 8 presets and used all global variables! But I need to create still at least 40 (at the best 80) presets.
The matter is that I harmonizer has 4 voices and consequently each parametre for a voice (and them much) repeats four times.
Thus global variables should store values of adjustable parametres independently. It is necessary that each time at call to them handle in the given parametre proceeded from the last installed value.
Here upgrade МТ for the purpose of possibility to use two-dimensional and three-dimensional arrays very was useful. But now I in lockup - variables were completed...)))
Interestingly, and when there will be following version МТ with unlimited quantity of global variables? I read at a forum that it already is in development.

In the beginning I thought that МТ decelerates operation because of my slow computer of Pentium 2200 +/512 the MB / Windows XP+sp2. But also on the new computer this distinction was saved at transitions between windows. Though it worked faster this difference almost twice remained.
On the old computer at pressing of a key of 100% of resources of the processor are spent. On the fast computer 55% are spent approximately. Surprisingly, but at switching between windows of the indication of consumption of resources do not vary!

I have created video and it can be downloaded here.
http://exfile.ru/248637

Pay attention as speed of rotation of one of virtual regulators in window Vyzor VoiceWorks Plus considerably varies during switching between windows.
Video demonstrating of the given problem is much more effective than words...))

And still I in my experiments with МТ very much did not have such timer (with trigger start) and the set delay, set quantity of repetitions and which knew how with an incrementset numerical value (+1, +2, +3, etc.) or values of a variable.
I think that so it would be easier to set cycles and the program would work faster. Probably timers work passing the interpreter of high level? Probably I am mistaken variants of creation of cycles have no big difference for productivity of the program.

About necessity of notes and remarks at spelling Rules it was already spoken. But I at debugging yet did not have possibility to bypass in Rules some strings.
I am remembered in days of a youth programmed in the BASIC and at debugging for a time exception of this or that string put before it "REM". And the program temporarily worked bypassing such strings the error has not been found yet.
And in МТ by search of the error the string should be deleted entirely and then to insert.

Yes, I preset is far from perfect. I see where it is possible to simplify a little it but it already to what - free global variables are not present. I very much like this program but with such limited to variables I cannot solve the problem yet. It was simply played, has simply felt also all. It is very a pity...

Thanks for attention!

valera

2011-12-16 19:33:27

I optimised previous preset a little and something has corrected. Probably somebody needs my idea.
Only here there is a handle in parametre "Voice 1 Level" mine TC-Helicon VoiceWorksPlus.
In operation of it presets has varied nothing but I have removed superfluous strings and a little from them have generalised. It was my small training.

Code: Select all

Preset 14: My Preset

Translator 14.0: opening: value variable
Options: stop=false
Incoming: Project Opened
Rules: 
  gp=66
  g4=127
Outgoing: (none)

Translator 14.1: Counter "gf+1"
Options: stop=false
Incoming: Key down: H
Rules: 
  gf=gf+1
Outgoing: One-shot timer "timer_1_1": 250 ms delay

Translator 14.2: Stop timer: ga=gf; gf=0
Options: stop=false
Incoming: On timer "timer_1_1"
Rules: 
  ga=gf
  gf=0
  gr=1
Outgoing: (none)

Translator 14.3: Execute: send SYSEX
Options: stop=false
Incoming: Keystroke: H
Rules: 
  gs=gs+1
  if gs>7 then gr=3
  if ga==1 then gm=1*gr
  if ga==2 then gm=-1*gr
  gp=gp+gm
  if gp>127 then g4=0
  if gp<127 then g4=127
  if gp>133 then gp=133
  if gp<66 then gp=66
  if g4==0 then gy=127
  if g4==127 then gy=0
  pp=gp-gy
Outgoing: MIDI F0 00 01 38 00 51 22 03 08 g4 g4 g4 pp F7 

Translator 14.4: Zeroing "gs"
Options: stop=false
Incoming: Key up: H
Rules: 
  ga=0
  gs=0
  gr=1
Outgoing: (none)