Double Variable

37 views
Skip to first unread message

Enrico Pinzaglia

unread,
Dec 12, 2019, 9:21:19 AM12/12/19
to Midi Shape Shifter
It's possible to use both Velocity and Note number as variable in the equation?

Rob

unread,
Dec 12, 2019, 10:55:02 AM12/12/19
to Midi Shape Shifter
Yeah you can use "velocity" and "notenum" as variables instead of "x".

Enrico Pinzaglia

unread,
Dec 13, 2019, 5:08:49 AM12/13/19
to Midi Shape Shifter
Something  wrong. I used the following equation using velocity as input:


So pressing C4 i will not hear any sound but it plays anyway.

Rob

unread,
Dec 13, 2019, 10:01:14 AM12/13/19
to Midi Shape Shifter
Ah, yeah it's a bit confusing because notenum is actually a relative value that goes from 0 to 1. There is a constant called "semitone" that is just equal to 1/127 that you could use. e.g.

if(notenum == 60 * semitone, ignore, input)

Enrico Pinzaglia

unread,
Dec 13, 2019, 4:45:37 PM12/13/19
to Midi Shape Shifter
Ok, now Works. Is the mod operator available in equation parser?

Rob

unread,
Dec 13, 2019, 4:57:05 PM12/13/19
to Midi Shape Shifter
Yeah you can use the mod operator with %. Unfortunately the docs were taken down and are in a pretty unreadable format here https://code.google.com/archive/p/midi-shape-shifter/wikis. But here is a list of the available operators

| **Operator** | **Name** | **Description** | **Example** | **Result** | 
|:-------------|:---------|:----------------|:------------|:-----------|
 
| a + b | Addition | | 1 + 2 | 3 |
 
| a - b | Subtraction | | 3 - 1 | 2 |
 
| a `*` b | Multiplication | | 2 `*` 3 | 6 |
 
| a / b | Division | | 3 / 2 | 1.5 |
 
| a % b | Modulo | Returns the remainder of a/b. | 123 % 10 | 3 |
 
| a or b, a `||` b | Or | Returns 1 if either a or b are non-zero. Returns 0 otherwise. | 3 or 0 | 1 |
 
| a and b, a && b | And | Returns 1 if both a and b are non-zero. Returns 0 otherwise. | 3 and 0 | 0 |
 
| a = b, a == b | Equals | Returns 1 if a equals b. Returns 0 otherwise | 2 == 2 | 1 |
 
| a != b, a <> b | Not Equal | Returns 1 of a is not equal to b. Returns 0 otherwise | 2 != 2 | 0 |
 
| a < b | Less Than | | 2 < 3 | 1 |
 
| a <= b | Less Than or Equal to | | 3 <= 3 | 1 |
 
| a > b | Greater Than | | 2 > 3 | 0 |
 
| a >= b | Greater Than or Equal to | | 3 >= 3 | 1 |
 
| !a, not a | Not | Returns 1 if a is 0. Returns 0 otherwise. | !0 | 1 |
Reply all
Reply to author
Forward
0 new messages