Rule (Key) to shift octave at once?

adXok

2009-06-24 16:43:22

Hi, guys :)
I am using my PC Keyboard as a MIDI keyboard controller. I have set it up already to use kestrokes. Everything works fine.
Now I want to shift down the whole preset (keys) one octave below using [F3] and octave above using [F4].

How can I do that?
Do I need new preset because I need MT runing in background and simply with [F3] and [F4] (or others if in conflict with my VST synth settings) to change the octaves as spoken and not to restore MT whenever I want to make such an effort?

Thanks in advance! :)

Maybe something like this:
If I press [F3] then shift the MIDI messages concerning pitch by 12 semitones lower.
If I release [F3] then do nothing. Or something...

Transulator

2009-06-25 07:55:55

Code: Select all

edit

adXok

2009-06-25 11:05:51

Could you confirm that I should keep F3 or F4 pressed while doing the octave shift?! Or I press F3 then release it and afterwards all the incoming midi data from my PC keyboard is concidered one octave lower or high correspondingly?


-------------

Maybe something I'm doing wrong 'cause it doesn't work :(
I do not get the line: options stop=false
I do not find it. Otherwise everithing I coded as you mentioned.
The sound is there when I hit a key but the octave shift doesn't work.

P.P. Do I have to put this in new Preset 'cause I add it in my current presset where the keystrokes assignments are?

Transulator

2009-06-25 13:10:43

Sorry, did it from imagination this morning (sitting in the office) and it was wrong. Here's the correct solution:

Code: Select all

Translator 1: F3 
options: stop=false 
Incoming: Key down: F3 
Rules: gt=-12 
Outgoing: (none) 

Translator 2: F3 release 
options: stop=false 
Incoming: Key up: F3 
Rules: gt=0 
Outgoing: (none) 

Translator 3: F4 
options: stop=false 
Incoming: Key down: F4 
Rules: gt=12 
Outgoing: (none) 

Translator 4: F4 release 
options: stop=false 
Incoming: Key up: F4 
Rules: gt=0 
Outgoing: (none) 

Translator 5: Midi note transpose 
options: stop=false 
Incoming: Midi 80 xx pp 
Rules: xx=xx+gt 
Outgoing: Midi 80 xx pp 
The 'release' translators (2 & 4) reset the transpose value back to zero when you release the buttons. You'll hear the original octave then.

ps. stop=false is set on the first page of the translator (Options) by clicking 'Active'.

adXok

2009-06-25 13:48:13

But I just want when I hit F3 to work like octave switch button.
I do not have much more than two hands for holding the F3 key till I'm finished wwith the octave down part.

I just want to press F3 and the octave to be shifted instantly.

How am I supposed to accomplish that?
Thanks in advance :)

Something like that:
Press-release the F3 button. Next all MIDI data for the pitch of the kesytrokes to be one octave lower. So simple. No need to hold the F3 pressed all the time. Seems there was a missunderstanding.

DvlsAdvct

2009-06-25 18:32:28

You can do this with Preset changes. You'd need three presets: Normal, Octave Down, Octave Up.

In the Normal preset you'd put something like

Code: Select all

Translator 1: Octave Down
options: stop=false 
Incoming: Key down: F3 
Outgoing: Activate Preset: Octave Down

Translator 2: Deactivate
options: stop=false
Incoming: Preset Activated: Octave Down
Outgoing: Deactivate This Preset
Then, in the Preset called Octave Down, all the outgoing messages are one octave lower. In that Preset set the same key, F3, to activate your normal preset.

You could also have something like F2 is Octave Down, F3 is Normal and F4 is Octave Up and code it so you can jump between presets. So when you hit F2 it goes to Octave Down whether your are in Normal OR Octave Up.

And then just put similar translators in each Preset.

adXok

2009-06-25 18:52:53

Well, I see it is not possible.
But it just has to be so simple.

So if I make lets say 8 presets of my all keystrokes coresponding to the appropriate octaves, how to tell: switch (activate) next preset and turn of the current with F3 key for exmple during playing?

In fact what is that MT program necessary for if it cannot switch such a common use like octaves especially with small keyboards (40~45 keys)
:)

DvlsAdvct

2009-06-25 19:19:25

AFAIK, you have two options. You can do it with Global Variables (if g0=1 then xx=xx+12) or you can do it with presets. I think presets are easier, especially if you want to make changes later.

If you do it with global variables then it could look something like

Code: Select all

Translator 1: Octave Up
options: stop=false 
Incoming: Key down: F3 
Rules: if g0==1 then g0=0
Exit Rules, skip outgoing action
if g0!=1 then g0=1
Outgoing: (none) 

Translator 3: F4 
options: stop=false 
Incoming: Key down: F4 
Rules: if g0==2 then g0=0
exit rules, skip outgoing action
if g0!=2 then g0=2
Outgoing: (none) 

Translator 5: Midi note transpose 
options: stop=false 
Incoming: Midi xx 90 
Rules: if g0==0 then xx=xx
if g0==1 then xx=xx-12
if g0==2 then xx=xx+12
Outgoing: Midi 90 xx pp 
Now, if you go to One Octave Down (F3) you can go straight to One Octave Up (F4) or back to Normal by hitting F3 again. This can be cleaner with labels and all, but I do think it's easier to use presets. I think that'll work.

Transulator

2009-06-25 19:38:06

adXok wrote:Well, I see it is not possible.
That's no option. :-)

@DvlsAdvct
I think it should be "Incoming: Midi xx pp" in Translator 5.

adXok

2009-06-25 21:11:46

Sorry but obviously I need to be more specific. So... here's the deal:

1. I have set up my keystrokes in one preset (only one) - works great!
2. I want when I hit (and release) F3 to shift all keystrokes MIDI pitch message to: go 12 down
- If I hit (and release) F3 once again to go even lower (12 down again)
and so on
3. Whenever I hit (and release) F4 to go opposite: shift up one octave
- and again, again

God, it has to be simple :)

Have a set up all necessary keystrokes in a preset like:
Options| name: Z=Do (active is checked, stop... is unchecked)
Incoming| (key down is checked) Keystroke: Z
Outgoing| MIDI message: 90 3c 5a

I think the bold red value is the one concerning the pitch of the tone. So I have all the other keystrokes set up similar to that one.

Is there a one hit key solution [F3] after which the bold red values to be read or translated as "12 values lower" from the original settings for the one and only one preset of keystrokes?

:)

P.S. I know maybe I'm not posting this to a musicians but anyway, excuse me for being so simple.
P.P.S DvlsAdvct, I made the settings from your code (and the correction). Again nothing happens as you describe it should do the shift.

Transulator

2009-06-25 21:55:25

Alright then, you want up/down functionality...

Code: Select all

Translator 1: F3 (shift down)
Options: stop=false
Incoming: Keystroke: F3
Rules:
gd=-12
gt=gt+gd
Outgoing: None

Translator 2: F4 (shift up)
Options: stop=false
Incoming: Keystroke: F4
Rules:
gu=12
gt=gt+gu
Outgoing: None

Translator 3: Process Midi transpose
Options: stop=false
Incoming: MIDI 90 xx pp
Rules: xx=xx+gt
Outgoing: MIDI 90 xx pp
gd is the variable for counting 12 semitones down. By adding this to gt (global transpose value) with every hit of F3 you reach the lower octaves. When hitting F4 the variable gu (12 semitones up) will be activated and added to gt whenever you do so.

MIDI 90 sends a note on with the pitch xx and the velocity pp.

Transulator

2009-06-25 22:00:57

...and yes, this time I've tested it. :D

DvlsAdvct

2009-06-25 23:25:29

My mistake. Thought you wanted it to just go down an octave or up and octave, not keep going. Must have misread.

Transulator

2009-06-26 00:07:34

@adXok

Another addition... If you're playing the notes with your qwerty-keys you'll have to replace the third translator for each key you are using. At the moment the preset responds to external midi.

Example:

Translator 3: Process Midi transpose for button Q
Options: stop=false
Incoming: Keystroke: Q
Rules: xx=60+gt
Outgoing: MIDI 90 xx 64

Translator 4: Process Midi transpose for button W
Options: stop=false
Incoming: Keystroke: W
Rules: xx=61+gt
Outgoing: MIDI 90 xx 64

...and so on

Note that I've set the note pitch values (red color) as an example.

adXok

2009-06-26 07:40:34

Yes, I am using my QWERTY-keyboard.
That last part I didd't understand very well. You mean for each keystroke I have to write the 'translator' formula with the red value you suggest correspondig to its pitch?!

Well... I give it a try. Lets see will it finaly happen. :)

What pitch values are 60 and 61?! :(
My pitch value for [Q] key is: 90 46 5a which means: Bb in music language. Oh, I got it! :) You mean 60 = C7 in music language.

But... oh no, now I have to think of musical tones like groups of 12s when I already gave them hexadecimal values in keystrokes settings. Oh, God... please gide my hand!
-24=C-2, 0=C0, 1=C#0... an so on for the expression: xx=60 (which is tone C7) + gt

How many digital languages do I have to speak to finish this :D

Oh, so this is the formula:
If 0=C0 then 12 must be C1 and so on by 12. What a nightmare!


----------------------------------

Transulator,
I admit it: YOU ARE GENIUS

IT WORKS !!!
I even do not need the "static" preset for my keystrokes as they are in the formula (rule): xx = 12 + gt
where gt is set to be the octave and xx - the "changeable" tone and the decimal value 12 is the pitch of the hit tone!

12 is C1, 13 is C#1... 24 is C2, 47 is B3... and so on!

Thank you very much.
God I knew it is so simple!

Sorry... seems I have another problem. I cannot set up the appropriate key UP stroke message to tell - stop the sound (velocity = 0)?!
Any idea how to make the rule (if necessary) for the key UP event?

florian

2009-06-26 10:22:20

For "Up" use exactly the same as for down (use MT's Duplicate Translator function), but in the outgoing action's MIDI message, use 00 as last value (the velocity):
Outgoing: MIDI 90 xx 00

A Note On message with velocity 0 is, by definition, a note off message.

Regards,
Florian

adXok

2009-06-26 11:22:06

florian,
thanks for answering to my prayers above!
:D

Evil genius!

Everithing works GREAT now!

florian

2009-06-26 12:01:11

:lol:

Transulator

2009-06-26 12:27:49

Glad it works now, AdXok. Admittedly I didn't take too much care with several code suggestions which led to further confusion. :oops:

In future there will be more respect to the 'Don't post wrong code'-Rule. :D

adXok

2009-06-26 13:18:59

Gentlemen,
I made it!

I share with you my preset called: adXok 6-6

What "6-6" means?
It is a symetric-asymetric keyboard layout for a PC keyboard (QWERTY). In every row of keystrokes you have 6 tones till the octave repeating. The row above is for the next 6 tones. Now 6+6 = 12 tones (semi-tone intervals) in zig-zag symetric-asymetric movement. Every key has its corresponding musical tone as follows:
- starting with keystroke [A] we have thetone Ti (also called Si or written as B)
- then with keystroke [Z] we have the tone Do (also called Do or written as C)
- then keystroke [S] we have the tone Bu (also called C sharp or D flat and written as C# or Db correspondingly)
- next keystroke [X] and we have the tone Re (also called Re and written as D)

I think you have got the idea. Zig-zag movement between the tones over the PC keyboard ASDFGHJ... and ZXCVBN... rows.

The octave is as follows the spoken sequence or:
- kestroke [W] is octave (twelve tones or twelve semi-tone intervals above kestroke [Z] where lies the tone Do)
- you got the idea for the next zig-zag movement to keystroke [3] :)
- 12345678... and QWERTY... rows are for that zig-zag sequence

Octave shift: Up Arrow (of your PC keyboard) is for octave (twelve tones or twelve semi-tone intervals) up; Down Arrow for Octave Down as you may suggested allready :)
Tone shift: Left Arrow (of your PC keyboard) for one tone (one semi-tone interval) down; Right Arrow for the opposite direction

Everything WORKS perfect!
Every major chord has only two forms!
Every minor chord has only two forms!
Every scale has only two forms!

Every thing has the beutiful symetry-asymetry of the two form!

There's more: major and minor forms are "mirror reflective"!

Thank you for the attention. :)

Where can I have it?
download it here: adXok 6-6.bmtp (right-click and choose "save link as" or so)
[put on bome.com server -- florian]

adXok

2009-06-26 13:56:52

So now I face to a new problem. :)

Lets say I have pressed a key (keystroke down) and simultaneously hit (and release) the button to shift either the octave or the tone. When I release the kyestroke I've been holding down (the tone I've been playing) the tone is still running endlessly (as somehow the simultaneous shift button hit has stoped the keystroke up event)!

Could this be fixed somehow? :)

Now that's a challenge, uh? :mrgreen: Not so big deal but anyway... if you find a clue?

radiumdaa

2010-07-13 07:00:05

adXok wrote: Where can I have it?
download it here: adXok 6-6.bmtp (right-click and choose "save link as" or so)
[put on bome.com server -- florian]
i cant download, can u send again?
thanx