Jaws was never my scene and I don't like Star Wars

Basic Electricity


by fuzzix on Sat, 27 Jul 2013 22:40. Comment.

Great Youtube Channels - Classic Game Room

OK, so the channel is InecomCompany, but that's not as interesting. Classic Game Room started out as an internet TV show (The Game Room) over 5 years before anyone had even thought of youtube, dailymotion or vimeo. The original show was presented by Mark Bussler and David Crosson - these can be found on youtube. These days it's just Mark, deadpanning his way through reviews of old and new games, systems, controllers, pinball/arcade machines, packaging, catalogues, snacks and anything else even tangentially related to gaming. I think he reviews his dog in one episode.

Here's a review for Fireshark on the Sega Genesis (because he's in that America) from 2008. Starts off pretty low-key, then he sort of goes off on one:

Star Trek The Motion Picture on Vectrex from 2010, included here because I hadn't heard of the Vectrex before seeing the show:

by fuzzix on Fri, 26 Jul 2013 18:00. Comment.

SunVox - A Modern Tracker

Well, let's start with explaining what the tracker is (wikipedia links follow, sorry). Trackers are music sequencers which use a vertically oriented timeline to arrange patterns and compositions. This is usually achieved by entering instruments, notes and effects as hex digits in the timeline. Other methods of digitally sequencing music/MIDI include the piano-roll (named after the roll in a player piano) and the stave/staff.

Depending on the capability of the machine, the instruments themselves may be manipulated samples (as with FastTracker 2), features of a sound chip (as with the use of AY envelopes in Soundtracker for the ZX Spectrum), softsynths/plugins (found frequently in modern trackers) or some combination of the above. Many sample-based trackers produce MOD files which are commonly supported by music playback software.

Wikipedia article on trackers

Wikipedia article on MOD files

The MOD Archive

SunVox is a free (as in beer, who says no to free beer?! Oh, the Android and iPhone versions cost a couple bucks), cross-platform tracker and modular synthesizer. It's also a shitload of fun and easy to get started with. Going to pass you over to SolarLune for a little bit to explain the basics:

See? Lay out a few boxes, draw a couple of lines, jam down some keys and BAM! You're making music. Easier than learning a musical instrument, though no excuse not to... Alongside the easy to use interface you have an impressive array of synths and sampler effects. Particularly good is the Analogue Generator module which can smoothly transition pitch and other parameters without the interpolation artifacts present in some of the other modules - try the touch theremin with it. The touch theremin is also great on mobile devices, supporting multitouch for wavy polysynth goodness.

Other modern trackers, such as Renoise (Multi-platform, commercial) and Jeskola Buzz (Windows, freeware) feature the ability to use VST, LADSPA and other plugins. Due to the cross-platform nature of SunVox (and iTunes store distribution rules, to some extent), supporting external executables would pose a challenge. The Metamodule feature allows you to create an instrument or effect from samples and built-in SunVox modules. You can check out Metamodules created by sunvox users on the SunVox MetaModules Sub-forum. The forums are also a good place to track development, feature requests and so on.

My first composition using SunVox was a buzzy little thing which I put together over a couple of days for a "BOX10SVC" SunVox competition - limited to 10 modules, no samplers, maximum of 8 simultaneous tracks:

Total shite really - I have no idea what I am doing - but it was fun... and the tune drives TriploidTree up the wall so all good.

by fuzzix on Fri, 26 Jul 2013 13:15. Comment.

Cross-platform File Systems

On a previous blog o' mine I wrote up a short analysis on filesystem cross-platform compatibility and large file support ("cross-platform" in this instance meaning Linux, Windows and MacOS (sorry schrodinger)).

The conclusion of this piece was "UDF FTW", apart from the trifling issue of the Linux kernel truncating the bitmap on large UDF volumes. You can see the table from the original post below - (-ish) means supported via a FUSE module included with the Linux kernel, so works out-of-the-box but is not performant.

Large Files Linux MacOS Windows XP Windows 7+
FAT No Native Native Native Native
NTFS Yes Native(-ish) Third-party Native Native
EXT 2/3/4 Yes Native Third-party Third-party Third-party
UDF Yes Native Native Native, read-only Native

Since that post, the UDF filesystem module in the Linux kernel has been patched : udf: Fix bitmap overflow on large filesystems with small block size. Time to try this again on the ol' AMD fan rattler:

fuzzix@fatboy:~$ uname -a
Linux fatboy 3.9.7 #2 SMP Sat Jun 22 02:43:26 CDT 2013 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 6000+ AuthenticAMD GNU/Linux

The last time I tried this it was on a 160G disk. I only have a 1TB volume to hand right now - it will have to suffice. So, we've created a type 06 (FAT16) partition on the disk and formatted it with:

root@fatboy:~# mkudffs --media-type=hd --blocksize=512 /dev/sdb1
root@fatboy:~# df /dev/sdb1
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sdb1      976762287   238470 976523818   1% /mnt/usb0

Few hundred MB used for the UDF bitmap - not the most efficient FS, but not bad at this scale. Once mounted, the fun begins... Let's create 15 50G files...

root@fatboy:~# for i in `seq 1 15` ; do dd if=/dev/zero of=/mnt/usb0/tmp${i} bs=104857600 count=500 ; done

Hours later (fallocate not supported)...

root@fatboy:~# ls -lh /mnt/usb0/tmp* | awk '{print $5, $9}'
49G /mnt/usb0/tmp1
49G /mnt/usb0/tmp10
49G /mnt/usb0/tmp11
49G /mnt/usb0/tmp12
49G /mnt/usb0/tmp13
49G /mnt/usb0/tmp14
49G /mnt/usb0/tmp15
49G /mnt/usb0/tmp2
49G /mnt/usb0/tmp3
49G /mnt/usb0/tmp4
49G /mnt/usb0/tmp5
49G /mnt/usb0/tmp6
49G /mnt/usb0/tmp7
49G /mnt/usb0/tmp8
49G /mnt/usb0/tmp9

Erm, 49G files - close enough! This is much further than we got last time - no longer able to write anything to the disk after 22G had been filled. We can see now that we've managed to fill a decent chunk of a 1TB volume:

# df -h /dev/sdb1 
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       932G  733G  199G  79% /mnt/usb0

Success! So in conclusion, I refer you to my original conclusion, "UDF FTW". UDF supports large files, works out of the box on (recent) Linux, MacOS X and Windows Vista+.

by fuzzix on Fri, 26 Jul 2013 09:59. Comment.

Great Youtube Channels - musictrackjp

Katsunori UJIIE demos all sorts of synths and associated kit, new and old, digital, anaologue and software. He's a great player and an enthusiastic presenter. Many videos have captions if you happen not to speak Japanese, though they are also enjoyable if these are missing.

Here's a video of him rocking hell out of an old Minimoog in need of a little work:

Part II:

by fuzzix on Thu, 25 Jul 2013 22:13. Comment.

SQL::Abstract - ANDing LIKE clauses from arrays

SQL::Abstract is a module used by DBIx::Class to generate SQL queries from Perl data structures. While writing the search function for this site (a simple ANDing of all provided terms) and misreading the documents, I attempted to abuse the ability to pass an arrayref as bind values and have the clauses expanded automatically. A simple example of this exists In the documentation.

So, we can expand an arrayref of values passed as a 'like' clause, but they are ORed by default:

$ my $sql = SQL::Abstract->new;
$SQL_Abstract1 = SQL::Abstract=HASH(0xaed0430);

$ $sql->select('table', 'text', { 'text', { like => [ '%abc%', '%xyz%' ] } }) 
$VAR1 = 'SELECT text FROM table WHERE ( ( text LIKE ? OR text LIKE ? ) )';
$VAR2 = '%abc%';
$VAR3 = '%xyz%';

Hmm, so surely if we want to and them we just wrap it in an 'and' modifier as an arrayref:

$ $sql->select('table', 'text', { 'text', [ -and => { like => [ '%abc%', '%xyz%' ] } ] })
$VAR1 = 'SELECT text FROM table WHERE ( ( text LIKE ? OR text LIKE ? ) )';
$VAR2 = '%abc%';
$VAR3 = '%xyz%';

Well, no. The 'like' clause is expanded first as before, so there's nothing to AND. The "trick" (i.e. the method as documented) is to generate separate 'like' clauses and 'and' them:

$ $sql->select('table', 'text', { 'text', [ -and => map{ like => $_ }, ('%abc%', '%xyz%') ] })
$VAR1 = 'SELECT text FROM table WHERE ( ( text LIKE ? AND text LIKE ? ) )';
$VAR2 = '%abc%';
$VAR3 = '%xyz%';

by fuzzix on Thu, 25 Jul 2013 15:06. Comment.

How to Crimp

While I recommend buying your ethernet cable, sometimes you get stuck and need to put something together quickly. Crimping your own ethernet cables is a useful skill, this post will cover the ins and outs in just a few simple steps.

Stuff you need:

Step 1: Let's start by taking the cable we wish to crimp:

The little thing that always falls off fell off!

Step 2: Now, chop that broken head off, letting it fly unseen to a location where you can step on it barefoot later.

Step 3: You'll need to slice the outer casing off with the cutting part of your crimping tool. Stick the cable into the slot leaving 2-3cm of cable on one side, twist it 360°, the casing should come clean away. It should, but it won't. Just tear it off.

Cable in the "cutting" tool - better off using your teeth.

Step 4: Now that you've exposed the 8 cores in your cable, examine them for nicks and scores around where you cut the casing away. Say to yourself "Meh, will probably be fine" every time you spot one.

Step 5: Arrange the cores in the following order between your thumb and forefinger: Orange-white, orange, green-white, blue, blue-white, green, brown-white, brown. This will feel like it takes about an hour to get right but you'll be surprised when only 15 minutes has passed. The suggested expletive for this phase is "you fucking slippery little bastards!"

OK, finally have them in the right order.

Step 6: You'll need to slice a tiny bit off the cores to make them the same length before putting them into the plug, use the crimper's "cutting" tool for this, or a pair of scissors or just dont bother - close enough!

...and cut uniformly

Step 7: Time to place the cores into the plug, making sure to retain the correct ordering. Push the cores into the slots on the plug, with the bit that always breaks off the plug facing down. Then grasp the casing and push them all the way to the top of the plug. This will take about 5 tries and you'll repeat Step 5 at least once.

Only had to repeat step 5 once! Naaah!

Step 8: Time to crimp! Place the plug into the crimper so the pins face its little teethy things. Depending on how cheap your crimper is, these teeth might not even match up with the plug so you'll need to wiggle everything until they do. Once that's done, give the tool a few good squeezes, being careful to mess up the blade on the "cutting" part a little bit.

Hey, it actually lined up this time.

Step 9: Testing time. Place the ends of your cable into the tester, hit the button and swear profusely - pins 5 and 6 not connected! Fucking shitty crimper! Repeat step 8 up to twice more. If the test continues to fail you can go back to Step 2 or you can do this. I mean, how badly do you need it right now? It's not that hard!

It is that hard - if you see this first time, call the pope.

Anyway, thanks for reading. I hope this has been enlightening. Stay tuned for my upcoming howto, "Soldering for software engineers".

by fuzzix on Wed, 24 Jul 2013 11:27. Comment.

Input Magazine Scans

Those of you who grew up in the 1980s may remember the weekly programming course, Input.

Aspects I remember from this series are great presentation and jumping right into the "advanced" stuff early on - within a few issues you were armed with an assembler (as long as you typed it correctly and could wait for the inevitable errata section) and a handful of listings for your platform. It also covered other languages like LISP and Forth in enough detail to start using them.

Some kind soul has taken the time to scan and publish the entire set of Input Magazine in high-resolution PDFs.

You'll still have to type the programs in yourself... :)

If you don't happen to own any of the machines covered in the series you could try out some of these emulators:

Fuse - the Free Unix Spectrum Emulator
z81 - Sinclair ZX81 emulator (See also, EightyOne for Windows)
VICE - C64/128, VIC20, PET Emulator
BeebEm - BBC Micro and Master 128 Emulator (Unix port)
Elkulator - The Acorn Electron emulator
XRoar - Dragon & Tandy Colour Computer Emulator
SDLTRS - TRS-80 Emulator

by fuzzix on Mon, 22 Jul 2013 12:53. Comment.

Pump Iron

by fuzzix on Mon, 22 Jul 2013 11:03. Comment.


by fuzzix on Fri, 19 Jul 2013 15:49. Comment.

< Older Newer >