<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[ChipMusic.org - mgb and pitch bend steps, only 32 frequency steps?]]></title>
		<link>https://chipmusic.org/forums/topic/9544/mgb-and-pitch-bend-steps-only-32-frequency-steps/</link>
		<description><![CDATA[The most recent posts in mgb and pitch bend steps, only 32 frequency steps?.]]></description>
		<lastBuildDate>Sat, 22 Dec 2012 20:52:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147667/#p147667</link>
			<description><![CDATA[<b><i>Trash80 says:</i></b><div class="quotebox"><cite>lastfuture wrote:</cite><blockquote><p>It&#039;s quite alright. Just find it fascinating that the entire lower half pitch bend goes weird the second the note is a semi tone &quot;too low&quot; especially since the bend would theoretically go through all the same pitches as the one above it except one semi tone at the very bottom of the range.<br />I don&#039;t find this fatal at all, I just don&#039;t understand how it happens. I agree that it adds some interesting glitch potential, especially when using it on notes well outside the range below C-3 <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p></blockquote></div><p>It&#039;s most likely because the math exceeds a 16 bit number, thus wrapping the bits and causing the glitch.</p>]]></description>
			<pubDate>Sat, 22 Dec 2012 20:52:18 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147667/#p147667</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147663/#p147663</link>
			<description><![CDATA[<b><i>lastfuture says:</i></b><p>It&#039;s quite alright. Just find it fascinating that the entire lower half pitch bend goes weird the second the note is a semi tone &quot;too low&quot; especially since the bend would theoretically go through all the same pitches as the one above it except one semi tone at the very bottom of the range.<br />I don&#039;t find this fatal at all, I just don&#039;t understand how it happens. I agree that it adds some interesting glitch potential, especially when using it on notes well outside the range below C-3 <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<pubDate>Sat, 22 Dec 2012 20:12:44 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147663/#p147663</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147659/#p147659</link>
			<description><![CDATA[<b><i>Trash80 says:</i></b><p>Yeah as I said before there is no &quot;if&quot; condition to lower bound pitches. Adding it just adds overhead that is easy to avoid. Also it can be seen as a feature for glitchy effects. <img src="https://chipmusic.org/forums/img/smilies/wink.png" width="15" height="15" alt="wink" /> The large pb range wrap around is probably because it exceeds the 16bit unsigned int, I don&#039;t want to move it to a 32 bit, again because of overhead. I think its a fair trade off with the increased resolution.</p>]]></description>
			<pubDate>Sat, 22 Dec 2012 19:42:37 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147659/#p147659</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147581/#p147581</link>
			<description><![CDATA[<b><i>lastfuture says:</i></b><p>Tested it. It&#039;s much better, again. It still glitches under certain conditions and I think I may have found out what those may be, but they&#039;re far less likely to occur in any normal use case I&#039;m assuming.</p><p>These are the conditions I managed to find in which it glitched:</p><p>- If the lowest possible note in the pitch bend range is lower than C-3 it will glitch below 0% pitch bend but not above (examples: C-3 is the first note it will glitch on with pb range 1, C#3 with pb range 2, B-3 with pb range 12(dec) ...) basically if you subtract the pb range in semitones from the note you&#039;re playing and the result is lower than C-3 the pitch bend will glitch the moment it goes below 0%</p><p>- low notes at bigger pitch bend ranges... like C-5 with pb range 24(dec) will still exhibit the wraparound problem in the pitch bend values closer to -100% even though the lowest note that should be produced is not below C-3</p><p>that first one is definitely odd behavior, though I personally don&#039;t see myself using pitch bend of 12(dec) on a note as low as C-4 ... perhaps others might? not sure<br />I&#039;m also not seeing myself using pitch bend ranges outside 12, so the second one seems to be a non-issue as well for me personally.</p><p>tl;dr: Thank you trash80, I&#039;m happy with the result, it seems very usable for me now Bugs/glitches are still present though and somebody else may stumble across them.</p><p>Feel free to ask me to test some more. I&#039;ll be away for the holidays though and probably without my DMG, so testing may have to wait.</p><p>Audio example demonstrating glitch #1: C-4 vs B-3 (only one semi tone apart) with the identical pitch bend&nbsp; at a range of 12(dec) ... the second note is only slightly deeper but experiences the glitches right as pitch bend goes below 0%, the first note shows no problems at all.</p><p><a href="http://wolkenspeicherplatz.de/sound/mgb_pitchbend_comparison_2.mp3" target="_blank">http://wolkenspeicherplatz.de/sound/mgb &#133; ison_2.mp3</a></p>]]></description>
			<pubDate>Sat, 22 Dec 2012 05:17:38 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147581/#p147581</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147531/#p147531</link>
			<description><![CDATA[<b><i>Trash80 says:</i></b><p>Okay updated to 1.3.3 ... Let me know how it goes.</p><p><a href="http://code.google.com/p/arduinoboy" target="_blank">http://code.google.com/p/arduinoboy</a></p>]]></description>
			<pubDate>Sat, 22 Dec 2012 00:02:54 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147531/#p147531</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147521/#p147521</link>
			<description><![CDATA[<b><i>Trash80 says:</i></b><p>Oh wait I see... let me look.</p>]]></description>
			<pubDate>Fri, 21 Dec 2012 22:46:05 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147521/#p147521</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147514/#p147514</link>
			<description><![CDATA[<b><i>Trash80 says:</i></b><p>It&#039;s not the math, you are hitting the lowest note possible and it&#039;s wrapping. I could put in a if condition to avoid the wrapping, but that adds overhead. Every instruction counts to keep up with MIDI data on a DMG.</p>]]></description>
			<pubDate>Fri, 21 Dec 2012 22:22:14 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147514/#p147514</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147441/#p147441</link>
			<description><![CDATA[<b><i>lastfuture says:</i></b><p>Thank you for the new version trash80. I&#039;ve put it through its paces and the pitch bend is really a lot smoother.</p><p>Your math seems to be off though, I&#039;m testing with pitch bend range 0C and experiencing weirdness starting at notes below C-5: The pitch bend starts wrapping around at negative pitch bend values. At first only towards the end close to -100%, but the lower the note gets the earlier it happens, and finally at notes below B-3 things are starting to go random, with a random pitch jump for any value in negative pitch bend land. That&#039;s also the point where the positive pitch bend starts wrapping around like the negative did for notes below C-5.</p><p>I&#039;ve recorded two simple examples to test the smoothness, when I noticed it happening to me. I&#039;m playing a C-5 on PU2 and a C-4 on PU1 with a PB range of 0C being one octave up and down.<br />For the C-4 it wraps around at -50%, the next lower value jumping the pitch back to its original pitch. Take a listen. First mgb 1.3.2 and afterwards mgb 1.3.0 for smoothness comparison. Notice that the wraparound doesn&#039;t happen in 1.3.0</p><p><a href="http://wolkenspeicherplatz.de/sound/mgb_pitchbend_comparison.mp3" target="_blank">http://wolkenspeicherplatz.de/sound/mgb &#133; arison.mp3</a></p><p>this is my automation curve for both channels<br /><a class="postimg" href="http://wolkenspeicherplatz.de/bilder/pitchbend_automation.png" title="http://wolkenspeicherplatz.de/bilder/pitchbend_automation.png" id="forum_image_8046113"><img src="http://wolkenspeicherplatz.de/bilder/pitchbend_automation.png" /></a></p>]]></description>
			<pubDate>Fri, 21 Dec 2012 09:22:51 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147441/#p147441</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147368/#p147368</link>
			<description><![CDATA[<b><i>Trash80 says:</i></b><div class="quotebox"><cite>fluxer wrote:</cite><blockquote><p>What is your current math, out of curiosity?</p></blockquote></div><p>The shifting is to give some precision to avoid floating point math...<br /></p><div class="codebox"><pre><code>if(pbWheelIn[synth] &amp; 0x80) {
    currentFreq = freq[noteStatus[synth_pitch]] + (((freq[pbNoteRange[synth_note_range+1]] - freq[noteStatus[synth_pitch]]) * (((pbWheelIn[synth] - 0x79)&lt;&lt;7) / 0x80))&gt;&gt;7);
} else {
    currentFreq = freq[noteStatus[synth_pitch]] - (((freq[noteStatus[synth_pitch]] - freq[pbNoteRange[synth_note_range]]) * (((0x80 - pbWheelIn[synth])&lt;&lt;7) / 0x80))&gt;&gt;7);
}</code></pre></div><p>I changed it to +-7 bit precision. Check it out now: (v1.3.2)<br /><a href="http://code.google.com/p/arduinoboy/" target="_blank">http://code.google.com/p/arduinoboy/</a></p><p>And I&#039;ll optimize this later and rewrite it in asm. Don&#039;t have time lately.</p>]]></description>
			<pubDate>Fri, 21 Dec 2012 01:44:14 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147368/#p147368</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147259/#p147259</link>
			<description><![CDATA[<b><i>lastfuture says:</i></b><p>it would be good if somebody could confirm that this also happens with an arduinoboy and is not a problem specific to the nanoloop usb dongle</p>]]></description>
			<pubDate>Thu, 20 Dec 2012 10:47:31 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147259/#p147259</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147258/#p147258</link>
			<description><![CDATA[<b><i>fluxer says:</i></b><p>Well I did some math of my own, and generated a frequency look-up table using MaxMSP, dividing each semitone into 128 parts.</p><p><a href="https://www.dropbox.com/s/bgcok8265ixpe4x/gb-freq-table.txt" target="_blank">https://www.dropbox.com/s/bgcok8265ixpe &#133; -table.txt</a></p><p>There are 9216 values total. The first value is the lowest C, and every 128th value after that is the equivalent of a non-pitch-bended note one semitone higher than the previous. (the 129th value is C#, 257th value is D, etc).</p><p>Not pressuring you Trash80 or anything, I just thought maybe I could help out a bit <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<pubDate>Thu, 20 Dec 2012 10:44:32 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147258/#p147258</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147238/#p147238</link>
			<description><![CDATA[<b><i>fluxer says:</i></b><p>What is your current math, out of curiosity?</p>]]></description>
			<pubDate>Thu, 20 Dec 2012 07:01:39 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147238/#p147238</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147236/#p147236</link>
			<description><![CDATA[<b><i>Trash80 says:</i></b><div class="quotebox"><cite>fluxer wrote:</cite><blockquote><p>Thank you Trash80! I will most likely try it out tomorrow.</p><p>The 32-step pitch bend is apparent even on low to mid range notes. Is the NanoUSB at fault here then? Is it only sending mGB a 5-bit pitchbend signal?</p><p>Can anyone with an Arduinoboy confirm that mGB will interpret higher-res pitch-bend messages sent from one?</p></blockquote></div><p>It may well be 32 steps at the fault of my math. (I do some shifting for precession since there are no floats) It&#039;s tricky to get the little guy working properly with as few instructions as possible. Maybe I&#039;ll rewrite it at a later time to use some sort of scaled lookup or something else.</p>]]></description>
			<pubDate>Thu, 20 Dec 2012 06:51:59 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147236/#p147236</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147233/#p147233</link>
			<description><![CDATA[<b><i>fluxer says:</i></b><p>Thank you Trash80! I will most likely try it out tomorrow.</p><p>The 32-step pitch bend is apparent even on low to mid range notes. Is the NanoUSB at fault here then? Is it only sending mGB a 5-bit pitchbend signal?</p><p>Can anyone with an Arduinoboy confirm that mGB will interpret higher-res pitch-bend messages sent from one?</p>]]></description>
			<pubDate>Thu, 20 Dec 2012 06:22:24 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147233/#p147233</guid>
		</item>
		<item>
			<title><![CDATA[Re: mgb and pitch bend steps, only 32 frequency steps?]]></title>
			<link>https://chipmusic.org/forums/post/147180/#p147180</link>
			<description><![CDATA[<b><i>Trash80 says:</i></b><div class="quotebox"><cite>fluxer wrote:</cite><blockquote><p>In my experience, only PU2 consistently demonstrates this feature, and for PU1 you need to mess will the channel parameters a little bit (change pulse with, envelope, sustain on/off) and then the feature kicks in.</p></blockquote></div><p>Found the bug on PU1, it doesn&#039;t work if the Envelope is set to the 8th setting (the setting that is right before full sustain)<br />Weird, it may be a compiler issue. GBDK is really buggy- though that code is written in assembly.</p><p>*edit* mGB now to version 1.3.1 - Fixed this bug.</p><p><a href="http://code.google.com/p/arduinoboy/" target="_blank">http://code.google.com/p/arduinoboy/</a></p>]]></description>
			<pubDate>Wed, 19 Dec 2012 23:44:40 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/147180/#p147180</guid>
		</item>
	</channel>
</rss>
