Re: Glitch-free presentations with Windows 7 and Matlab (David Magezi )


Subject: Re: Glitch-free presentations with Windows 7 and Matlab
From:    David Magezi  <dmagezi@xxxxxxxx>
Date:    Tue, 18 Oct 2011 10:29:14 -0700
List-Archive:<http://lists.mcgill.ca/scripts/wa.exe?LIST=AUDITORY>

--2145414650-720008768-1318958954=:27513 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Many thanks for that review Trevor.=0A=0AAm not sure, if the following has = been mentioned: There appears to be a matlab-ASIO interface from University= of Birmingham (UK), using ActiveX.=0A=0A=0Ahttp://www.eee.bham.ac.uk/colli= nst/asio.html=0A=0AI would also be keen to hear of other solutions found,= =0A=0AD=0A=0A=C2=A0=0A***************************************************= =0ADavid Magezi=0A=0A***************************************************=0A= =0A=0A________________________________=0AFrom: Trevor Agus <Trevor.Agus@xxxxxxxx= .FR>=0ATo: AUDITORY@xxxxxxxx=0ASent: Tuesday, October 18, 2011 5:52 = PM=0ASubject: [AUDITORY] Glitch-free presentations with Windows 7 and Matla= b=0A=0AI've found it surprisingly difficult to present glitch-free sounds w= ith=0AWindows 7.=0A=0AThe short answer is that Padraig Kitterick's "asioWav= Play" seems to be the=0Asimplest reliable method (remembering to buffer the= waveforms with 256 samples=0Aof silence to avoid truncation issues). For t= hose with more complex needs,=0Aperhaps soundmexpro or PsychToolbox would b= e better. I'd value any second=0Aopinions and double-checking, so a review = of the options follows, with all the=0Agory details.=0A=0AI've been using a= relatively old version of Matlab (R2007b) with a Fireface UC=0Asoundcard. = If the problems are fixed in another version or soundcard, I'd love=0Ato kn= ow about it.=0A=0A=3D=3D=3DMatlab's native functions (sound, wavplay, audio= player)=0ALarge, unpredictable truncations were the least of our problems. = We also often=0Agot mid-sound glitches, ranging from sporadic (just a few s= ubtle glitches per=0Aminute) to frequent (making the sound barely recognisa= ble). The magic formula=0Afor eliminating the glitches seemed to be to keep= the soundcard turned off=0Auntil=0Athe desktop was ready, with all backgro= und programs loaded. (Restarting either=0Athe soundcard or=C2=A0 the comput= er alone guaranteed some glitches.) So this formula=0Aseems to work, but it= 's a bit too Harry Potter for my liking, and the spell=0Amight change with = the next Windows update.=C2=A0 I think I read that Fireface were=0Ano longe= r supporting Microsoft's vagaries, and they recommended using ASIO. I'm=0An= ot sure if other high-end soundcard manufacturers are any different. Since= =0AMatlab's native functions don't support ASIO (unless the new versions do= ?),=0AI think we're forced to look at the ASIO options.=0A=0A=3D=3D=3Dplayr= ec=0AThis seems to be potentially the most flexible method of presenting so= unds but=0AI've hit a brick wall compiling it for Windows 7. I think its au= thor stopped=0Aproviding support for it a few years ago. Has anyone had mor= e success than me?=0A=0A=3D=3D=3DasioWavPlay=0AThis simply presents a .wav = file using ASIO. It's a little annoying that you=0Ahave to save your sound = to disk before presenting it, but as Joachim pointed=0Aout, it's not too di= fficult to automate this process. While doing that, I add=0A256 samples of = silence to the end to work around the truncation problem.=0A=0A=3D=3D=3Dpa_= wavplay=0AThis is nearly the perfect solution except (1) the number of samp= les truncated=0Afrom the end is slightly unpredictable and (2) it prints a = message on the=0Ascreen after every sound ("Playing on device 0"). For thes= e two reasons, I=0Aprefer asioWavPlay.=0A=0A=3D=3D=3Dsoundmexpro=0AThis mig= ht be best choice for the high-end user (I've just had a quick look at=0Ath= e demo version today). It's easy to install and there are good tutorials, b= ut=0Ait involves initialising sound objects, etc. -- it's not just a replac= ement for=0AMatlab's "sound" command. Also it looks like it's =E2=82=AC500+= .=0A=0A=3D=3D=3DPsychToolbox=0AOriginally designed for visual experiments, = PsychToolbox has now got quite=0Aextensive low-latency sound functions, inc= luding realtime continuous=0Aplaying/recording. It's also free. However, it= 's slightly challenging to=0Ainstall=C2=A0 Like soundmexpro, it's object-or= iented -- so don't expect to play a=0Asound with a simple one-liner.=0A=0A= =3D=3D=3DPortAudio=0AMost of above programs are based on this C library. If= you're an experienced=0Aprogrammer, perhaps you'd prefer to go direct the = source? And while you're=0Athere, perhaps you could write the perfect Matla= b-ASIO interfaces for the rest=0Aof us? (Please!)=0A=0AHas anyone found a s= impler solution? I'd be glad to hear it.=0A=0ATrevor --2145414650-720008768-1318958954=:27513 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><body><div style=3D"color:#000; background-color:#fff; font-family:ar= ial, helvetica, sans-serif;font-size:10pt"><div><span>Many thanks for that = review Trevor.</span></div><div><br><span></span></div><div><span>Am not su= re, if the following has been mentioned: There appears to be a matlab-ASIO = interface from University of Birmingham (UK), using ActiveX.<br></span></di= v><div><br><span></span></div><div><span>http://www.eee.bham.ac.uk/collinst= /asio.html</span></div><div><br><span></span></div><div><span>I would also = be keen to hear of other solutions found,</span></div><div><br><span></span= ></div><div><span>D</span></div><div>&nbsp;</div><div>*********************= ******************************<br> David Magezi<br><br>*****= **********************************************<br></div> <di= v style=3D"font-family: arial, helvetica, sans-serif; font-size: 10pt;"><di= v style=3D"font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face=3D"Arial" size=3D"2"><hr size=3D"1"><b><span = style=3D"font-weight:bold;">From:</span></b> Trevor Agus &lt;Trevor.Agus@xxxxxxxx= S.FR&gt;<br><b><span style=3D"font-weight: bold;">To:</span></b> AUDITORY@xxxxxxxx= ISTS.MCGILL.CA<br><b><span style=3D"font-weight: bold;">Sent:</span></b> Tu= esday, October 18, 2011 5:52 PM<br><b><span style=3D"font-weight: bold;">Su= bject:</span></b> [AUDITORY] Glitch-free presentations with Windows 7 and M= atlab<br></font><br>=0AI've found it surprisingly difficult to present glit= ch-free sounds with<br>Windows 7.<br><br>The short answer is that Padraig K= itterick's "asioWavPlay" seems to be the<br>simplest reliable method (remem= bering to buffer the waveforms with 256 samples<br>of silence to avoid trun= cation issues). For those with more complex needs,<br>perhaps soundmexpro o= r PsychToolbox would be better. I'd value any second<br>opinions and double= -checking, so a review of the options follows, with all the<br>gory details= .<br><br>I've been using a relatively old version of Matlab (R2007b) with a= Fireface UC<br>soundcard. If the problems are fixed in another version or = soundcard, I'd love<br>to know about it.<br><br>=3D=3D=3DMatlab's native fu= nctions (sound, wavplay, audioplayer)<br>Large, unpredictable truncations w= ere the least of our problems. We also often<br>got mid-sound glitches, ran= ging from sporadic (just a few subtle glitches per<br>minute) to frequent (= making the sound barely recognisable). The magic formula<br>for eliminating the glitches se= emed to be to keep the soundcard turned off<br>until<br>the desktop was rea= dy, with all background programs loaded. (Restarting either<br>the soundcar= d or&nbsp; the computer alone guaranteed some glitches.) So this formula<br= >seems to work, but it's a bit too Harry Potter for my liking, and the spel= l<br>might change with the next Windows update.&nbsp; I think I read that F= ireface were<br>no longer supporting Microsoft's vagaries, and they recomme= nded using ASIO. I'm<br>not sure if other high-end soundcard manufacturers = are any different. Since<br>Matlab's native functions don't support ASIO (u= nless the new versions do?),<br>I think we're forced to look at the ASIO op= tions.<br><br>=3D=3D=3Dplayrec<br>This seems to be potentially the most fle= xible method of presenting sounds but<br>I've hit a brick wall compiling it= for Windows 7. I think its author stopped<br>providing support for it a few years ago. Has anyone had more success than me?<br><br>=3D=3D=3DasioWa= vPlay<br>This simply presents a .wav file using ASIO. It's a little annoyin= g that you<br>have to save your sound to disk before presenting it, but as = Joachim pointed<br>out, it's not too difficult to automate this process. Wh= ile doing that, I add<br>256 samples of silence to the end to work around t= he truncation problem.<br><br>=3D=3D=3Dpa_wavplay<br>This is nearly the per= fect solution except (1) the number of samples truncated<br>from the end is= slightly unpredictable and (2) it prints a message on the<br>screen after = every sound ("Playing on device 0"). For these two reasons, I<br>prefer asi= oWavPlay.<br><br>=3D=3D=3Dsoundmexpro<br>This might be best choice for the = high-end user (I've just had a quick look at<br>the demo version today). It= 's easy to install and there are good tutorials, but<br>it involves initial= ising sound objects, etc. -- it's not just a replacement for<br>Matlab's "s= ound" command. Also it looks like it's =E2=82=AC500+.<br><br>=3D=3D=3DPsychToolb= ox<br>Originally designed for visual experiments, PsychToolbox has now got = quite<br>extensive low-latency sound functions, including realtime continuo= us<br>playing/recording. It's also free. However, it's slightly challenging= to<br>install&nbsp; Like soundmexpro, it's object-oriented -- so don't exp= ect to play a<br>sound with a simple one-liner.<br><br>=3D=3D=3DPortAudio<b= r>Most of above programs are based on this C library. If you're an experien= ced<br>programmer, perhaps you'd prefer to go direct the source? And while = you're<br>there, perhaps you could write the perfect Matlab-ASIO interfaces= for the rest<br>of us? (Please!)<br><br>Has anyone found a simpler solutio= n? I'd be glad to hear it.<br><br>Trevor<br><br><br></div></div></div></bod= y></html> --2145414650-720008768-1318958954=:27513--


This message came from the mail archive
/var/www/postings/2011/
maintained by:
DAn Ellis <dpwe@ee.columbia.edu>
Electrical Engineering Dept., Columbia University