<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent posts to Polyphonic MUSICBOX (using sound sample)</title><link>https://sourceforge.net/p/gcbasic/discussion/projects%2526guides/thread/bb212146b3/</link><description>Recent posts to Polyphonic MUSICBOX (using sound sample)</description><atom:link href="https://sourceforge.net/p/gcbasic/discussion/projects&amp;guides/thread/bb212146b3/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 03 Mar 2026 14:56:18 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/gcbasic/discussion/projects&amp;guides/thread/bb212146b3/feed.rss" rel="self" type="application/rss+xml"/><item><title>Polyphonic MUSICBOX (using sound sample)</title><link>https://sourceforge.net/p/gcbasic/discussion/projects%2526guides/thread/bb212146b3/?limit=250#b561</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Lifted, edit, posted.&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/Music" rel="nofollow"&gt;https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/Music&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anobium</dc:creator><pubDate>Tue, 03 Mar 2026 14:56:18 -0000</pubDate><guid>https://sourceforge.net49b3ef39d73d8a9c30ffe3cb87629f7af56fda4d</guid></item><item><title>Polyphonic MUSICBOX (using sound sample)</title><link>https://sourceforge.net/p/gcbasic/discussion/projects%2526guides/thread/bb212146b3/?limit=25#260b</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you! -Sure! Go ahead!&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Roger Jönsson</dc:creator><pubDate>Tue, 03 Mar 2026 10:04:03 -0000</pubDate><guid>https://sourceforge.netaa2d9b3446dfbf8c244b68c70811bec72b652c94</guid></item><item><title>Polyphonic MUSICBOX (using sound sample)</title><link>https://sourceforge.net/p/gcbasic/discussion/projects%2526guides/thread/bb212146b3/?limit=250#e827</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Genius code!&lt;/p&gt;
&lt;p&gt;May I make a YouTube video on this ?&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anobium</dc:creator><pubDate>Tue, 03 Mar 2026 07:40:53 -0000</pubDate><guid>https://sourceforge.net5aed81818d56ca4be4442bb83fba86cd2e45d7e6</guid></item><item><title>Polyphonic MUSICBOX (using sound sample)</title><link>https://sourceforge.net/p/gcbasic/discussion/projects%2526guides/thread/bb212146b3/?limit=25#1346</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;A Polyphonic MUSICBOX on PIC 18F57Q84 using a sound sample as audio source.&lt;/p&gt;
&lt;p&gt;Exploring GCBasic programming , I decided to try and make a musicbox. It resulted in a polyphonic and can play up to 8 independent voices simultaneously.&lt;br/&gt;
I was asked to make a demo video and figured that 3min of a PIC chip just laying on my desk was kind boring to look at, so I added a LED-bar that shows when the voices are sounding.&lt;/p&gt;
&lt;p&gt;Here is a demo video:&lt;br/&gt;
-Maple Leaf Rag by Scott Joplin (Public Domain).&lt;br/&gt;
&lt;a href="https://lineaudio.se/div/Musicbox%20Maple%20Leaf%20Rag.mp4" rel="nofollow"&gt;https://lineaudio.se/div/Musicbox%20Maple%20Leaf%20Rag.mp4&lt;/a&gt;&lt;br/&gt;
(Most of the distortion is actually added by the camera)&lt;/p&gt;
&lt;p&gt;The 8-bit SOUND SAMPLE is stored in program memory and uploaded to RAM on start, which is then slightly faster than reading bytes with ProgramRead. The sample is played back using a Timer0 interrupt acting sample clock at 32000 times per second, running 8 voices, so sound can be made of bytes flowing though the 8-bit DAC at up to 256kB/s.&lt;br/&gt;
In this example all voices read from one single sound sample, which is stepped through at individual speeds (pattern of skip and repeat in the sample array) to produce the different pitches.&lt;br/&gt;
It would be easy to use different samples for each voice, combining percussion with different sounding instruments etc, but in this experient I decided to go for one sample making it sound kind of organ like.&lt;/p&gt;
&lt;p&gt;The MUSIC SCORE is stored in word format and read directly using ProgramRead, stepped along by a second Timer. This conducts the voices, sets their pitches and starts them off at the right time ("Note On"). To simplify things I skipped "Note Off", so when a voice is started it just stops at its own at the end of the sample. Only when notes overlap in a voice is it stopped and restarted with the new pitch before it is finished.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Roger Jönsson</dc:creator><pubDate>Sun, 01 Mar 2026 19:09:41 -0000</pubDate><guid>https://sourceforge.net161727ac5caaa705a6c853a5550f8c80ca71e043</guid></item></channel></rss>