Tuning RPNs: Difference between revisions
Wikispaces>TallKite **Imported revision 450724288 - Original comment: ** |
Wikispaces>TallKite **Imported revision 450745434 - Original comment: ** |
||
| Line 1: | Line 1: | ||
<h2>IMPORTED REVISION FROM WIKISPACES</h2> | <h2>IMPORTED REVISION FROM WIKISPACES</h2> | ||
This is an imported revision from Wikispaces. The revision metadata is included below for reference:<br> | This is an imported revision from Wikispaces. The revision metadata is included below for reference:<br> | ||
: This revision was by author [[User:TallKite|TallKite]] and made on <tt>2013-09-12 | : This revision was by author [[User:TallKite|TallKite]] and made on <tt>2013-09-12 20:39:51 UTC</tt>.<br> | ||
: The original revision id was <tt> | : The original revision id was <tt>450745434</tt>.<br> | ||
: The revision comment was: <tt></tt><br> | : The revision comment was: <tt></tt><br> | ||
The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.<br> | The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.<br> | ||
| Line 16: | Line 16: | ||
A couple of us came up with a specific method, and we'd like your input. The original discussion is in this XA facebook megathread: https://www.facebook.com/groups/xenharmonic2/621829327837373/?notif_t=group_comment_reply The main contributors were Robert Walker, Kite Giedraitis, Rob Fielding, and Graham Breed. | A couple of us came up with a specific method, and we'd like your input. The original discussion is in this XA facebook megathread: https://www.facebook.com/groups/xenharmonic2/621829327837373/?notif_t=group_comment_reply The main contributors were Robert Walker, Kite Giedraitis, Rob Fielding, and Graham Breed. | ||
The new method uses | The new method uses RPNs (Registered Parameter Numbers). The technical details: There are about 16,000 possible RPN parameters, and only about a dozen are in use. We can use a block of 128 RPNs, one for each note number, for retuning. Data MSB and LSB messages for these RPNs contain the cents to retune by, in the exact same format as the standard midi pitch bend message. The retuning is immediate (real-time), just like the standard pitch bend. This makes it easier for the synth author, because he has already written code that deals with physical pitch bend wheel movement, and can just reuse it to deal with tuning RPNs. We use either a data increment or a data decrement message to transpose the input note by so many semitones, allowing for non-12-note tunings. If the RPN MSB is 100 = 64 hexadecimal, then to bend note nn on channel c to note mm with bend of yyzz would take up to 5 midi CC (Controller Change) messages. In hexadecimal the midi looks like this: | ||
RPN MSB: | RPN MSB: Bc 65 64 (start retuning, B means CC message, 65 means set RPN parameter MSB) | ||
RPN LSB: | RPN LSB: Bc 64 nn (note to retune, 64 means set RPN parameter LSB) | ||
data inc: | data inc: Bc 60 mm-nn _OR_ data dec: Bp 61 nn-mm (transpose up/down, optional) | ||
data MSB: | data MSB: Bc 06 yy (coarse tune, optional) | ||
data LSB: | data LSB: Bc 26 zz (fine tune, required) | ||
These messages are always sent in this order. The RPN MSB message need only be sent once (NRPN exception below). The CC/channel byte for the other 4 messages can sometimes be omitted via running status. The RPN LSB message need only be sent once per note. As per the midi spec, aditional data MSB/LSB messages continue to affect the current RPN parameter, overwriting previous data messages. Unlike the midi spec, data inc/dec messages are not summed, instead the newest one overwrites any older ones. Thus inc = 3 followed by inc = 5 results in inc = not 8 but 5. And data MSB/LSB values are not affected by inc/dec. This is because the highest priority in designing this new method is to make the coding as easy as possible for the synth author. By overwriting instead of summing, he doesn't have to maintain an array of current transpositions for all notes on all channels. Similarly, it's the tuning software author's responsibility to avoid transposing out of range. Thus nn + inc must always be <= 127 and nn - dec must always be >= 0. | These messages are always sent in this order. The RPN MSB message need only be sent once (NRPN exception below). The CC/channel byte for the other 4 messages can sometimes be omitted via running status. The RPN LSB message need only be sent once per note. As per the midi spec, aditional data MSB/LSB messages continue to affect the current RPN parameter, overwriting previous data messages. Unlike the midi spec, data inc/dec messages are not summed, instead the newest one overwrites any older ones. Thus inc = 3 followed by inc = 5 results in inc = not 8 but 5. And data MSB/LSB values are not affected by inc/dec. This is because the highest priority in designing this new method is to make the coding as easy as possible for the synth author. By overwriting instead of summing, he doesn't have to maintain an array of current transpositions for all notes on all channels. Similarly, it's the tuning software author's responsibility to avoid transposing out of range. Thus nn + inc must always be <= 127 and nn - dec must always be >= 0. | ||
| Line 30: | Line 30: | ||
A possible conflict arises with NRPNs, which use the same data inc/dec/MSB/LSB messages. The solution is for the tuning software to monitor the midi stream for NRPNs, and if found, take these steps: Remember the current NRPN parameter number, not omit the RPN MSB and LSB when retuning, and send a NRPN MSB/LSB message after retuning to restore the current NRPN parameter. Similar steps should be taken if one of the few RPNs already defined are encountered. | A possible conflict arises with NRPNs, which use the same data inc/dec/MSB/LSB messages. The solution is for the tuning software to monitor the midi stream for NRPNs, and if found, take these steps: Remember the current NRPN parameter number, not omit the RPN MSB and LSB when retuning, and send a NRPN MSB/LSB message after retuning to restore the current NRPN parameter. Similar steps should be taken if one of the few RPNs already defined are encountered. | ||
An additional RPN of 101, 0 is for resetting the tuning of all notes. On receiving this RPN, the synth should reset all notes back to standard tuning. The data MSB/LSB/inc/dec messages are not needed: | An additional RPN of 101, 0 is for resetting the tuning of all notes. On receiving this RPN, the synth should reset all notes on that channel back to standard tuning. The data MSB/LSB/inc/dec messages are not needed. To reset all notes on channel c: | ||
RPN MSB: | RPN MSB: Bc 65 65 (note reset RPN) | ||
RPN LSB: | RPN LSB: Bc 64 0 | ||
A few recommended practices for synths: | A few recommended practices for synths: | ||
| Line 42: | Line 42: | ||
---- | ---- | ||
Questions: | |||
Any thoughts about just which blocks of RPNs to use? | |||
Does anyone know of any RPN parameters actually in use other than the following? | |||
RPN 0,0 pitch bend range | |||
RPN 0,1 channel fine tuning | |||
RPN 0,2 channel coarse tuning | |||
RPN 0,3 tuning program change | |||
RPN 0,4 tuning bank select | |||
RPN 0,5 modulation depth range | |||
RPN 61,0 to 61,8 three dimensional sound controllers | |||
RPN 111 used by Fractal Tune Smithy | |||
RPN 127,127 null parameter (disables all 4 data entry commands) | |||
RPN MSB: | Any thoughts on this possible extension? | ||
RPN LSB: | An additional RPN block. MSB = 102, would reset the pitch of a single note. The RPN LSB specifies the note. The data MSB/LSB/inc/dec messages are not needed. To reset note nn on channel c: | ||
RPN MSB: Bc 65 66 (note reset RPN) | |||
RPN LSB: Bc 64 nn (note to reset)</pre></div> | |||
<h4>Original HTML content:</h4> | <h4>Original HTML content:</h4> | ||
<div style="width:100%; max-height:400pt; overflow:auto; background-color:#f8f9fa; border: 1px solid #eaecf0; padding:0em"><pre style="margin:0px;border:none;background:none;word-wrap:break-word;width:200%;white-space: pre-wrap ! important" class="old-revision-html"><html><head><title>Tuning RPNs</title></head><body>An open letter to tuning software authors:<br /> | <div style="width:100%; max-height:400pt; overflow:auto; background-color:#f8f9fa; border: 1px solid #eaecf0; padding:0em"><pre style="margin:0px;border:none;background:none;word-wrap:break-word;width:200%;white-space: pre-wrap ! important" class="old-revision-html"><html><head><title>Tuning RPNs</title></head><body>An open letter to tuning software authors:<br /> | ||
| Line 58: | Line 71: | ||
So it would be great if there was a simpler, non-sysex way of tuning individual notes. A few of us have cooked up a daring plan. The powers that be will probably never give us what we want, so we'll just *take* it! We can commandeer an obscure and underused part of the midi spec and use it for our own microtonal purposes. We can simply create a new microtuning method. By &quot;we&quot; I mean the authors of midi tuning software. If we all include this new method in alt-tuner, Fractal Tune Smithy, Custom Scale Editor, Scala, LMSO, etc. we will have a more enticing sales pitch for synth authors: Add this simple easy method of retuning and you will sell more synths to microtonalists.<br /> | So it would be great if there was a simpler, non-sysex way of tuning individual notes. A few of us have cooked up a daring plan. The powers that be will probably never give us what we want, so we'll just *take* it! We can commandeer an obscure and underused part of the midi spec and use it for our own microtonal purposes. We can simply create a new microtuning method. By &quot;we&quot; I mean the authors of midi tuning software. If we all include this new method in alt-tuner, Fractal Tune Smithy, Custom Scale Editor, Scala, LMSO, etc. we will have a more enticing sales pitch for synth authors: Add this simple easy method of retuning and you will sell more synths to microtonalists.<br /> | ||
<br /> | <br /> | ||
A couple of us came up with a specific method, and we'd like your input. The original discussion is in this XA facebook megathread: <!-- ws:start:WikiTextUrlRule: | A couple of us came up with a specific method, and we'd like your input. The original discussion is in this XA facebook megathread: <!-- ws:start:WikiTextUrlRule:55:https://www.facebook.com/groups/xenharmonic2/621829327837373/?notif_t=group_comment_reply --><a class="wiki_link_ext" href="https://www.facebook.com/groups/xenharmonic2/621829327837373/?notif_t=group_comment_reply" rel="nofollow">https://www.facebook.com/groups/xenharmonic2/621829327837373/?notif_t=group_comment_reply</a><!-- ws:end:WikiTextUrlRule:55 --> The main contributors were Robert Walker, Kite Giedraitis, Rob Fielding, and Graham Breed.<br /> | ||
<br /> | <br /> | ||
The new method uses | The new method uses RPNs (Registered Parameter Numbers). The technical details: There are about 16,000 possible RPN parameters, and only about a dozen are in use. We can use a block of 128 RPNs, one for each note number, for retuning. Data MSB and LSB messages for these RPNs contain the cents to retune by, in the exact same format as the standard midi pitch bend message. The retuning is immediate (real-time), just like the standard pitch bend. This makes it easier for the synth author, because he has already written code that deals with physical pitch bend wheel movement, and can just reuse it to deal with tuning RPNs. We use either a data increment or a data decrement message to transpose the input note by so many semitones, allowing for non-12-note tunings. If the RPN MSB is 100 = 64 hexadecimal, then to bend note nn on channel c to note mm with bend of yyzz would take up to 5 midi CC (Controller Change) messages. In hexadecimal the midi looks like this:<br /> | ||
<br /> | <br /> | ||
RPN MSB: | RPN MSB: Bc 65 64 (start retuning, B means CC message, 65 means set RPN parameter MSB)<br /> | ||
RPN LSB: | RPN LSB: Bc 64 nn (note to retune, 64 means set RPN parameter LSB)<br /> | ||
data inc: | data inc: Bc 60 mm-nn _OR_ data dec: Bp 61 nn-mm (transpose up/down, optional)<br /> | ||
data MSB: | data MSB: Bc 06 yy (coarse tune, optional)<br /> | ||
data LSB: | data LSB: Bc 26 zz (fine tune, required)<br /> | ||
<br /> | <br /> | ||
These messages are always sent in this order. The RPN MSB message need only be sent once (NRPN exception below). The CC/channel byte for the other 4 messages can sometimes be omitted via running status. The RPN LSB message need only be sent once per note. As per the midi spec, aditional data MSB/LSB messages continue to affect the current RPN parameter, overwriting previous data messages. Unlike the midi spec, data inc/dec messages are not summed, instead the newest one overwrites any older ones. Thus inc = 3 followed by inc = 5 results in inc = not 8 but 5. And data MSB/LSB values are not affected by inc/dec. This is because the highest priority in designing this new method is to make the coding as easy as possible for the synth author. By overwriting instead of summing, he doesn't have to maintain an array of current transpositions for all notes on all channels. Similarly, it's the tuning software author's responsibility to avoid transposing out of range. Thus nn + inc must always be &lt;= 127 and nn - dec must always be &gt;= 0.<br /> | These messages are always sent in this order. The RPN MSB message need only be sent once (NRPN exception below). The CC/channel byte for the other 4 messages can sometimes be omitted via running status. The RPN LSB message need only be sent once per note. As per the midi spec, aditional data MSB/LSB messages continue to affect the current RPN parameter, overwriting previous data messages. Unlike the midi spec, data inc/dec messages are not summed, instead the newest one overwrites any older ones. Thus inc = 3 followed by inc = 5 results in inc = not 8 but 5. And data MSB/LSB values are not affected by inc/dec. This is because the highest priority in designing this new method is to make the coding as easy as possible for the synth author. By overwriting instead of summing, he doesn't have to maintain an array of current transpositions for all notes on all channels. Similarly, it's the tuning software author's responsibility to avoid transposing out of range. Thus nn + inc must always be &lt;= 127 and nn - dec must always be &gt;= 0.<br /> | ||
| Line 74: | Line 87: | ||
A possible conflict arises with NRPNs, which use the same data inc/dec/MSB/LSB messages. The solution is for the tuning software to monitor the midi stream for NRPNs, and if found, take these steps: Remember the current NRPN parameter number, not omit the RPN MSB and LSB when retuning, and send a NRPN MSB/LSB message after retuning to restore the current NRPN parameter. Similar steps should be taken if one of the few RPNs already defined are encountered.<br /> | A possible conflict arises with NRPNs, which use the same data inc/dec/MSB/LSB messages. The solution is for the tuning software to monitor the midi stream for NRPNs, and if found, take these steps: Remember the current NRPN parameter number, not omit the RPN MSB and LSB when retuning, and send a NRPN MSB/LSB message after retuning to restore the current NRPN parameter. Similar steps should be taken if one of the few RPNs already defined are encountered.<br /> | ||
<br /> | <br /> | ||
An additional RPN of 101, 0 is for resetting the tuning of all notes. On receiving this RPN, the synth should reset all notes back to standard tuning. The data MSB/LSB/inc/dec messages are not needed:<br /> | An additional RPN of 101, 0 is for resetting the tuning of all notes. On receiving this RPN, the synth should reset all notes on that channel back to standard tuning. The data MSB/LSB/inc/dec messages are not needed. To reset all notes on channel c:<br /> | ||
<br /> | <br /> | ||
RPN MSB: | RPN MSB: Bc 65 65 (note reset RPN)<br /> | ||
RPN LSB: | RPN LSB: Bc 64 0<br /> | ||
<br /> | <br /> | ||
A few recommended practices for synths:<br /> | A few recommended practices for synths:<br /> | ||
| Line 86: | Line 99: | ||
<br /> | <br /> | ||
<hr /> | <hr /> | ||
Questions:<br /> | |||
<br /> | |||
Any thoughts about just which blocks of RPNs to use?<br /> | |||
<br /> | <br /> | ||
Does anyone know of any RPN parameters actually in use other than the following?<br /> | |||
RPN 0,0 pitch bend range<br /> | |||
RPN 0,1 channel fine tuning<br /> | |||
RPN 0,2 channel coarse tuning<br /> | |||
RPN 0,3 tuning program change<br /> | |||
RPN 0,4 tuning bank select<br /> | |||
RPN 0,5 modulation depth range<br /> | |||
RPN 61,0 to 61,8 three dimensional sound controllers<br /> | |||
RPN 111 used by Fractal Tune Smithy<br /> | |||
RPN 127,127 null parameter (disables all 4 data entry commands)<br /> | |||
<br /> | <br /> | ||
An additional RPN block. MSB = 102, would reset the pitch of a single note. The RPN LSB specifies the note. The data MSB/LSB/inc/dec messages are not needed:<br /> | Any thoughts on this possible extension?<br /> | ||
An additional RPN block. MSB = 102, would reset the pitch of a single note. The RPN LSB specifies the note. The data MSB/LSB/inc/dec messages are not needed. To reset note nn on channel c:<br /> | |||
<br /> | <br /> | ||
RPN MSB: | RPN MSB: Bc 65 66 (note reset RPN)<br /> | ||
RPN LSB: | RPN LSB: Bc 64 nn (note to reset)</body></html></pre></div> | ||