<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Modartt user forum - Record notes to different MIDI channels]]></title>
		<link>https://forum.modartt.com/viewtopic.php?id=12854</link>
		<description><![CDATA[The most recent posts in Record notes to different MIDI channels.]]></description>
		<lastBuildDate>Sat, 13 Dec 2025 23:48:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Record notes to different MIDI channels]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=1005742#p1005742</link>
			<description><![CDATA[<div class="quotebox"><cite>Max8 wrote:</cite><blockquote><p>Hello,<br />I would like to record a piano piece and then use a program to generate sheet music. However, when I record the MIDI, everything is written to one MIDI channel. Is it possible to write the notes to a different MIDI channel above a certain pitch?</p><p>Many thanks in advance,<br />Max</p></blockquote></div><p> Easy way is to use a DAW that runs on your operating system and that supports scripting such as Reaper&nbsp; ( Windows, Mac OS, Linux)&nbsp; or Logic Pro ( Mac OS)&nbsp; &nbsp;<br />Then ask Gemini or ChatGPT or DeepSeek to write your script. </p><p>For instance here is a&nbsp; script in Reaper that does what you want :<br />Create a new action in Reaper (ReaScript)&nbsp; &nbsp;and use Python as the language <br />Copy paste the following code ( here generated by Gemini ) in the action <br />In this case the cut off pitch is C4 , and notes below will be written to channel 1, and notes above to channel 2 <br />Load or Record your midi file&nbsp; in a track , and run the action. That&#039;s it. </p><p>In this example you transform the code after recording and perform the loop on midi events. <br />You could also write a script that works in realtime , intercept the note-on events and depending on the note on pick value assign a midi channel. </p><br /><br /><p>============================================</p><p># SCRIPT: Split MIDI Notes by Pitch and Assign Channels<br /># LANGUAGE: Python<br /># AUTHOR: Gemini (Adapted from Python pretty_midi logic)</p><p>from reaper_python import *<br />import struct</p><p># --- CONFIGURATION ---<br /># MIDI Note Number (0-127). 60 = Middle C (C4).<br />PITCH_CUTOFF = 60</p><p># MIDI Channel assignments (1-16)<br />LOW_NOTES_CHANNEL = 1<br />HIGH_NOTES_CHANNEL = 2<br /># Note: MIDI channel is 0-indexed in the MIDI message (0-15).<br /># So Channel 1 is 0x00, Channel 2 is 0x01, etc.<br />LOW_CHANNEL_BYTE = (LOW_NOTES_CHANNEL - 1)<br />HIGH_CHANNEL_BYTE = (HIGH_NOTES_CHANNEL - 1)<br /># ---------------------</p><p>def main():<br />&nbsp; &nbsp; # 1. Check for selected MIDI item<br />&nbsp; &nbsp; item = RPR_GetSelectedMediaItem(0, 0) # Get the first selected item<br />&nbsp; &nbsp; if not item:<br />&nbsp; &nbsp; &nbsp; &nbsp; RPR_ShowConsoleMsg(&quot;Error: Select a MIDI item first.\n&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; return</p><p>&nbsp; &nbsp; take = RPR_GetActiveTake(item)<br />&nbsp; &nbsp; if not take:<br />&nbsp; &nbsp; &nbsp; &nbsp; RPR_ShowConsoleMsg(&quot;Error: Selected item has no active take.\n&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; return</p><p>&nbsp; &nbsp; # 2. Open MIDI item for editing (required for modification)<br />&nbsp; &nbsp; RPR_MIDI_SetItemTakeChannelMap(take, -1, 0) # Clear channel map to avoid conflicts<br />&nbsp; &nbsp; RPR_MIDI_SetItemTakeChannelMap(take, -1, 0)<br />&nbsp; &nbsp; RPR_MIDI_SetItemTakeChannelMap(take, -1, 0)</p><p>&nbsp; &nbsp; RPR_MIDI_SetItemTakeChannelMap(take, 0, 0)<br />&nbsp; &nbsp; RPR_MIDI_SetItemTakeChannelMap(take, 1, 1)</p><p>&nbsp; &nbsp; # RPR_MIDI_SetItemTakeChannelMap(take, LOW_CHANNEL_BYTE, 0) # Assign Channel 1<br />&nbsp; &nbsp; # RPR_MIDI_SetItemTakeChannelMap(take, HIGH_CHANNEL_BYTE, 1) # Assign Channel 2</p><p>&nbsp; &nbsp; RPR_Undo_BeginBlock2(0) # Start Undo Block</p><p>&nbsp; &nbsp; # 3. Iterate through all MIDI events<br />&nbsp; &nbsp; # index: 0 is the starting index.<br />&nbsp; &nbsp; # We use a loop and increment the index until RPR_MIDI_EnumItemInTake only returns 0<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; # event_idx: the index of the event<br />&nbsp; &nbsp; # is_selected: whether the event is selected<br />&nbsp; &nbsp; # is_muted: whether the event is muted<br />&nbsp; &nbsp; # ppq_pos: position in PPQ (Pulses Per Quarter note)<br />&nbsp; &nbsp; # message: the raw MIDI message bytes<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; event_idx = 0<br />&nbsp; &nbsp; while True:<br />&nbsp; &nbsp; &nbsp; &nbsp; (ret, take, event_idx, is_selected, is_muted, ppq_pos, message) = RPR_MIDI_GetEvt(take, event_idx)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if ret == 0:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # End of events list<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break</p><p>&nbsp; &nbsp; &nbsp; &nbsp; # Check if the message is a Note-On event (Status byte 0x90 to 0x9F)<br />&nbsp; &nbsp; &nbsp; &nbsp; # Note-On message status byte: 0x90 + channel (0-15)<br />&nbsp; &nbsp; &nbsp; &nbsp; # We only care about the first byte&#039;s high nibble (0x9_)<br />&nbsp; &nbsp; &nbsp; &nbsp; status = message[0] &amp; 0xF0<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; # Check if it&#039;s a Note-On event (0x90) and not a Note-Off with velocity 0<br />&nbsp; &nbsp; &nbsp; &nbsp; if status == 0x90 and len(message) &gt;= 3 and message[2] &gt; 0:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Message is: [Status+Channel, Note/Pitch, Velocity]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pitch = message[1]</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if pitch &lt; PITCH_CUTOFF:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Assign to LOW_NOTES_CHANNEL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_status = 0x90 | LOW_CHANNEL_BYTE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Assign to HIGH_NOTES_CHANNEL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_status = 0x90 | HIGH_CHANNEL_BYTE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Create the new message with the modified channel<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_message = struct.pack(&#039;BBB&#039;, new_status, message[1], message[2])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Update the event in the MIDI item<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RPR_MIDI_SetEvt(take, event_idx, is_selected, is_muted, ppq_pos, new_message)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; # Increment index to get the next event<br />&nbsp; &nbsp; &nbsp; &nbsp; event_idx += 1</p><p>&nbsp; &nbsp; # 4. Update and close the MIDI item<br />&nbsp; &nbsp; RPR_MIDI_Sort(take)<br />&nbsp; &nbsp; RPR_UpdateItemInProject(item)<br />&nbsp; &nbsp; RPR_Undo_EndBlock2(0, &quot;Split MIDI Notes by Pitch and Channel&quot;, -1)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; RPR_ShowConsoleMsg(f&quot;\n✅ Successfully split notes in the selected item!&quot;)<br />&nbsp; &nbsp; RPR_ShowConsoleMsg(f&quot;&nbsp; &nbsp;- Cutoff Pitch: {PITCH_CUTOFF}&quot;)<br />&nbsp; &nbsp; RPR_ShowConsoleMsg(f&quot;&nbsp; &nbsp;- Notes &lt; Cutoff assigned to MIDI Channel {LOW_NOTES_CHANNEL}&quot;)<br />&nbsp; &nbsp; RPR_ShowConsoleMsg(f&quot;&nbsp; &nbsp;- Notes &gt;= Cutoff assigned to MIDI Channel {HIGH_NOTES_CHANNEL}&quot;)</p><p>main()</p>]]></description>
			<author><![CDATA[null@example.com (Pianistically)]]></author>
			<pubDate>Sat, 13 Dec 2025 23:48:21 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=1005742#p1005742</guid>
		</item>
		<item>
			<title><![CDATA[Re: Record notes to different MIDI channels]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=1005734#p1005734</link>
			<description><![CDATA[<div class="quotebox"><cite>Max8 wrote:</cite><blockquote><p>Hello,<br />I would like to record a piano piece and then use a program to generate sheet music. However, when I record the MIDI, everything is written to one MIDI channel. Is it possible to write the notes to a different MIDI channel above a certain pitch?</p><p>Many thanks in advance,<br />Max</p></blockquote></div><p>There might be a more effective direction from which to approach this. For example, when I import piano MIDI into <a href="https://www.steinberg.net/dorico/">Dorico</a>, it’s a single MIDI channel; Dorico has the option, on import, either to split staves at a certain pitch or to “guess” where the split should be. (I think the free version can do that, but I’ve been on Pro for quite a while, so I don’t always remember what’s in free and what isn’t.) So I think it would be the program producing the notation that’s best able to separate the piece onto staves, rather than trying to do it in the MIDI.</p><p>That said, Dorico isn’t that good at translating the result to <em>readable</em> sheet music. It gets all the notes, and the pedal ups and downs, but it is too literal about it. It doesn’t know how to notate the <em>sense</em> of the piece.</p><p>If you find a program that can do that, I’d love to hear about it. As it is, I usually find it’s less time consuming to go through measure by measure, playing what I play and then noting that into Dorico, than to try to turn its overly precise translation of MIDI into proper notation.</p>]]></description>
			<author><![CDATA[null@example.com (Coises)]]></author>
			<pubDate>Sat, 13 Dec 2025 22:01:53 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=1005734#p1005734</guid>
		</item>
		<item>
			<title><![CDATA[Re: Record notes to different MIDI channels]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=1005730#p1005730</link>
			<description><![CDATA[<div class="quotebox"><cite>Max8 wrote:</cite><blockquote><p>Is it possible to write the notes to a different MIDI channel above a certain pitch?</p></blockquote></div><p>Any DAW (digital audio workstation) permits copy and paste on a piano roll and from one channel to another.</p><p><strong>MOD</strong>ARTT itself promotes <a href="https://gigperformer.com/"><strong>GIG PERFORMER</strong></a>.&nbsp; Its promotional offer is a 10% price reduction whether you buy <strong>GIG PERFORMER PRO</strong> or <strong>GIG PERFORMER ESSENTIALS</strong>.&nbsp; Either permits MIDI channel routing as you play.&nbsp; </p><p>If you want to get the 10% discount you&#039;ll need to access gigperformer.com, firstly, from the User area and a click onto the &#039;Proceed to website&#039; button, or simply use this <a href="https://gigperformer.com/pianoteq.html.">link</a>.&nbsp; Please be sure to specify whether you&#039;ll want to purchase <strong>GIG PERFORMER PRO</strong> or <strong>GIG PERFORMER ESSENTIALS</strong>.</p><p>People on macOS have <a href="http://www.subtlesoft.square7.net/MidiPipe.html"><strong>MidiPipe</strong></a> that they can use.&nbsp; It&#039;s shareware.</p><p>Additionally, you may want to check into your keyboard if it permits any channel routing.</p><p>Lastly, look over some of the MIDI boxes, hardware interfaces like <a href="https://www.amazon.com/dp/B0DQYD3L7D/ref=sspa_dk_detail_2?pf_rd_p=30062d3d-2c31-47f3-af26-55177a669bb5&amp;pf_rd_r=P1GV8PHVKQSQ0VERAMY1&amp;pd_rd_wg=0Ws9q&amp;pd_rd_w=VUqCk&amp;content-id=amzn1.sym.30062d3d-2c31-47f3-af26-55177a669bb5&amp;pd_rd_r=e66e6896-9680-4888-a6b8-1aa51cd1bdd9&amp;sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM&amp;th=1">CME H2MIDI Pro</a>.</p>]]></description>
			<author><![CDATA[null@example.com (Amen Ptah Ra)]]></author>
			<pubDate>Sat, 13 Dec 2025 21:27:21 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=1005730#p1005730</guid>
		</item>
		<item>
			<title><![CDATA[Re: Record notes to different MIDI channels]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=1005714#p1005714</link>
			<description><![CDATA[<div class="quotebox"><cite>Max8 wrote:</cite><blockquote><p>Hello,<br />I would like to record a piano piece and then use a program to generate sheet music. However, when I record the MIDI, everything is written to one MIDI channel. Is it possible to write the notes to a different MIDI channel above a certain pitch?</p><p>Many thanks in advance,<br />Max</p></blockquote></div><p>Pianoteq&#039;s MIDI recording functionality is a convenient feature, but not a substitute for a more comprehensive MIDI recording environment and tool set. For what you are asking, a DAW and some MIDI filter or transformer capabilities, either included within the DAW or as a plugin or as a standalone MIDI management-and-manipulation app would probably be a better choice. I find the Bome MIDI Translator Pro app very capable and versatile--</p><p>Bome MIDI Translator Pro<br /><a href="https://www.bome.com/products/miditranslator">https://www.bome.com/products/miditranslator</a></p>]]></description>
			<author><![CDATA[null@example.com (Stephen_Doonan)]]></author>
			<pubDate>Sat, 13 Dec 2025 13:11:05 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=1005714#p1005714</guid>
		</item>
		<item>
			<title><![CDATA[Record notes to different MIDI channels]]></title>
			<link>https://forum.modartt.com/viewtopic.php?pid=1005709#p1005709</link>
			<description><![CDATA[<p>Hello,<br />I would like to record a piano piece and then use a program to generate sheet music. However, when I record the MIDI, everything is written to one MIDI channel. Is it possible to write the notes to a different MIDI channel above a certain pitch?</p><p>Many thanks in advance,<br />Max</p>]]></description>
			<author><![CDATA[null@example.com (Max8)]]></author>
			<pubDate>Sat, 13 Dec 2025 12:15:32 +0000</pubDate>
			<guid>https://forum.modartt.com/viewtopic.php?pid=1005709#p1005709</guid>
		</item>
	</channel>
</rss>
