Pangoscript not running in the background (v546)

Discussion in 'PangoScript, Universe and Midi Templates' started by Koja, May 25, 2013.

  1. Koja

    Koja Beta Tester

    I have been using some Pangoscript in cues before, but this time I wanted it to run in the background.

    I have a simple script that translates MIDI-CCs into channels that I want to use to modify the size/effects of shapes later on.

    I put my script (as a loop with a WaitForMidi line) in the MIDI-Settings of the right interface as a "Background script" and configured a shape to react on a channel. This works fine when the cue with the shape is running, I open the script and lick "run", but as soon as I close the Pangoscript editor, it stops working. Shouldn't this be runnign in the background?

    I am using beyond build 546 on Windows XP. Running without hardware connected at the moment, but that shouldn't make a difference?!

    Btw: The reason why I try to have a script running in the background instead of using The MIDI to PangoScript settings in the Main tab is, that I wand to have global variables and save the old value of channels and do calculations with them...

    Any ideas?

    Thanks
    Jan
     
    Last edited: May 25, 2013
  2. Koja

    Koja Beta Tester

    Bob,
    thanks for the help. Now it works as expected. But I wonder, shouldn't it be working in the midi scripting engine, too? Escpecially when I want to handle midi messages coming from different controllers in a different way?
    Jan
     
  3. without an script, and an little bit more explanation of the function, I can't tell if it should.

    depends of lots of factors.

    The midi background area is meant for scripts that are really needed for feedback, checks and such..

    You can do more in it, but you need to initialize the script.

    The script becomes unavailable when there is no midi controller connected.
    This background script is saved in the midi preference plane.
     
  4. Koja

    Koja Beta Tester

    my inital testing script is simple:
    Code:
    var x;
    var y;
    
    loop:
    WaitForMidi -1, -1, -1
    x=CC(0,1,0,127);
    y=CC(0,2,0,127);
    ChannelOut 1, x*5;
    ChannelOut 2, y*5;
    goto loop;
    
    this is supposed to become more complex, i.e. calculate average values of the last N values for X and stuff like that. But I just discovered that my initial approach to have this seperate for the different MIDI inputs is not really necessary.
    I think the documentation is hard to read, how can I get my hands on the documentation of Pangoscript that is shown in the Pangoscript editor? I can't find a file in the Beyond-Folder, is this compiled into Beyond.exe? I'd like to be able to open this in a separate screen or print some pages and such... simply being able to do a fulltext-search on it would be helpful (which I could do if I only were able to open the documentation in some other text editor )
     
  5. The midi background script is meant for the midi device it self.

    For example if you have an continues script running that provides light codes for the console.

    ..

    but did you do:?

    Code:
    CodeName "myscript"
    var x;
    var y;
    
    WaitForMidi -1, -1, -1
    x=CC(0,1,0,127);
    y=CC(0,2,0,127);
    ChannelOut 1, x*5;
    ChannelOut 2, y*5;
    StartCode "Myscipt"
    and did you initialize the script from from initialization with ?

    Code:
    StartCode "Myscript"
     

Share This Page