No internet connection
  1. Home
  2. How to

Soundflow / IAC driver

By Frank Ilfman @Frank_Ilfman3
    2021-04-29 11:01:39.619Z

    Hi,
    I know SF created its own Midi ports, but it seems on Cubase/mac it keeps forgetting them every time, even after a save or an import when using faders or any other to send midi on a surface touch screen as the like of CC controllers, so my faders dont work unless I redo the ports every time, but it Cubase doesn't forget the IAC port, so can SF midi be assigned to an IAC driver port?

    Solved in post #17, click to view
    • 17 replies
    1. Hi Frank,

      Thanks for posting here :)
      @JesperA and I have tried to fix this numerous times, but I never was able to figure out why Cubase keeps resetting it. It has something to do with a unique ID that I wasn't able to fully understand.
      Jesper - you're routing through iAC right?

      1. Hey.

        Yes correct. For things going to the studio setup such as generic remote I’m using IAC.

        1. FFrank Ilfman @Frank_Ilfman3
            2021-04-29 11:31:16.092Z

            I have create SF IAC in and out and that in the Generic Remote so Cubase doesn't forget that, but i can't get my Fader to work when the IAC is selected only the SF own midi port?

            1. Can you explain your setup?
              Is it surface faders?
              If so, then you need to select the fader to send to an external midi port.
              I’m not in front of a computer so can’t remember if you can do that it the surface editor. Else you would just need to trigger a script from the fader that routes the fader to that channel. I can help with that maybe later when I have a computer in front of me

        2. F
          In reply toFrank_Ilfman3:
          Frank Ilfman @Frank_Ilfman3
            2021-04-29 13:03:34.243Z

            Sure,

            So i create an IAC port named SF - Midi Out and SF - Midi In
            I have a generic remote setup with say click vol on midi CC 20 and sustain on 64
            on the surface editor i can't select the midi port only the SF command to send a CC and
            the channel number

            So those only work if i have the SF midi port selected in the generic remote not the IAC, but then cubase don't remember those as they have a different ID

            1. Ah gotcha. You may need to set up a script to handle the fader value events (when moving a fader) - such a script has access to send to any MIDI output / input (iAC included)

              To do that, create a script with code like this and assign it to the fader's On Value Command:

              const value = Number(event.trigger.value); //This will have the value of the fader
              
              sf.midi.sendCC({
                  externalMidiPort: 'name of the iac port',
                  midiChannel: 1,
                  midiCC: 11, //expression
                  value: value,
              });
              
              1. FFrank Ilfman @Frank_Ilfman3
                  2021-04-29 21:17:36.345Z

                  is this correct ? as it doesnt seem to work

                  1. Yea that looks correct. Have you assigned the script to the fader?

                    1. FFrank Ilfman @Frank_Ilfman3
                        2021-04-30 13:04:51.033Z

                        yes, its not working

                        1. Can you add a log(value) to the script to verify it's receiving values?

                          1. Ah, there was a couple of mistakes in the script. This works for me:

                            const value = Number(event.arguments.value); //This will have the value of the fader
                            
                            sf.midi.sendCC({
                                externalMidiPort: 'IAC Driver Bus 1',
                                outputNum: 0,
                                midiChannel: 1,
                                midiCC: 11, //expression
                                value: value,
                            });
                            
                            
                            1. FFrank Ilfman @Frank_Ilfman3
                                2021-05-02 16:47:27.627Z

                                Great stuff! work well now, for my next question
                                once i touch the fader and move it it takes focus from the main app window, i added a triger to keep the main window active
                                but i then i get those errors :
                                "02.05.2021 17:39:10.94 [Backend]: !! Command Error: Ilfman - Midi IAC Driver CC-64 Sustain [user:ckn5xnxw60003u5100t5dgi0k:cko7chzw000001u10liqibam1]:
                                TypeError: Cannot read property 'value' of null
                                (Ilfman - Midi IAC Driver CC-64 Sustain line 1)

                                JavaScript error with InnerException: null
                                !! Command Error: Ilfman - Midi IAC Driver CC-20 Click Vol Script [user:ckn5xnxw60003u5100t5dgi0k:cko3b28a50000tc10mie0ldck]:
                                TypeError: Cannot read property 'value' of null
                                (Ilfman - Midi IAC Driver CC-20 Click Vol Script line 1)

                                when i disable the active window its well but i lose the focus nd need to mouse click on the main window

                                "

                                1. Hi Frank,

                                  You can't just add another trigger to this script to change the focus of an app. The script I used here can only be used as the "On Value Changed Command" of a fader.

                                  Are you using SoundFlow on a touch screen and not an iPad? If so, what you'd want to do is add a new script for the "On Touch End Command" on the fader, so that once the touch ends, you can run a script to send focus back to Cubase.

                                  1. FFrank Ilfman @Frank_Ilfman3
                                      2021-05-03 13:39:27.524Z

                                      Hey Christian,

                                      Yes i am using a touch screen with my mac.

                                      What is the script i would need ?

                                      1. To focus Cubase, just use a script like this:

                                        sf.ui.cubase.appActivateMainWindow();
                                        

                                        and assign it to the On Touch End Command in the fader.

                                        ReplySolution
                                        1. FFrank Ilfman @Frank_Ilfman3
                                            2021-05-03 14:01:23.072Z

                                            Perfect.

                                  2. In reply tochrscheuer:
                                    FFrank Ilfman @Frank_Ilfman3
                                      2021-05-01 20:05:39.274Z

                                      Not sure where ?

                                      but I've seen you posted a new script, ill be in the studio tomorrow and give it a go
                                      do i need still to add any value?