<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[ChipMusic.org - LITTLE-SCALE SN76489 USB MIDI]]></title>
	<link rel="self" href="https://chipmusic.org:80/forums/feed/atom/topic/11015/"/>
	<updated>2016-08-22T17:52:50Z</updated>
	<generator>PunBB</generator>
	<id>https://chipmusic.org/forums/topic/11015/littlescale-sn76489-usb-midi/</id>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/247320/#p247320"/>
			<content type="html"><![CDATA[<p>Project not work with other crystal, I think the error in code. Notes not play correct, they play but not correct, c, c#,d, d#, d, e... <br />I think <br /></p><div class="quotebox"><cite>Knife Crimes wrote:</cite><blockquote><p>line 221: <br />void doBend(byte channel, unsigned int bend_usb) {</p><p>changes to:<br />void doBend(uint8_t channel, int bend_usb) {</p></blockquote></div><p>not correct<br />Any ideas, or it&#039;s correct and I have problem with something else (chips, wireless etc)?</p>]]></content>
			<author>
				<name><![CDATA[stress_tn]]></name>
				<uri>https://chipmusic.org/stress_tn</uri>
			</author>
			<updated>2016-08-22T17:52:50Z</updated>
			<id>https://chipmusic.org/forums/post/247320/#p247320</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/245381/#p245381"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>Knife Crimes wrote:</cite><blockquote><p>Compiled under Arduino IDE 1.6.9 ...</p></blockquote></div><p>Thank you!<br />P.S. now i have problem with incorrect cc notes, I think it&#039;s crystal problem</p>]]></content>
			<author>
				<name><![CDATA[stress_tn]]></name>
				<uri>https://chipmusic.org/stress_tn</uri>
			</author>
			<updated>2016-06-23T20:09:53Z</updated>
			<id>https://chipmusic.org/forums/post/245381/#p245381</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/245358/#p245358"/>
			<content type="html"><![CDATA[<p>Compiled under Arduino IDE 1.6.9 and Teensyduino 1.29 Beta #3 by editing the following lines:</p><p>line 51: <br />prog_char sample_space[13952] PROGMEM = {</p><p>changes to:<br />const char sample_space[13952] PROGMEM = {</p><p>line 221: <br />void doBend(byte channel, unsigned int bend_usb) {</p><p>changes to:<br />void doBend(uint8_t channel, int bend_usb) {</p><p>Haven&#039;t tested on hardware, since I have no SN76489.</p><p>Edit - link to Teensyduino <a href="https://forum.pjrc.com/threads/35068-Teensyduino-1-29-Beta-3-Available" target="_blank">https://forum.pjrc.com/threads/35068-Te &#133; -Available</a></p>]]></content>
			<author>
				<name><![CDATA[Knife Crimes]]></name>
				<uri>https://chipmusic.org/Knife+Crimes</uri>
			</author>
			<updated>2016-06-23T12:24:41Z</updated>
			<id>https://chipmusic.org/forums/post/245358/#p245358</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/245337/#p245337"/>
			<content type="html"><![CDATA[<p>Hey stress_tn,</p><p>Assuming you&#039;re using the firmware linked in the linked article - <a href="http://milkcrate.com.au/_other/downloads/teensy/SN76489_USB_MIDI_103/SN76489_USB_MIDI_103.ino" target="_blank">http://milkcrate.com.au/_other/download &#133; DI_103.ino</a></p><p>Problem is, the function being passed to setHandlePitchChange has the wrong datatypes as arguments. Fix that function. It&#039;s less stuffing around than trying to install the &quot;right&quot; (out of date) version of Teensyduino.</p><p>Start by finding this line:<br />void doBend(byte channel, unsigned int bend_usb) {</p><p>And change it to:<br />void doBend(uint8_t channel, unsigned int bend_usb) {</p>]]></content>
			<author>
				<name><![CDATA[Knife Crimes]]></name>
				<uri>https://chipmusic.org/Knife+Crimes</uri>
			</author>
			<updated>2016-06-22T22:59:35Z</updated>
			<id>https://chipmusic.org/forums/post/245337/#p245337</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/245333/#p245333"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>little-scale wrote:</cite><blockquote><p>Firmware now supports up to four SN76489 chips. </p><p>Also added sample support. </p><p><a href="http://little-scale.blogspot.com.au/2013/05/sn76489-usb-midi-103-firmware-quad.html" target="_blank">http://little-scale.blogspot.com.au/201 &#133; -quad.html</a></p><p><img src="https://chipmusic.org/forums/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p></blockquote></div><p>I have problem with arduino and teensyduino version. arduino 1.0.6, 1.6.3, 1.6.9 and teensyduino 1.28 not work, I always see error. Please help and tell me what version of arduino and teensyduino are you use?</p><p>Error:<br />&nbsp; This report would have more information with<br />&nbsp; &quot;Show verbose output during compilation&quot;<br />&nbsp; enabled in File &gt; Preferences.<br />Arduino: 1.0.6 + Td: 1.28 (Windows NT (unknown)), Board: &quot;Teensy 2.0&quot;<br />sketch_jun22a.ino.ino: In function &#039;void setup()&#039;:<br />sketch_jun22a.ino.ino:221: error: invalid conversion from &#039;void (*)(byte, unsigned int)&#039; to &#039;void (*)(uint8_t, int)&#039;<br />sketch_jun22a.ino.ino:221: error:&nbsp; &nbsp;initializing argument 1 of &#039;void usb_midi_class::setHandlePitchChange(void (*)(uint8_t, int))&#039;</p>]]></content>
			<author>
				<name><![CDATA[stress_tn]]></name>
				<uri>https://chipmusic.org/stress_tn</uri>
			</author>
			<updated>2016-06-22T19:56:37Z</updated>
			<id>https://chipmusic.org/forums/post/245333/#p245333</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/191212/#p191212"/>
			<content type="html"><![CDATA[<p>Might be of interest, a little enhancement about the note on/off handling <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />to avoid a note off to cut short any new playing note...<br />EDIT: I forgot to wrote channel check, added now&nbsp; ^_^<br />SID effect have also been done...:)<br />In your Teensy board code &gt;&gt;<br />add a variable to keep track of the latest MIDI note on number</p><div class="codebox"><pre><code>byte p_pitch;
byte p_channel;

then in the function : void doNoteon ()
add:
p_pitch = pitch;
p_channel = channel;
each time there is a check for velocity &gt;0

then in : void doNoteOff()

if(pitch == p_pitch)   // avoid note cuts
        {
            velocityData[channel + (chip_select * 4)] = 0;
            writeAmplitude(0, channel, chip_select);
        }
        else if((pitch != p_pitch) &amp;&amp; (channel != p_channel))
        {
            velocityData[channel + (chip_select * 4)] = 0;
            writeAmplitude(0, channel, chip_select);
        }

then in in the function : void doMidiIn ()
//note on

Line : else if((data &lt; 0x80) &amp;&amp; (flag_previous == 1))
add , p_pitch = data;

Line :if((data &gt;= 0x90) &amp;&amp; (data &lt; 0xa0) &amp;&amp; (flag_previous == 0))
add, p_channel =channel; 

this will keep track of the previous note played when there is a note off message next

//note off
else if((data &lt; 0x80) &amp;&amp; (flag_previous == -2)) 
    {
      velocity = data;
      
    if(pitch == previous_pitch)  // only if previous pitch is the same!...to avoid note cuts
      {
          doNoteOff(channel, pitch, velocity);
      }

      else if((pitch != p_pitch) &amp;&amp; (channel != p_channel)) // if pitch is not the same BUT from another channel
      {
            velocityData[channel + (chip_select * 4)] = 0;
            writeAmplitude(0, channel, chip_select);
      }
      flag_previous = 0;
    } </code></pre></div>]]></content>
			<author>
				<name><![CDATA[Aly James]]></name>
				<uri>https://chipmusic.org/Aly+James</uri>
			</author>
			<updated>2013-11-17T19:00:23Z</updated>
			<id>https://chipmusic.org/forums/post/191212/#p191212</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/185495/#p185495"/>
			<content type="html"><![CDATA[<p>If you wanted to get crazy, I&#039;m sure there&#039;s a way to switch between clocks based on pitch so you can get the low notes when you need them on the lower clock, and toggle to a faster clock for higher pitches.</p>]]></content>
			<author>
				<name><![CDATA[theDutchess]]></name>
				<uri>https://chipmusic.org/theDutchess</uri>
			</author>
			<updated>2013-09-25T02:13:48Z</updated>
			<id>https://chipmusic.org/forums/post/185495/#p185495</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/176019/#p176019"/>
			<content type="html"><![CDATA[<p>Worth mentioning that as we lower the master clock , we gain access to lower notes but we also reduce the pitch resolution on higher octaves <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Aly James]]></name>
				<uri>https://chipmusic.org/Aly+James</uri>
			</author>
			<updated>2013-07-07T04:36:10Z</updated>
			<id>https://chipmusic.org/forums/post/176019/#p176019</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/169756/#p169756"/>
			<content type="html"><![CDATA[<p>Sweet. It&#039;ll work for both so it&#039;s cool.</p>]]></content>
			<author>
				<name><![CDATA[Im_A_Track_Man]]></name>
				<uri>https://chipmusic.org/Im_A_Track_Man</uri>
			</author>
			<updated>2013-05-27T07:04:15Z</updated>
			<id>https://chipmusic.org/forums/post/169756/#p169756</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/169742/#p169742"/>
			<content type="html"><![CDATA[<p>Maybe not YM2149F because I have none of those here. </p><p>But I have about 15 AY38912 chips, so I can make the same thing but for 5 x AY3812 / 38910 <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[little-scale]]></name>
				<uri>https://chipmusic.org/little-scale</uri>
			</author>
			<updated>2013-05-27T04:26:15Z</updated>
			<id>https://chipmusic.org/forums/post/169742/#p169742</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/169739/#p169739"/>
			<content type="html"><![CDATA[<p>An chance of a YM2149F version?</p>]]></content>
			<author>
				<name><![CDATA[Im_A_Track_Man]]></name>
				<uri>https://chipmusic.org/Im_A_Track_Man</uri>
			</author>
			<updated>2013-05-27T03:38:05Z</updated>
			<id>https://chipmusic.org/forums/post/169739/#p169739</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/169680/#p169680"/>
			<content type="html"><![CDATA[<p>grea work!<br />sample support + an armada of pulse waves... now I will make some good use of my 10 SN76489N <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Aly James]]></name>
				<uri>https://chipmusic.org/Aly+James</uri>
			</author>
			<updated>2013-05-26T16:49:26Z</updated>
			<id>https://chipmusic.org/forums/post/169680/#p169680</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/169659/#p169659"/>
			<content type="html"><![CDATA[<p>that is insane <img src="https://chipmusic.org/forums/img/smilies/heart.gif" width="15" height="15" alt="heart" /> <img src="https://chipmusic.org/forums/img/smilies/heart.gif" width="15" height="15" alt="heart" /></p>]]></content>
			<author>
				<name><![CDATA[liquidcalm]]></name>
				<uri>https://chipmusic.org/liquidcalm</uri>
			</author>
			<updated>2013-05-26T13:29:56Z</updated>
			<id>https://chipmusic.org/forums/post/169659/#p169659</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/169653/#p169653"/>
			<content type="html"><![CDATA[<p>Firmware now supports up to four SN76489 chips. </p><p>Also added sample support. </p><p><a href="http://little-scale.blogspot.com.au/2013/05/sn76489-usb-midi-103-firmware-quad.html" target="_blank">http://little-scale.blogspot.com.au/201 &#133; -quad.html</a></p><p><img src="https://chipmusic.org/forums/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></content>
			<author>
				<name><![CDATA[little-scale]]></name>
				<uri>https://chipmusic.org/little-scale</uri>
			</author>
			<updated>2013-05-26T11:57:31Z</updated>
			<id>https://chipmusic.org/forums/post/169653/#p169653</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: LITTLE-SCALE SN76489 USB MIDI]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/169534/#p169534"/>
			<content type="html"><![CDATA[<p>YAY FOR SQUARE WAVES</p>]]></content>
			<author>
				<name><![CDATA[little-scale]]></name>
				<uri>https://chipmusic.org/little-scale</uri>
			</author>
			<updated>2013-05-25T12:46:40Z</updated>
			<id>https://chipmusic.org/forums/post/169534/#p169534</id>
		</entry>
</feed>
