MIDI-OX User Forum (http://www.midiox.com/cgi-bin/yabb/YaBB.pl)
MIDI-OX >> Scripting Questions >> Where to download sample scripts?
(Message started by: krav_magan on Sep 14th, 2014, 8:00pm)

Title: Where to download sample scripts?
Post by krav_magan on Sep 14th, 2014, 8:00pm
I've been editing the sample scripts and I forgot to save the originals as separate files.  Could someone upload the original sample scripts somewhere?  Please!!

Title: Re: Where to download sample scripts?
Post by krav_magan on Sep 14th, 2014, 8:07pm
actually if you could just upload the Breath2NRPN.js file, that would awesome!!

Title: Re: Where to download sample scripts?
Post by krav_magan on Sep 15th, 2014, 10:57am
If anyone could just copy and paste the text inside the file as a comment that would be awesome!

Title: Re: Where to download sample scripts?
Post by krav_magan on Sep 15th, 2014, 11:25am
Here it is if anyone ever needs it (Breath2NRPN.js):

// MIDIOX Test
// Copyright (c) 2000 by Jamie O'Connell
//
// This script is an example of doing JScript with MIDI-OX
// It converts each single Breath controller event into 4 NRPN messages, that
// control filters on Patches (XG instruments).

var mox;
var str, strWrk;
var n, ii, nInst;
var bGo;
var notesOn;
var baseChan;

// Create object
mox = WScript.CreateObject("Midiox.MoxScript.1", "On_");  

n = mox.InstanceCount;

// *** Try out our MIDI Input loop
notesOn  = 0;      // init
baseChan = 0;   // init -- we expect channel 1

mox.DivertMidiInput = 1;
mox.FireMidiInput = 1;
 
WScript.Echo( "Press OK to end MIDI translate Loop" );
 
mox.FireMidiInput = 0;
mox.DivertMidiInput = 0;

str    = null;
strWrk = null;
mox    = null;

// Exit Point
//------------------------------------------

function On_MidiInput( ts, port, stat, dat1, dat2)
{
  // We convert all breath control messages into 4 message NRPNS
  var statraw;

  statraw = stat & 0x0F0;
  if (statraw == 0x0B0 && dat1 == 0x02)
  {
     mox.OutputMidiMsg( -1, stat, 0x63, 0x01 ); // NRPN MSB -- on XG (GS?): Filter cutoff
     mox.OutputMidiMsg( -1, stat, 0x62, 0x20 ); // NRPN LSB
     mox.OutputMidiMsg( -1, stat, 0x06, dat2 ); // DataEntry MSB (value of breath CC)
     mox.OutputMidiMsg( -1, stat, 0x26, 0x00 ); // dataEntry LSB (0 in this case)
  }
  else // other message
  {
     mox.OutputMidiMsg( -1, stat, dat1, dat2 );
  }
}      




MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.