<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Transposing MIDI Player Based On Incoming Notes]]></title><description><![CDATA[<p dir="auto">So i have just figured out the simple way to have a single key trigger the midi player, however i would like to devote an area of the keybed to the midi loop and have the coinciding note transpose the midi player. Ex. Range Note 0-24 Root =Note 12. Giving the ability to transpose the midi melody up or down one octave.</p>
<p dir="auto">This works fine with corresponding noteoff message to make it stop..i have it at 36 for testing. but want it 0-24 with 12 root and up and down transposing based on the pressed key</p>
<pre><code>function onNoteOn()
{
	if(Message.getNoteNumber() == 36)
    {
        var timeStamp = Message.getTimestamp();
        MIDIPlayer1.play(timeStamp);
        Message.ignoreEvent(true);
    }
}
</code></pre>
<p dir="auto">What do i need to do to achieve this? I would also be connecting a button to enable and disable this processing and behave like a normal keybed</p>
]]></description><link>https://forum.hise.audio/topic/12590/transposing-midi-player-based-on-incoming-notes</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 09:32:56 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/topic/12590.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 May 2025 16:01:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Transposing MIDI Player Based On Incoming Notes on Mon, 05 May 2025 16:38:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.hise.audio/uid/124">@mwplugs</a> ok i figured out a long handed way to achieve this..</p>
<p dir="auto">declaring the midi modules in oninit</p>
<pre><code>const var MIDIPlayer1 = Synth.getMidiPlayer("MIDI Player1"); 
const var Transposer1 = Synth.getMidiProcessor("Transposer1");
</code></pre>
<p dir="auto">then i have to manually add the note range i want to trigger with transpose</p>
<pre><code>function onNoteOn()
{
	if(Message.getNoteNumber() == 36)
    {
        var timeStamp = Message.getTimestamp();
        MIDIPlayer1.play(timeStamp);
        Message.ignoreEvent(true);
        Transposer1.setAttribute(Transposer1.TransposeAmount, -1);
    }
    if(Message.getNoteNumber() == 37)
        {
            var timeStamp = Message.getTimestamp();
            MIDIPlayer1.play(timeStamp);
            Message.ignoreEvent(true);
            Transposer1.setAttribute(Transposer1.TransposeAmount, 1);
        }
}
</code></pre>
<p dir="auto">then the noteoff messages</p>
<pre><code>{
	if(Message.getNoteNumber() == 36)
    {
        var timeStamp = Message.getTimestamp();
        MIDIPlayer1.stop(timeStamp);
        Message.ignoreEvent(true);
    }
    if(Message.getNoteNumber() == 37)
        {
            var timeStamp = Message.getTimestamp();
            MIDIPlayer1.stop(timeStamp);
            Message.ignoreEvent(true);
        }
}
</code></pre>
<p dir="auto">i KNOW there is a much more efficient way to achieve this...however im not good with arrays and indexes. and i wouldnt be mad if someone optimized this code for 0-24 with note 12 root :) but as of now it works lol</p>
]]></description><link>https://forum.hise.audio/post/102708</link><guid isPermaLink="true">https://forum.hise.audio/post/102708</guid><dc:creator><![CDATA[mwplugs]]></dc:creator><pubDate>Mon, 05 May 2025 16:38:34 GMT</pubDate></item></channel></rss>