1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Process/generate MIDI before NCB, custom tabs

Discussion in 'Scripting Workshop' started by Reid115, Dec 9, 2021.

  1. Reid115

    Reid115 NI Product Owner

    Messages:
    40
    Is it possible to process/generate incoming MIDI notes before the NCB, but still in the same script? I need each generated note to trigger the NCB independently. For example, say I have a unison button that takes an incoming midi note, ignores it, and generates two new notes with calls to play_note(). This won't work for me because my NCB is structured as follows:
    Code:
    on note
        ignore_event($EVENT_ID)
        while ($looping)
            { huge amount of code }
        end while
    end on
    The two unison notes need to each have their own while loop running at the same time (i.e., two independent NCB calls). Or say I have a MIDI sequencer that plays notes with play_note() -- play_note() doesn't trigger the NCB if it's called in the same script. The only way I can think to deal with this is to do my MIDI stuff in a separate script placed before my main script. This also won't work for me because I want custom tabs like so:

    [​IMG]

    When you have multiple scripts made visible with "make perfview", they show up as separate tabs at the bottom, which I don't want. Is there any trick to hide the tabs at the bottom, and show the first MIDI script when I click on my custom MIDI tab, which was created in the main script? Thanks.
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    If you don't want the script tabs to show up, you just don't use make_perfview in that script slot. You can definitely do what you want like that.
     
  3. Reid115

    Reid115 NI Product Owner

    Messages:
    40
    Yeah but I actually do want to view that MIDI script in the performance view when I click on my custom MIDI tab. But the custom tabs have to be made all in one script.
     
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Sure. So then you use PGS to communicate between script slots.
     
  5. Reid115

    Reid115 NI Product Owner

    Messages:
    40
    Ohh okay, that makes sense. Thanks a bunch.