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
 
This week, we're updating our course layouts and descriptions. Presentation and materials always gently change over time, but just occasionally there's a need to make a step change to clear out some of the old and roll in the new. That's now happening - but over a long and complex site it's not instant and you'll see sections of the site changing up to and including 19th September.

See also [here] for status update
 
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., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho