User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - Where to download sample scripts? »
Welcome, Guest. Please Login or Register.
Sep 14th, 2024, 11:39pm


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI-OX
   Scripting Questions
(Moderator: Jamie OConnell)
   Where to download sample scripts?
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Where to download sample scripts?  (Read 2736 times)
krav_magan
Member
**



The Mox Script Master

   


Gender: male
Posts: 46
Where to download sample scripts?
« on: Sep 14th, 2014, 8:00pm »
Quote Quote Modify Modify

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!!
IP Logged
krav_magan
Member
**



The Mox Script Master

   


Gender: male
Posts: 46
Re: Where to download sample scripts?
« Reply #1 on: Sep 14th, 2014, 8:07pm »
Quote Quote Modify Modify

actually if you could just upload the Breath2NRPN.js file, that would awesome!!
IP Logged
krav_magan
Member
**



The Mox Script Master

   


Gender: male
Posts: 46
Re: Where to download sample scripts?
« Reply #2 on: Sep 15th, 2014, 10:57am »
Quote Quote Modify Modify

If anyone could just copy and paste the text inside the file as a comment that would be awesome!
« Last Edit: Sep 15th, 2014, 11:00am by krav_magan » IP Logged
krav_magan
Member
**



The Mox Script Master

   


Gender: male
Posts: 46
Re: Where to download sample scripts?
« Reply #3 on: Sep 15th, 2014, 11:25am »
Quote Quote Modify Modify

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 );
   }
}  
 
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


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