Giant long shot (Jython/Python question)

Posts: 4
Joined: Wed Apr 19, 2017 9:05 am

Giant long shot (Jython/Python question)

Postby RoseRodent » Fri Apr 21, 2017 10:46 am

I am wondering if anyone here knows how to send the Bank MBS02 program change messages as an output from a Python program? I have the instrument change one down just fine, it's a 192 request, either self.sendMidiMessage(192, channel, instrument, 0) or mOutput.setInstrument(xx) will do it. But the only way I can get it to change key or access the user presets is by plugging in a synth, sending the bank change, then changing the plug back over to the computer to send a program change and this time it sends it on bank 1/2 instead of 0. If anyone knows what I am talking about, can you let me know if there is a way to send the complete message, a bank change program change message, not just a program change? Would really, really like to be able to access the other banks using the program so that key changes are possible.

User avatar
Posts: 1001
Joined: Tue Dec 15, 2009 3:25 am

Re: Giant long shot (Jython/Python question)

Postby Jesse » Fri Apr 21, 2017 12:22 pm

Sure, a bank select MSB is just CC0, and bank select LSB is CC32 (just basic midi controller messages). Sending those anytime prior to the program change message is all you need to do!

Posts: 4
Joined: Wed Apr 19, 2017 9:05 am

Re: Giant long shot (Jython/Python question)

Postby RoseRodent » Sat Apr 22, 2017 1:48 pm

But what do I type into my program? I don't know how to tell it I want it to send this message! How do I do it using the same sort of format? Where and how in the command do I type the control change message? I can't just type CC0, I need an actual line of programming language, and that's the bit I don't know. The instruction book only has the instrument change one and then the helpful message "and so on". :x I'm not sure what I should replace with what, or what to add. I've tried a huge number of formats and nothing has worked. How does one input a bank change message in Python, Jython or Java (I can probably work out how to reformat it if i can get one of these)

User avatar
Posts: 1001
Joined: Tue Dec 15, 2009 3:25 am

Re: Giant long shot (Jython/Python question)

Postby Jesse » Mon Apr 24, 2017 10:20 am

You just need different parameters to the sendMidiMessage() call. Check out the info here:
https://users.cs.cf.ac.uk/Dave.Marshall ... de158.html

In the Channel Messages section you see how the different kind of messages are formed. Usually these things are specified in hexadecimal, your example with 192 is 0xC0 in hex which represents a program change message. The one for CC is 0xB0 or 176 in decimal.

So for CC messages, you would use the following (generically) in your program's case:

self.sendMidiMessage(176, channel, CCNUM, CCVAL)

So a bank select MSB (CC0) would be this:
self.sendMidiMessage(176, channel, 0, MSBval)

Where MSBval would be as specified in TJ's manual for what you want (0 for default presets, 1 for user presets, or 2 for quick change buttons).
Hope that helps!

Return to Miscellaneous

Who is online

Users browsing this forum: No registered users and 2 guests