Extension to play music in Small BasicHere's an extension to Small Basic that plays tones from your internal speaker.<br><br>It is similar to QB's PLAY statement, but still needs a bit of work.<br><br>There is no error checking, and no way to stop playing in the middle of a string.<br><br>The new object is ToneGenerator<br><br>There are two methods-<br>    <br>    PlayString(string)<br><br>        the string can be any note C, C#, D, D#, E, F, F#, G, G#, A, A#, B <br>        or you can change the octave by typing the letter O followed by a number 1 - 6 ex. O3<br>        or you can change the length of the note by typing the letter L followed by a number 1 - 9 ex. L2<br>        or you can add a pause by typing the letter P followed by a number 1 - 9 ex. P7<br>    <br>        you end up with something like    ToneGenerator.PlayString(&quot;O4 L3 GAGFEF L6 G&quot;)<br><br>        I haven't tested this a lot, but it should ignore everything else.<br><br>and <br><br>    PlayTone(frequency, duration)<br><br>        this method will simply beep at the frequency and duration you input<br><br>To use it, copy the ToneGen.dll and ToneGen.xml to your C:\Program Files\Microsoft\Small Basic\lib folder.<br><br>The sample included plays Mary had a little lamb.<br><br><a href="http://code.msdn.microsoft.com/ExtToneGenerator">http://code.msdn.microsoft.com/ExtToneGenerator</a>© 2009 Microsoft Corporation. All rights reserved.Thu, 24 Sep 2009 00:05:50 Z27ab7d4b-febe-45bb-b919-3d3107154ccahttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#27ab7d4b-febe-45bb-b919-3d3107154ccahttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#27ab7d4b-febe-45bb-b919-3d3107154ccaRushworkshttp://social.msdn.microsoft.com/Profile/en-US/?user=RushworksExtension to play music in Small BasicHere's an extension to Small Basic that plays tones from your internal speaker.<br><br>It is similar to QB's PLAY statement, but still needs a bit of work.<br><br>There is no error checking, and no way to stop playing in the middle of a string.<br><br>The new object is ToneGenerator<br><br>There are two methods-<br>    <br>    PlayString(string)<br><br>        the string can be any note C, C#, D, D#, E, F, F#, G, G#, A, A#, B <br>        or you can change the octave by typing the letter O followed by a number 1 - 6 ex. O3<br>        or you can change the length of the note by typing the letter L followed by a number 1 - 9 ex. L2<br>        or you can add a pause by typing the letter P followed by a number 1 - 9 ex. P7<br>    <br>        you end up with something like    ToneGenerator.PlayString(&quot;O4 L3 GAGFEF L6 G&quot;)<br><br>        I haven't tested this a lot, but it should ignore everything else.<br><br>and <br><br>    PlayTone(frequency, duration)<br><br>        this method will simply beep at the frequency and duration you input<br><br>To use it, copy the ToneGen.dll and ToneGen.xml to your C:\Program Files\Microsoft\Small Basic\lib folder.<br><br>The sample included plays Mary had a little lamb.<br><br><a href="http://code.msdn.microsoft.com/ExtToneGenerator">http://code.msdn.microsoft.com/ExtToneGenerator</a>Sat, 29 Nov 2008 03:16:00 Z2008-11-29T04:15:55Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#7035e209-4088-4341-8f96-c08a6885275chttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#7035e209-4088-4341-8f96-c08a6885275cPlayDeez Gameshttp://social.msdn.microsoft.com/Profile/en-US/?user=PlayDeez%20GamesExtension to play music in Small BasicGood stuff.<br><br>However, I seem to recall that L command had longer notes for smaller values, so L1 was a whole note, L2 was a half note, L4 was a quarter note, etc.<br><br>At least that's how it worked in GW-BASIC and QB as well.<br><br>You going to do a Draw statement along a similar vein?<br> Sat, 29 Nov 2008 21:48:34 Z2008-11-29T21:48:34Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#046ee2ad-6e92-4781-851e-e3e8660d5004http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#046ee2ad-6e92-4781-851e-e3e8660d5004Rushworkshttp://social.msdn.microsoft.com/Profile/en-US/?user=RushworksExtension to play music in Small Basic I don't plan on writing a DRAW extension, I think the Turtle does a similar task.  I wrote the ToneGenerator because I thought it was missing from Small Basic.<br><br>I also wrote a simple piano program <a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=ExtToneGenerator&amp;Release">https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=ExtToneGenerator&amp;Release</a>. <br><br><img src="http://farm4.static.flickr.com/3044/3102500861_398a6a988f.jpg?v=0">Sun, 30 Nov 2008 21:16:52 Z2008-12-12T20:12:08Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#e8471a82-d12f-4de6-ab4a-01981f0c9ecehttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#e8471a82-d12f-4de6-ab4a-01981f0c9eceStendechttp://social.msdn.microsoft.com/Profile/en-US/?user=StendecExtension to play music in Small BasicHi Rushworks,<br/>I successfully downloaded the files for your tone generator and it appears in the Intellisense wheel. However. I can't get a note out of it. There is a delay while the sound should be there and then the program ends. Any ideas?<br/>Sun, 05 Apr 2009 16:40:05 Z2009-04-05T16:40:05Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#e1464843-4cce-4a5a-9902-a4c8064e50cchttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#e1464843-4cce-4a5a-9902-a4c8064e50ccRushworkshttp://social.msdn.microsoft.com/Profile/en-US/?user=RushworksExtension to play music in Small Basic<p>Sorry to hear your having trouble with the extension.  My only suggestion would be to check your internal speaker.  </p>Sun, 05 Apr 2009 23:14:15 Z2009-04-05T23:14:15Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#318bee22-fd3d-433d-8125-a2950e682dddhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#318bee22-fd3d-433d-8125-a2950e682dddStendechttp://social.msdn.microsoft.com/Profile/en-US/?user=StendecExtension to play music in Small Basic<p>I've also dowloaded litdev's speech and music extension and that works fine. Has anyone else had difficulties? My PC is set-up for the UK.<br/><br/>I notice that you refer to the internal speaker. I don't have an internal speaker, I use a pair of small external speakers. I can't see that this makes any difference or am I wrong?</p> <p> </p>Mon, 06 Apr 2009 17:45:48 Z2009-04-06T17:45:48Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#c225a397-374c-48cf-a21a-6fd0672e209fhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#c225a397-374c-48cf-a21a-6fd0672e209fRushworkshttp://social.msdn.microsoft.com/Profile/en-US/?user=RushworksExtension to play music in Small Basicyes, there is a difference between an internal speaker connected directly to the motherboard and external speakers that use drivers and a soundcard <br/>Tue, 07 Apr 2009 14:45:42 Z2009-04-07T14:45:42Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#69a7a20c-d582-4f64-92b3-b9408478b74ehttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#69a7a20c-d582-4f64-92b3-b9408478b74eRobson Rochahttp://social.msdn.microsoft.com/Profile/en-US/?user=Robson%20RochaExtension to play music in Small BasicHi Rushworks!<br/><br/>I was wishing to write a simple toy program for my 1 year old son, who likes to strike my keyboard to hear beeps. The tone generator you wrote seems perfect, and i was also wishing to write something simple with smallbasic.<br/><br/>Well, i've downloaded Small Basic 0.5, and soon after downloaded your extension, installed it as suggested, but... It wont work. Alas, it crashes SmallBasic when it is initializing after installation. Only after removal SB works again.<br/><br/>I've done something wrong?<br/><br/>Thanks!<br/><br/>RobsonTue, 30 Jun 2009 23:29:21 Z2009-06-30T23:29:21Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#6869c20f-2039-44cc-9dab-5a5dd7691056http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#6869c20f-2039-44cc-9dab-5a5dd7691056FremyCompanyhttp://social.msdn.microsoft.com/Profile/en-US/?user=FremyCompanyExtension to play music in Small Basic<blockquote>I've done something wrong?<br/></blockquote> No, this extension has not been updated for v0.5. It can causes problems. <br/><br/>You can either recompile yourself or wait Rushworks to do it for you.<hr class="sig">Fremy - Developer in VB.NET, C# and JScript ... - Feel free to try my extensionWed, 01 Jul 2009 17:06:25 Z2009-07-01T17:06:25Zhttp://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#4af4fdf1-28a2-40ae-9859-b93b699182c9http://social.msdn.microsoft.com/Forums/en-US/smallbasic/thread/27ab7d4b-febe-45bb-b919-3d3107154cca#4af4fdf1-28a2-40ae-9859-b93b699182c9Rushworkshttp://social.msdn.microsoft.com/Profile/en-US/?user=RushworksExtension to play music in Small BasicI created a new release of my Tone Generator.  I included a .dll for version v0.6 and a batch file that builds a new .dll file, using the command line compiler, for whatever version of Small Basic you have.<br/><br/><a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=ExtToneGenerator&amp;ReleaseId=3247"><span style="color:#0033cc">https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=ExtToneGenerator&amp;ReleaseId=3247</span></a><br/><br/>when the next version of Small Basic is out, simply run the update file and you should be good to go.Tue, 22 Sep 2009 20:10:45 Z2009-09-22T20:10:45Z