<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hello Alain,<BR>
<BR>
Although interfacing MIDI equipment is a completely new topic for me, you might find the folowing helpful.<BR>
<BR>
I can think of the following approaches to interface EPrime to MIDI devices:<BR>
<BR>
1) Use an existing software library to establish a connection with the Windows audio/MIDI drivers. This would be the preferred method because you only have to create EPrime inline script. However, the difficulty with this approach is that there is no trivial implementation possible to handle time critical input events in EPrime. (This would normally require an EPrime compatible input device object.) How MIDI input events should be handled is described in the ‘Inputting MIDI data’ at <A href="http://www.borg.com/~jglatt/tech/lowmidi.htm">http://www.borg.com/~jglatt/tech/lowmidi.htm</A>. If you don’t require accurate time stamps on the ‘keystroke’ events, then it might be possible to use the so called polling technique to handle all input. Sending information (i.e. commands) to MIDI devices should not be a big problem with this technique. The low level MIDI application programming interface (API) is described at the microsoft developers site: <A href="http://msdn2.microsoft.com/en-us/library/ms712733.aspx">http://msdn2.microsoft.com/en-us/library/ms712733.aspx</A><BR>
<BR>
2) Use a dedicated hardware interface that maps MIDI input events to one of the input devices which are supported by EPrime (i.e. parallel printer port, RS232, …) The advantage of this approach is that (translated) keystrokes can be handled very accurately by EPrime itself. The downside is that you need a special piece of hardware. If development of such a piece of digital hardware yourself is not an option, then you could consider having a second computer that interfaces between MIDI and one of the input ports (such as the serial RS232 port) at the EPrime side. You still have to create (or modify) an application to handle all I/O at the interfacing PC.<BR>
<BR>
3) In theory it should also be possible to bypass the windows MIDI API and implement the serial MIDI protocol in EPrime inline script to interface directly to the MIDI hardware. I wouldn’t advise this though, because the script could become very complex and will not be very easy to merge with the experiment itself.<BR>
<BR>
Perhaps other E-Prime or MIDI expert have alternative suggestions.<BR>
<BR>
best,<BR>Paul<BR>
<BR>
Paul Groot<BR>
VU University, Amsterdam<BR><BR><BR><BR><BR>
<BLOCKQUOTE>
<HR id=EC_stopSpelling>
Subject: How to interface a MIDI keyboard with E-Prime<BR>Date: Wed, 12 Sep 2007 08:01:49 -0400<BR>From: damch@uottawa.ca<BR>To: eprime@mail.talkbank.org<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
</STYLE>
<STYLE>
.ExternalClass EC_p.MsoNormal, .ExternalClass EC_li.MsoNormal, .ExternalClass EC_div.MsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman';}
.ExternalClass a:link, .ExternalClass EC_span.MsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass EC_span.MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass EC_span.EmailStyle17
{font-family:Arial;color:windowtext;}
@page Section1
{size:595.3pt 841.9pt;}
.ExternalClass EC_div.Section1
{page:Section1;}
</STYLE>
<DIV class=EC_Section1>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hello E-Prime users,</SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am calling on the expertise of the E-Prime user community for suggestions on how to interface a digital keyboard (piano) with E-Prime. I would like to investigate how piano students learn to decode musical notation. To do so I would like to present musical score on the monitor and record participants’ responses through a digital keyboard with a MIDI interface. The primary hurdle to overcome is to get E-Prime to receive and record responses to the keyboard with accurate time stamping and response detail (e.g., the key chosen, the force applied, the duration of the key press). May I ask for suggestions, recommendations or directions on how such an interface could be developed? Thank you in advance for your assistance.</SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sincerely,</SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Alain Desrochers</SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">School</SPAN></FONT><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> of Psychology</SPAN></FONT><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">University</SPAN></FONT><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> of Ottawa</SPAN></FONT><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Ottawa</SPAN></FONT><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">, Canada</SPAN></FONT><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT></P>
<P class=EC_MsoNormal><FONT face=Arial size=2><SPAN lang=EN-CA style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </SPAN></FONT></P></DIV></BLOCKQUOTE><br /><hr />Windows Live Hotmail: het beste anti-spam mailprogramma. <a href='http://get.live.com/mail/features' target='_new'>Neem nu een gratis account!</a></body>
</html>