MIDI/Peer control value fields use a text based system to determine their output values. It's worth reading this bit.
In general, modes can't be mixed but modifiers can. The order that modifiers are specified does not dictate the order in which they are processed.
For MIDI Events, the order of processing is Value > AND > OR > Bounds. For Peer Events, the order is: Value > Bounds > AND > OR. This is because AND destroys negative values, breaking the Peer clamp/wrap/ping-pong functions.
Magic 1.16 expands and improves the system but old files will still work the same. When loading older songs, Magic 1.16 will replace some occurences of % with the new %% token to preserve the correct behaviour.
Also, Magic no longer tries to block input which doesn't make sense. Invalid values are now shown in red text, making it obvious when something is wrong.
Mode | Token | Description |
Space | You can now have spaces pretty much anywhere you like in a value and Magic will generally ignore them. | |
No mode | N | Specifies that no value will be sent. Cannot be used in conjunction with any other modes. |
Velocity mode | V | Specifies that the value should be derived from the velocity used to trigger the event. Can be used in conjunction with relative modes. See value range and bounds below. |
Inverse Velocity mode | VI or IV | Same as velocity mode but values are inverted so that a low velocity is treated as high and vice-versa. |
Random mode | R | Generates a random value. Can be used in conjunction with both relative and range modes. 'R' will send the same random value to all tracks/channels. See below for examples and also Notes for more info on randomness. |
Multi-Random mode | M or RM | Same as Random mode but sends a different random value to each track/channel. |
Value bounds modifier | : | Specifies that values should be constrained to within a given range. Can be used in two forms :20 (range is x-20 where x is the minimum value of the parameter) or :10-20 (range is 10-20). Values outside the range will be clamped to the low/high end of the range as appropriate. All value types are valid. |
Bitwise AND modifier | & | Can be used in conjunction with relative, random and velocity modes. Applies a bitwise AND mask to the value. Mask values are always in hexadecimal format. For example, the value R&0F will result in the mask 0x0F being applied to a randomly generated value. For more information on bitwise operations see wikipedia.org. If both AND and OR are present, AND is applied first. |
Bitwise OR modifier | | | Can be used in conjunction with relative, random and velocity modes. Applies a bitwise OR mask to the value. Mask values are always in hexadecimal format. For example, the value R|0100 will result in the mask 0x0100 being applied to a randomly generated value. For more information on bitwise operations see wikipedia.org. If both AND and OR are present, AND is applied first. |
Peer Only | ||
Previous mode (Restore value) | P | Only available for Off values. Causes the parameter to be restored to the value it had before the Event was triggered. Cannot be used in conjunction with any other modes. Not available for parameters which are only visible in the pattern editor. |
Relative Add switch | + | Causes the value to be added to the parameter's current value until it reaches the upper limit of the current range. Cannot follow the bounds definition. Not available for parameters which are only visible in the pattern editor. |
Relative Subtract switch | - | Causes the value to be subtracted from the parameter's current value until it reaches the lower limit of the current range. Cannot follow the bounds definition. Not available for parameters which are only visible in the pattern editor. |
Relative Wrap switch | w or w! |
Used with the relative modes. Specifies that when the upper/lower boundary of the value range is reached, the value sequence will be resumed at the opposite end of the range. For example a value of +1w for a parameter with the value range 1-3 will result in the sequence 1, 2, 3, 1, 2, 3, 1 etc. If followed by the ! character, value overshoot will be ignored. If not, overshoot will be included in the modified value. eg. if range is 1-5 a value of 6 overshoots by one, so w will add the overshoot giving 2 while w! will ignore it and give 1. Note that the wrap switch cannot preceed the relative mode symbol. Ping-pong and wrap are mutually exclusive. |
Relative Ping-pong switch | p or p! |
Used with the relative modes. Specifies that when the upper/lower boundary of the value range is reached, the relative mode polarity be reversed. For example a value of +1p for a parameter with the value range 1-3 will result in the sequence 1, 2, 3, 2, 1, 2, 3 etc. If followed by the ! character, value overshoot will be ignored. If not, overshoot will be included in the modified value. eg. if range is 1-5 a value of 6 overshoots by one, so p will subtract the overshoot giving 4 while p! will ignore it and give 5. Note that the ping-pong switch cannot preceed the relative mode symbol. Ping-pong and wrap are mutually exclusive. |
These tokens control how Magic interprets values. When a value type specifier is found, all following values are assumed to be of the same type until another type specifier is found. Note that the Decimal specifier = is assumed (except in bitwise modifiers) until an explicit type specifier is encountered, so = is only needed if you want to revert to decimal after using another type.
Token | Example | Value mode |
= | =127 | Decimal value. Numeric values are assumed to be decimal unless another type specifier has been found, so you only need this if you want to change back. |
x | x7F | Hexadecimal. Hex is assumed for the bitmask values so you can just type &F00 instead of &xF00. |
% | %50 | Percentage of specified value range (see "Value bounds modifier" above.) Decimal fractions are allowed eg. %12.5 |
%% | %%50 | Percentage of full parameter range. Decimal fractions are allowed. |
' | 'C5 |
Note name. Valid note values are C0 to B9 or "Pass" which will use the note which triggered the Event. If no octave is specified, the default is 4.
Note values can be used for non-note parameters too (see below for an example.) |
Starting in Magic 1.16 there are two kinds of range. The old range specifier : is used to restrict output to a certain range of values, referred to as the "bounds", which is pretty much what it did before. The new feature is that the Random and Velocity modes can now specify their own ranges, which are then used in conjuction with the bounds to generate values, which gives you more control over the kind of output values generated.
Some examples might help to clarify things a bit...
Example | Explanation |
R10 or R(10) | Generate a random value from x-10 where x is the minimum value for the target parameter. You can enclose the range in () if you want but it's optional so I won't use it again. |
R10-20 | Generate a random value from 10-20. R followed by a value range will generate numbers from within that range. |
R:10-20 | Generate a random value from 10-20. Although the result is the same as above, the method is different. Here R doesn't have its own range so it uses the full range of the value bounds, 10-20. |
R%10:50-100 | Generate a random value from ten percent of the specified range. The range is interpreted as 50%-100% because the percentage specifier was used previously, so if the target parameter range was 0-1000, output values would be 500-550. |
R%%100:40-60 | Generate a random value from the full parameter range and clamp the result to 40-60 percent of the range. This will tend to produce more values at the boundary edges. If the target parameter range was 0-1000, output values would be from 400-600. |
V%50 | Map incoming velocity to fifty percent of the full parameter range. Velocity 1 will be the parameter minimum and velocity 127 will be the parameter maximum. |
V%50:=50-80 | Map incoming velocity to fifty percent of the range 50-80. Minimum velocity will give 50, maximum velocity will give 65. |
+V%10p:20-70 | Map incoming velocity to ten percent of the range %20-70, add it to the current value and ping-pong if necessary. Minimum velocity will add 0%, maximum velocity will add 5%. Or something like that. Probably. |
R'C4-B6 |
Generate a random note value from C4-B6. Note parameters will simply output the note as you would expect but non-note parameters have more complex behaviour. Imagine a piano keyboard C0-B9 overlaid on the value bounds (the whole parameter range in this example.) The output values will be in the range C4-B6 on that keyboard. |
V'C4-B6 | Map the incoming velocity to the note range C4-B6. Note parameters will play the note, non-note parameters will interpret the value as described above. |
+5:%50-80 | Add five to the current value, clamping the result to within 50-80% of the parameter range. Without the ping-pong (p) or wrap (w) switches, the value will peak at 80% and stay there. |
+5:%50-80w | Add five to the current value. If the result is greater than 80% of the parameter range, wrap back to 50% and add the overshoot amount. |
+5:%50-80w! | Add five to the current value. If the result is greater than 80% of the parameter range, wrap back to 50%. |
+R%1:50-100 | Generate a random value from 0% to 1% of the bounds (0% to 0.5% of the full range in this case) and add it to the current value. When the value reaches 100% it will stay there. |
+R%%1:50-100 | Generate a random value from 0% to 1% of the full parameter range and add it to the current value. |