<rss version="2.0">
<channel>
<title>Memecode</title><description>Software and Coding</description>
<language>en-us</language>
<link>http://www.memecode.com/news.php</link>
<copyright>Copyright 2012, Matthew Allen</copyright>
<pubDate>Thu, 26 Apr 2012 23:28:43 +1000</pubDate>
<lastBuildDate>Thu, 26 Apr 2012 23:28:43 +1000</lastBuildDate>
<item>
<title>Converting audio samples to dB and back</title>
<link>http://www.memecode.com/news.php?id=845&amp;comments=1</link>
<description>I've been writing a tool to normalize lots of audio files at once, as well as convert between various loss-less formats (particularly FLAC and WAV). In doing that I needed a way of converting between the raw audio sample maximum and dB. So I present to you my C functions for doing so:
&lt;pre&gt;double LinearToDb(int32 linear, int bitDepth)
{
    uint32 MaxLinear = (1 &lt;&lt; (bitDepth - 1)) - 1;
    uint32 ab = linear &gt;= 0 ? linear : -linear;
    return log10((double)ab / MaxLinear) * 20.0;
}

int32 DbToLinear(double dB, int bitDepth)
{
    uint32 MaxLinear = (1 &lt;&lt; (bitDepth - 1)) - 1;
    double d = pow(10, dB / 20);
    return d * MaxLinear;
}&lt;/pre&gt;

Another code snippit for Google to index.</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=845</guid>
<pubDate>Thu, 26 Apr 2012 23:28:43 +1000</pubDate>
</item>
<item>
<title>XCode: error from debugger: the program being debugged is not being run.</title>
<link>http://www.memecode.com/news.php?id=835&amp;comments=1</link>
<description>If you are getting this in your XCode run log:
&lt;pre&gt;Running...
No executable file specified.
Use the &quot;file&quot; or &quot;exec-file&quot; command.
No executable file specified.
Use the &quot;file&quot; or &quot;exec-file&quot; command.
The program being debugged is not being run.
The program being debugged is not being run.&lt;/pre&gt;

After copying a project and renaming everything... then you missed the 
&quot;executable name&quot; on the target. Click your Target, and &quot;Get Info&quot;, then click 
the Properties tab, and rename the Executable to the same name as the 
Product Name in the Build settings.</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=835</guid>
<pubDate>Sun, 15 Apr 2012 11:55:57 +1000</pubDate>
</item>
<item>
<title>DeleteFile failure on long paths.</title>
<link>http://www.memecode.com/news.php?id=825&amp;comments=1</link>
<description>Symptom: &lt;a href=&quot;http://msdn.microsoft.com/en-
us/library/windows/desktop/aa363915(v=vs.85).aspx&quot;&gt;DeleteFile&lt;/a&gt; fails with ERROR_PATH_NOT_FOUND (3) when passed a path with a length greater than 260 characters.
&lt;p/&gt;
This manifested for me when I copied a Windows XP home folder to a backup drive. The &quot;Temporary Internet File&quot; folder contains a lot of files with very long names. When you put those in a sub-folder with a long name, the total path length of those files tips over the 260 character 
limit. At that point Windows Explorer just fails to do anything useful on those files. In my case I just want to delete them. So I was poking around with i.File in an attempt to work out why these files can't be deleted. Turns out DeleteFile simply fails with super long paths.
&lt;p/&gt;
The way around this is to share the drive with the long paths on it. Then map a drive to a deep sub-folder to reduce the file's path length to under 260 characters. THEN delete it using traditional methods.</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=825</guid>
<pubDate>Fri, 09 Mar 2012 12:10:42 +1100</pubDate>
</item>
<item>
<title>Mac OS X Software Update fails to update installed application.</title>
<link>http://www.memecode.com/news.php?id=815&amp;comments=1</link>
<description>I've just managed to &quot;fix&quot; an issue that I was seeing on 10.6 where Software 
Update would not update Logic Express. According to Software Update, Logic 
wasn't even installed, however the app was there in /Applications and would 
run fine.&lt;br&gt;
&lt;br&gt;
It seems that getting Software Update to re-scan that app is as simple as 
renaming the app. I changed the name of Logic Express from &quot;Logic Express 
9.0.1&quot; to just &quot;Logic Express&quot;, ran Software Update again and the latest 
release for Logic magically appeared. Hmmm.&lt;br&gt;
&lt;br&gt;
So the next time Software Update is ignoring your installed apps you know 
what to do!</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=815</guid>
<pubDate>Tue, 21 Feb 2012 12:02:00 +1100</pubDate>
</item>
<item>
<title>iconv v1.9.1 win32/win64</title>
<link>http://www.memecode.com/news.php?id=805&amp;comments=1</link>
<description>I've posted a source and binaries zip of iconv for win32 and 
win64 on the &lt;a href=&quot;libs.php&quot;&gt;Libraries&lt;/a&gt; page.</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=805</guid>
<pubDate>Sat, 12 Nov 2011 17:24:28 +1100</pubDate>
</item>
<item>
<title>Axefx Foot Controller</title>
<link>http://www.memecode.com/news.php?id=795&amp;comments=1</link>
<description>After some months of work I've finally got my Axefx foot controller kit up for &lt;a href=&quot;http://www.memecode.com/hw/mc1&quot;&gt;sale&lt;/a&gt;. I've updated the index page to have both software and hardware sections... because apparently I do hardware too now :)</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=795</guid>
<pubDate>Wed, 22 Jun 2011 09:59:43 +1000</pubDate>
</item>
<item>
<title>Wrapping Up Controller Testing</title>
<link>http://www.memecode.com/news.php?id=785&amp;comments=1</link>
<description>So in the last few days I've finished the controller test 
board, ironed out a few bugs in the firmware code, hooked up 
the midi ports and tested that they are sending and 
receiving 
the right data. The board looks like it's doing all the 
things it's meant too. Which means I can now start moving 
ahead on making the kit available. What's left to do is 
write 
up the documentation of how to build a kit from the parts 
and 
PCB and work out the business details, like shipping 
weights/costs and a purchase page.&lt;br&gt;
&lt;br&gt;
Today I also printed out the new graphics that are laid out 
for the Hammond box and checked them for accuracy.&lt;br&gt;
&lt;center&gt;
&lt;img 
src=&quot;http://www.memecode.com/images/blog/axefx/box_graphics.
jpg&quot;&gt;
&lt;/center&gt;&lt;br&gt;

It's sitting next to the prototype box, which is a different 
aspect ratio. The plan is to get someone to print it out 
onto adhesive backed vinyl and then stick it straight onto 
the aluminium, cut the holes out with a hobby knife and then 
poke all the pots, switches and LED's through. There are 
some more knobs coming from the UK for both my own 
controller and the kits.</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=785</guid>
<pubDate>Mon, 20 Jun 2011 21:40:55 +1000</pubDate>
</item>
<item>
<title>Controller Update</title>
<link>http://www.memecode.com/news.php?id=775&amp;comments=1</link>
<description>Last night I got some time to work on the MIDI controller 
testing. The problem I was left with is that the parameter 
knobs were not working, so I started with printing out the 
current value for param0 on the LCD and it was always 1023 
(the maximum value) no matter what voltage was supplied on 
the input pin. So I teared down all the setup code and 
checked that I was doing everything right in the software... 
which after an hour or so of re-reading all the docs... yes; 
I'm doing everything right. Ok that leaves hardware. So I 
measured the voltage on the input pin again... yup that's 
right too. *sigh* Then I notice there is a &quot;VREF&quot; pot on the 
AVR stamp... wonder what that does? Tweak tweak... oooh look 
the value on the LCD is finally changing! Seems that VREF 
pot on the stamp is controlling something to do with the way 
the AVR reads values on it's analog in pins, so I'll have to 
write that into the documentation to set correctly when 
assembling the kit. So hurrah the parameters are all working 
pretty much correctly and I can test the new menu code on 
the hardware. I'm getting close to being done with the 
testing. All that remains is hooking up the MIDI sockets and 
checking the right messages get sent and received.</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=775</guid>
<pubDate>Fri, 17 Jun 2011 10:30:38 +1000</pubDate>
</item>
<item>
<title>Midi Foot-controller Update</title>
<link>http://www.memecode.com/news.php?id=765&amp;comments=1</link>
<description>Last night I investigated whether I could compile and flash 
the ROM from Windows7 64bit. The compiling side was fine, I 
could build the binary but the program I was using to flash 
that binary onto the AVR chip via the parallel port doesn't 
work on Windows7-64bit. Which isn't to say you can't do AVR 
development on Win7 but it just means that different 
software is needed. On XP I've been using PonyProg2000 with 
a lot of success.&lt;br&gt;
&lt;br&gt;
On the hardware front, I wired up all the pots to the test 
harness and checked they were applying the right voltage to 
the analog pins. I've soldered those onto the PCB traces and 
not the pads because it's a pain removing wires from pads 
and then trying to get the solder out and put something else 
in.&lt;br&gt;
&lt;br&gt;
Software wise I have re-written the menu and not everything 
is hooked up at the moment. So I spent some time uncommented 
some sections of the controller code and got them compiling 
with the new menu layout. The structure of things in memory 
(both RAM and EEPROM) has changed to make things more 
flexible and those changes need to be propagated out to all 
the rest of the code. (Parts that didn't compile originally 
have been commented out). Also I put together a Visual 
Studio 2005 project for the desktop version of the 
controller.&lt;br&gt;
&lt;br&gt;
And I'm loving zip ties at the moment... they make things so 
much more organized.</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=765</guid>
<pubDate>Wed, 15 Jun 2011 10:55:08 +1000</pubDate>
</item>
<item>
<title>64bit Adventures</title>
<link>http://www.memecode.com/news.php?id=755&amp;comments=1</link>
<description>I've been playing around with 64bit builds of &lt;a 
href=&quot;http://www.memecode.com/scribe.php&quot;&gt;Scribe&lt;/a&gt; on 
windows. And it's been er... interesting to say the least.
&lt;ul&gt;
&lt;li&gt; By default the Visual Studio 2005 installed doesn't 
install the x64 compiler and libraries. Nice...
&lt;li&gt; When you do get that installed, and then create an x64 
profile in your solution you get the option to copy the 
settings from the 32bit profile. Which for the most part 
works, but when you try and compile said x64 profile, you 
discover this delightful error:
&lt;pre&gt;fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'&lt;/pre&gt;
Which in a nutshell means you are linking 64bit objects into 
a 32bit binary. However the standard response that people 
get on the forums is that you have to set your Linker-
&gt;Advanced-&gt;TargetMachine correctly. And you know what? Well 
it WAS set correctly to MachineX64. So what gives? Well if 
you click on Linker-&gt;CommandLine and look in &quot;Additional 
Options&quot; you'll see /MACHINE:I386. Sigh.
&lt;li&gt; When running Windows7 64bit and you put additional 
32bit DLL's in C:\Windows\System32 you'd think... that since 
there is a &quot;32&quot; in that folder name that is where they go. 
Well no... the 64bit DLL's go in System32 and the 32bit 
DLL's go in &quot;System&quot;. Gaaaaahhhhh.
&lt;/ul&gt;
But at the end of the day, there it is... 64bit Scribe:
&lt;center&gt;
&lt;img 
src=&quot;http://www.memecode.com/images/blog/scribe/scribe64.png
&quot;&gt;
&lt;/center&gt;</description>
<guid isPermaLink="true">http://www.memecode.com/news.php?id=755</guid>
<pubDate>Sat, 11 Jun 2011 16:10:42 +1000</pubDate>
</item>
</channel>
</rss>

