Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Win32::MIDI

Posted by ed (ed), 23 March 2005
Hello
I wonder if someone can help me
I'm trying to send MIDI sysex data to a vintage Oberheim synthesizer using Win32::MIDI.
I've successfully manged to send notes via MIDI to it and that works fine but I'm now trying to send sysex and I'm not really understanding the documentation that comes with this module.

Have a look at this page:
http://search.cpan.org/~church/Win32-MIDI-0_2/MIDI.pm
- you'll see a method called value_of in there where NAME can be 'special'. That's the one I'm interested in.  OPT 1 should be a value between 1 and 16, but I'm not at all sure how I'm supposed to know what to enter here. And what does it mean when it says that a hash is returned if nothing is entered for OPT 1 ?

Any help with this would be greatly appreciated.

ed

ps - the kind of message that I'm expecting to send is something like this:
F0,10,00,01,3A,00,00,01,00,00
This is a series of HEX values - but I can't work out how Win32::MIDI can sebd this.

Posted by admin (Graham Ellis), 24 March 2005
Purely from reading this description, I think that value_of can take any one of the the following parameters, which should be written in quotes in the call (i.e. they are strings):
note, velocity, cc, channel, channel_aftertouch,  polyphonic, pitch_wheel, special, note_name_map, null.

In some cases, one or two extra parameters may or must be given - the documentation desribes them, and they differ depending on what you specify as the first parameter. In the case of 'special', you can give the name of a special MIDI command such as SYSEX and it will return the byte number associated with that command; if you don't know all the commands, then you'll get back a structure (a non ordered collection or hash) which tells what they're all called and what theire values are.

I don't have the module (And I'm not on a Win32 machine at present to experiment with it), by the following code snippet (untested) might help by printing a table ...

Code:
%spvals = $yourobj -> value_of('special');
foreach $spname (keys %spvals) {
    print "$spname .... $spvals{$spname}\n";
}


where $yourobj is a Win32::MIDI object.  (And this is an example of returning a hash)

Posted by ed (ed), 7 April 2005
Thanks Graham

In the end (and at great cost to my marriage and sanity ) I managed to install Win32api::MIDI instead.

I wanted to ask you about tcl/tk. Now that I've got my perl mod set up and happily sending out sysex data to my synth, I was wanting to build a GUI for it.

I need to make some on-screen controls where if you turn a knob 5 clicks, then Perl will send five lines of data. I heard from a friend that tcl/tk would integrate very well with Perl and be able to provide this. What do you think ?

I had originally intended to make a Flash GUI that sent vars to Perl via a query string - but this is far from ideal as it involves either opening a Perl file repeatedly or sending 'packets' of data to it.

Any advice very gratefully appreciated.

ed

Posted by admin (Graham Ellis), 8 April 2005
Tcl is another complete language and Tk is the GUI that sits on top of it / goes with it. Not everyone who uses Tcl also uses Tk, but there's sufficient interest for us to offer a 2 day Tk course that follow on from the three days on Tcl.

Now - interesting - Tk can also be called up and run directly from Perl as well as from Tcl. It's not got the same number of users - it's a niche use - but it does work pretty well.  I suspect that it's the solution that would be best for you. There's links to three short code examples on our Perl/Tk training module page and we have 4 books on the subject too.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho