Google Answers Logo
View Question
 
Q: Programming MIDI in perl on windows. ( Answered 4 out of 5 stars,   0 Comments )
Question  
Subject: Programming MIDI in perl on windows.
Category: Computers
Asked by: zenpickle-ga
List Price: $75.00
Posted: 12 Jul 2004 12:31 PDT
Expires: 11 Aug 2004 12:31 PDT
Question ID: 373140
Help programming MIDI with perl on windows. I found on CPAN and
installed Win32api::MIDI on my ActiveState perl release. My problem is
thatI can't find any examples for using this package. Doing a google
search on Win32api::MIDI shows darn few hits of any sort much less any
examples. There are many examples of Linux based perl MIDI programs but
I couldn't find any for Windows and I am pretty sure that the lower levels
are incompatable. Any help that gets me a working example will answer
this question, eithor a web pointer or a simple program you write for
me. The program should at least output midi events, probably
to the built in MIDI device that goes to the sound card.
Answer  
Subject: Re: Programming MIDI in perl on windows.
Answered By: deadlychiapet-ga on 13 Jul 2004 21:27 PDT
Rated:4 out of 5 stars
 
Hi there,

A search of the cpan.org website found a page that describes the
Win32API-MIDI package. The page contains example code with various
samples that should run and can be found at
http://search.cpan.org/~hayashi/Win32API-MIDI-0.05/MIDI.pm

The example pasted below is for outputting short midi events but if
you visit the site and click on example you will find the entire code
sample.

  use Win32API::MIDI qw( /^(MIM_)/ );
  $midi = new Win32API::MIDI;

  # MIDI::Out::ShortMsg
  $mo = new Win32API::MIDI::Out         or die $midi->OutGetErrorText();
  $mo->ShortMsg(0x00403C90)             or die $mo->GetErrorText();
  sleep(1);
  $mo->ShortMsg(0x00003C90)             or die $mo->GetErrorText();
  $mo->Close                            or die $mo->GetErrorText();

In addition to the example on the description page above, there are a
few examples in another directory at
http://search.cpan.org/src/HAYASHI/Win32API-MIDI-0.05/t/ . The
midiout.t example is especially relevant to what you're trying to do
and is at http://search.cpan.org/src/HAYASHI/Win32API-MIDI-0.05/t/midiout.t

As well, make sure you have a recent perl distribution as some of the
test (.t) examples require perl 5.8.0 or above.

I hope this solves your problem. If not, please feel free to ask for
clarification before rating this answer and I'll be happy to help you
out.

Thanks,
Deadlychiapet

Search strategy:
win32api::midi
://www.google.ca/search?q=win32api%3A%3Amidi
zenpickle-ga rated this answer:4 out of 5 stars
Properly answers the question. I was hoping for more than the package
authors examples but I didn't specify this so this is my problem not
yours. Nobody seems to be using this package except the author. I had
the first reference already because it came with the package but I
missed the next two which were good finds.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy