Jump to content

virag0

Member
  • Posts

    26
  • Joined

  • Last visited

virag0's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Jordi, thanks for that. I did not see the visual cue until pointed out. Here is an updated version of my script. It shows the patch number along with the patch name, plus improved the MIDI channel setting as it would sometimes change the patch as well. #!/bin/sh IFS=$'\n' midnam=(`sed -n '/<PatchNameList/,/<\/PatchNameList>/p' $1`) echo "programs = [" > $2 for i in "${midnam[@]}" do if [[ ${i} =~ PatchNameList ]] then echo "" else echo $i |awk -F\" '{print "\{" "name: " "\047"$(NF-3)"\047" "\,", "number: " $(NF-1) "\}\," }' >> $2 fi done sed -i '' '$ s/,$//' $2 echo "]; \n" >> $2 # here cat <<EOF >> $2 var programChange = new ProgramChange; var PluginParameters = [{name: 'Program', type: 'menu', defaultValue: 1, valueStrings: programs.map(function(program) { return program.name+'\t\t\t\t\t\t\t\t\t\t\t'+program.number; }) }, {name: "Channel", minValue:1, maxValue:16, defaultValue:1, numberOfSteps:15, type:'lin'}, ]; function ParameterChanged(index, value) { if (index == 0) { programChange.number = programs[value].number; programChange.send(); } if (index == 1) { var chan = GetParameter('Channel'); programChange.channel = chan; } programChange.trace(); } EOF If anyone is using this or wants some minor changes, I will see what I can do, but it would be nice to know if this is helpful to anyone apart from myself.... rachel
  2. Here is the same thing with MIDI Channel setting. This has been tested with all my racksynths now and it works fine. #!/bin/sh IFS=$'\n' midnam=(`sed -n '/<PatchNameList/,/<\/PatchNameList>/p' $1`) echo "programs = [" > $2 for i in "${midnam[@]}" do if [[ ${i} =~ PatchNameList ]] then echo "" else echo $i |awk -F\" '{print "\{" "name: " "\047"$(NF-3)"\047" "\,", "number: " $(NF-1) "\}\," }' >> $2 fi done sed -i '' '$ s/,$//' $2 echo "]; \n" >> $2 # here cat <<EOF >> $2 PluginParameters = [{name: 'Program', type: 'menu', valueStrings: programs.map(function(program) { return program.name; }) }, {name: 'MIDI Channel', minValue:1, maxValue:16, defaultValue:1, numberOfSteps:15, type:'lin'} ]; function ParameterChanged(index, value) { var programChange = new ProgramChange; var channel = GetParameter("MIDI Channel"); programChange.channel = channel; programChange.number = programs[value].number; programChange.send(); // programChange.trace(); } EOF This really useful, at least for me, as Mainstage does not have a method for this, unlike Logic which can display the current patch in the sidebar. It does not seem to demonstrate any CPU overhead with several instances. However, it does use the MIDI slot in the channel strip, so it does not seem they are "stackable". rachel
  3. Hi there, I thought I would ressurect this thread, given that now I am on Mainstage 3.1.1 & the ProgramChange function finally works from Scripter. I have revisited my initial problem which was no way to look at Program Changes in Mainstage with a meaningful name while in Performance mode. It is fine having a default patch number set in the Channel Strip, but it says nothing to someone who wants to know what Patch is is supposed to be playing and then quickly address changing it, at least for a single bank, so I tried to do something about it. Jessy provided the JavaScript Logic to do what I wanted, but it never worked in Mainstage till now, so since I got all excited and interested again, I have since worked on my tiny project a bit more. What I needed now, was a way to use the example Jessy gave me to derive a Patch Change for every bit of gear I want to use in my setup. It seems that the Apple implementation of JavaScript in Logic/Mainstage does not support opening or including a file, so I can't just select the instrument I want to use a patch bank for from a pick list and an array of patch names in a file, so I have instead concoted this ungainly kluge. What it does is takes a MIDNAM XML format document eg exported from a DAW or MIDI Librarian that supports it and extracts the Patch Names & Numbers into a format that is the Javascript array that needs to be loaded by the script. It concatenates this formatted array into a file then appends Jessy's Javascript Program Change script into it, to create a Script specific to a particular synth loaded with a particular bank of patches. This means you generate a unique script for each synth and patch bank you want to control. In my case, a MicroKorg that sits out of reach and a bunch of rack synths I cannot be bothered getting out of my chair to read the LCD on. To use this script select and paste it into a file. It only works as a UNIX shell script so on OSX you need to know how to run Terminal. Paste the script into a file and give it a meaningful name. In my case I keep all my scripts on my Mac in /opt/scripts and I named it "patchscripter.sh" - it's a bash shell script. Once you have created the file, set the permissions to mode 755 using "chmod". Once again you need to be just slightly handy with Terminal as I will not explain here. The script takes two arguments. The first is the input file which MUST be an XML "midnam" file. The second is the name to output the script to. In my case I run it to create the output in /tmp/ then paste that into scripter or copy the file into the scripter presets and load it from there. You will end up with one for each synth/patch bank you run it for so give them different names. Here is the script below, for those who need such a thing and know how to run it: #!/bin/sh # Patchscripter.sh - a shell script to convert patch names to scripter Program Change numbers utility # rachel 20150407 IFS=$'\n' # $1 is the input file, $2 is the output file. You may set a path to the files. # grab the patch names from the XML file midnam=(`sed -n '/<PatchNameList/,/<\/PatchNameList>/p' $1`) # convert the Patch Names to a Javascript format array echo "programs = [" > $2 for i in "${midnam[@]}" do if [[ ${i} =~ PatchNameList ]] then echo "" else echo $i |awk -F\" '{print "\{" "name: " "\047"$(NF-3)"\047" "\,", "number: " $(NF-1) "\}\," }' >> $2 fi done sed -i '' '$ s/,$//' $2 echo "]; \n" >> $2 # here document - Javascript follows cat <<EOF >> $2 PluginParameters = [{name: 'Program', type: 'menu', valueStrings: programs.map(function(program) { return program.name; }) }]; function ParameterChanged(index, value) { var programChange = new ProgramChange; programChange.number = programs[value].number; programChange.send(); } EOF # a program change script is created I will update this version with a picklist for the MIDI channel - Scripter ignores the channel strip's MIDI channel and defaults to Ch1. But for now, if you have a tool that exports patch names, give this a go and let me know... Thanks to Jessy for the original JS script which I banged my head on for weeks trying to get work but alas a bug in Mainstage.... rachel
  4. Thanks, yes I have seen the events.js file - it only contains the direct MIDI methods. I am looking for what Javascript is actually implemented, but it is certainly not in a shared object in the application, it must be statically linked in and so I guess a lot harder to find. I was hoping to be able to access the JS interpreter and have a look at what it actually supports, with respect to extended functions, as mentioned, popping open a file or including it in a script so I would not have to write 20 scripts all doing the same thing, but all slightly different, or creating one massive one that would be hard to edit or maintain. To be clear, I just wanted to grab the arrays formatted and then load them from a file to an existing script so I can store patch names in them. I was hoping scripter might go halfway so I could just load a MIDNAM file and format it and split what I wanted from it dynamically! Anyway.... rachel
  5. Hi, I am playing with Scripter but am unsure about the API. What interests me is what the API can do beyond what is documented in the PDF that lists all the MIDI methods. For example, I figure it would be good to be able to open a file formatted with the MIDNAM DTD, so that you could load patch names into it, but instead there does not seem to be a Javascript method to even open a file, or at least I cannot find one. So, hence my question - what kind of javascript are we dealing with here, how much can it do beyond the MIDI functions? Given it works with various program decision logic, like arrays, calculations, for loops, event loops etc, what is missing or undocumented? I will go back to my file open example - I don't think I can even use a Javascript "include" function to load a bit of code from a source file. I would like to be able to have my script open/include a file containing an already formatted array, for example, instead of one script to process each array. Can anyone tell me where I can find out more about the implementation of this particular Javascript in Scripter, so I know I won't be wasting my time anticipating things it doesn't support? It is clear it is very powerful, but knowing whether I can rely on some functions like opening/including a file would be very helpful. Being able to run it from the CLI would be something else that would be useful, for testing etc.... rachel
  6. Hi, I will answer my own question by saying that 3.1.1 is working fine with my project and is working very w well. Even better, the problems with Scripter not working with Program Changes has been fixed, so it seems they are listening... rachel
  7. Hi, in my setup, I have a bunch of channel strips that are purely routing and utiltiy functions that get in the way of the bits I work with most regularly. Apart from dragging the strips around on the panel so the ones I want are grouped together, is there a way to hide channels strips or pack them into a folder like Logic can? rachel
  8. Hi, I am still on Mainstage 3.0,4 as I have a complex hardware setup that is working fine with this version. I have skipped version 3.1 as I knew it had problems, but am I now safe to install 3.1.1? I would take a backup of 3.0.4 first, of course. Thanks for your input... rachel
  9. Hopefully you have a backup via time capsule or similar. Move or rename the old Mainstage.app to a temporary name or folder. Recover using your favourite backup tool, in my case time machine. You may also have to go one version back in your save files for your project but it should load just fine. In future, before installing a new version of something, take a backup of the original so you can roll back quickly. From what I gather, there is no manifest check or catalog that prevents you from having two version at once on the one machine, but you should only run one at a time. I have not upgraded to 3.1 yet - I like my mainstage as it is for now, until all the bugs are sorted rachel
  10. Let's hope they fixed the Scripter bugs ie Program Change and some others.....
  11. Hi, do you know if a similar bug fiix is coming for Mainstage? All I need scripter to do is Program Changes which clearly does not work with mainstage & scripter at all. Latest Mainstage is 3.0.4 rachel
  12. Are you routing System sounds through the audio interface? See if you have one of the built in system sounds set to go out through your interface. rachel
  13. I am using a Behringer BCF-2000 mapped to control mute/levels/pan of the main 8 inputs of my audio interface, a Genoqs Octopus as the sequencer and couple of MIDI synths as note/keys inputs. I use Mainstage to route all the MIIDI traffic to my gear and do setup assignments, patch settings, song select, Octopus defaullts and MIDI clock. Octopus works back the other way, sending patttern selection and other default patch changes and the whole lot works better than Logic ever did with the same setup! I really love Mainstage. Once I got over the interface layout learning curve, there is nothing it cannot do for me, short of a couple of very annoying bugs. rachel
  14. Hi, I am a bit annoyed at Scripter because it is not working properly in Mainstage and so l cannot test everything but if you look in the documentation it does mention the MIDI clock sync which you should be able to use to create a for or while loop in JavaScript that is bounded by a start and end value. You would have to work out how many clock ticks before you step to the next increment or Decrement but yes, I do believe it is possible and probably useful for sending lots of modulation events... rachel
  15. Not sure of ypur first issue, but you can click and drag a channel strip and arrange them in any order you like. With your first issue, you might have to create an Assignment and set it through your master keyboard by creating some kind of transform object in your layout. rachel
×
×
  • Create New...