﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>MIDI-record problem, trying MFX to solve. Help me</title><link>http://forum.cakewalk.com/rss-m1627924.ashx</link><description /><copyright>(c) Cakewalk Forums</copyright><ttl>30</ttl><item><title>MIDI-record problem, trying MFX to solve. Help me (blackstrip)</title><description> I have keyboard KB-930 (it is can be by Bravis or Techno trademark, device is single =) ).&lt;br&gt; &lt;br&gt; KB-930 have MIDI output. I use USB MIDI cable with black-box on it with 2 LEDs - red and green (lights when out/in).&lt;br&gt; &lt;br&gt; In live-mode Sonar 7 receive MIDI messages and echoes it to "Microsoft Synthesizer" device. And when I release key - sonar stop sounds.&lt;br&gt; &lt;br&gt; But when I try to record MIDI with Sonar 7 - key release not affected to record stream. And all pushed notes continue playing until record stopped. It is bad.&lt;br&gt; &lt;br&gt; I read articles about it, and setup MIDI-OX software to see what my keyboard sends to PC.&lt;br&gt; &lt;br&gt; For one key&lt;br&gt; Pushed&lt;br&gt;  00000B59   1   1     C0    00    --    1  ---  PC: Acc. Grand Piano - grandpiano instrument in 0 channel&lt;br&gt;  00000B59   1   1     B0    7B    00    1  ---  CC: All Notes Off    - all notes off in 0 channel&lt;br&gt;  00000B59   1   1     90    48    42    1  C  5 Note On              - note Ð¡5 on in 0 channel&lt;br&gt; Release&lt;br&gt;  00000E1F   1   1     B0    7B    00    1  ---  CC: All Notes Off    - all notes off in channel 0, including Ð¡5&lt;br&gt; &lt;br&gt; For two keys:&lt;br&gt; Push first key&lt;br&gt;  00001C38   1   1     C0    00    --    1  ---  PC: Acc. Grand Piano - grandpiano instrument in 0 channel&lt;br&gt;  00001C38   1   1     B0    7B    00    1  ---  CC: All Notes Off    - all notes off in 0 channel&lt;br&gt;  00001C38   1   1     90    4C    33    1  E  5 Note On              - note E5 on in 0 channel&lt;br&gt; Push second key&lt;br&gt;  00001D6F   1   1     C1    00    --    2  ---  PC: Acc. Grand Piano - grandpiano instrument in 1 channel&lt;br&gt;  00001D6F   1   1     B1    7B    00    2  ---  CC: All Notes Off    - all notes off in 1 channel&lt;br&gt;  00001D6F   1   1     91    4D    42    2  F  5 Note On              - note F5 on in 1 channel&lt;br&gt; Release first key&lt;br&gt;  000020B7   1   1     B0    7B    00    1  ---  CC: All Notes Off    - all notes off in 0 channel, including E5&lt;br&gt; Release second key&lt;br&gt;  000021D9   1   1     B1    7B    00    2  ---  CC: All Notes Off    - all notes off in 1 channel, including F5&lt;br&gt; &lt;br&gt; I understand that my midi-keyboard automatically split all pushed keys to channel from 0 to 15 (excluding 10 may be, its for drums). And i see than in ONE moment in ONE channel can be sound only ONE note. And because of it - message "All notes off" in this channel will off only this single note (it is what i need when i release key on keyboard, and it is sended by keyboard to PC).&lt;br&gt; &lt;br&gt; BUT Sonar in Live mode understand this All notes off, but &lt;b&gt;in Record mode - sonar "not seeing" all-notes-off messages&lt;/b&gt;, and because of it Sonar don't break notes, continuing them to end of record.&lt;br&gt; &lt;br&gt; &lt;b&gt;How Can I force Sonar to undersand All-notes-off message in Record mode?&lt;/b&gt;&lt;br&gt; &lt;br&gt; I download DXI SDK and tried to wrote MFX plugin. I think that if I change All-notes-off to single-note-off (previously pushed in that channel) - sonar will understand it.&lt;br&gt; &lt;br&gt; But in MFX plugin - 2 events can be handled:&lt;br&gt; OnInput and OnEvents.&lt;br&gt; &lt;br&gt; In OnInput I can change messages:&lt;br&gt; HRESULT CPlugKb930::OnInput( IMfxDataQueue* pqIn, IMfxDataQueue* pqOut )&lt;br&gt; {&lt;br&gt;    // This gives us a chance to process live MIDI input&lt;br&gt;    int nCount;&lt;br&gt;    if (SUCCEEDED( pqIn-&amp;gt;GetCount( &amp;nCount ) ))&lt;br&gt;    {&lt;br&gt;       for (int ix = 0; ix &amp;lt; nCount; ++ix)&lt;br&gt;       {&lt;br&gt;          MfxData data;&lt;br&gt;          if (SUCCEEDED( pqIn-&amp;gt;GetAt( ix, &amp;data ) ))&lt;br&gt;          {&lt;br&gt;             // Note on (0x90)? - catch this event&lt;br&gt;             BYTE const byKind = data.m_byStatus &amp; 0xF0;&lt;br&gt;             if (0x90 == byKind)&lt;br&gt;             {&lt;br&gt;                //record number of channel with pushed note - data.m_byStatus &amp; 0x0F - from 0 to 15&lt;br&gt;                n_chan[data.m_byStatus &amp; 0x0F]=data.m_byData1;&lt;br&gt;                pqOut-&amp;gt;Add( data ); // send this message&lt;br&gt;             } else if (0xB0 == byKind) { //it is control?&lt;br&gt;                //it is All Notes Off?&lt;br&gt;                if ((data.m_byData1 == 0x7B)&amp;(data.m_byData2 == 0)&amp;(n_chan[data.m_byStatus &amp; 0x0F]!=0)) {//yeah, we change it to disables only single last pushed note&lt;br&gt;                   data.m_byStatus = (0x80|(data.m_byStatus &amp; 0x0F));//message "note off"&lt;br&gt;                   data.m_byData1 = n_chan[data.m_byStatus &amp; 0x0F];//in that recorded channel number&lt;br&gt;                   data.m_byData2 = 0; //volume - zero&lt;br&gt;                   n_chan[data.m_byStatus &amp; 0x0F] = 0;&lt;br&gt;                }&lt;br&gt;                pqOut-&amp;gt;Add( data );//write this message&lt;br&gt;             }&lt;br&gt;             else&lt;br&gt;             {&lt;br&gt; // and write message if it another, not note-on, not all-notes-off&lt;br&gt;                pqOut-&amp;gt;Add( data );&lt;br&gt;             }&lt;br&gt;          }&lt;br&gt;       }&lt;br&gt;    }&lt;br&gt;    return S_OK;&lt;br&gt; }&lt;br&gt; &lt;br&gt; and in OnEvents i simple pass all events to pqOut, not changing.&lt;br&gt; &lt;br&gt; But it not affect to Record mode!! And in LiveInput mode there is no changes when i enable this plugin - because without plugin it is good sound too, and understand Allnotesoff message =)&lt;br&gt; &lt;br&gt; After it i think than OnEvents - is my solve. But in OnEvents i cannot hook Note-Off message, only Duration can be catched with Note-pushing. But i dont understand HOW CAKEWALK CAN KNOW about duration when i ONLY PUSH KEY AND HOLD IT ?&lt;br&gt; &lt;br&gt; And there is one big question - &lt;b&gt;How can I force Cakewalk Sonar to understand All-notes-off messages from my midi-keyboard and to include this messages in Recorded Midi stream?&lt;/b&gt;&lt;br&gt; &lt;br&gt; Help me please. What I need to change in MIDI-stream? Or may be there is simplier way to solve it? May be special flag "Use All-notes-off message" exists in sonar options? &lt;br&gt; &lt;br&gt; Or is it canbe changed in Instruments menu? I try to add 123 controller to all lists - Standart, Roland, Yamaha XG in Controllers sub-note. But it is not solve my problem =(</description><link>http://forum.cakewalk.com/rss-m1627924.ashxFindPost/1627924</link><pubDate>Sun, 08 Feb 2009 03:42:50 GMT</pubDate></item></channel></rss>