COLOURCUBE: Executable or Text Version

The program will display 16.8 million colours (eventually), by displaying random "slices" through a cube of colours, with Red, Green and Blue ranging from zero to full strength along three main edges which meet at the Origin - being pure Black in colour. The opposite vertex is pure White in colour.

If you have BBC BASIC for Windows, you can cut and paste the
TEXT Listing and it will RUN.Press any key to STOP the program once the current slice has finished displaying, then any other key to EXIT.Alternatively, press the -Esc- key at any time.

This program really doesn't achieve much - but is a good example of how to set up and use embedded Assembly Language in BBC Basic for Windows, especially conditional once-only compilation at run-time encapsulated in a single procedure, using private variables.

Bouncing Balls: Executable or Text Version

Up to FIFTEEN balls bounce around the screen and off each other, according to their "bouncy-ness", by selecting the Coefficient of Restitution.

The balls travel in parabolas in accordance with very simple projectile theory.

The only complicated bit of Maths comes in when the balls hit each other, when you need to work out the velocity components along the line of contact and perpendicular to it, using simple vector formulae.

Quasi Random Music: Executable or Text Version

Despite the seemingly odd anomalies in musical scales (the intervals between the notes of the standard Major and Minor scales are not all the same, for example), ALL the Major and Minor scales and their standard chords lend themselves to a scaleable mathematical structure. That's not evident on a piano keyboard, but it's sort-of "obvious" to every guitar player, since each chord shape can be shifted up and down the fretboard, and it sounds "the same", but higher or lower in pitch.
My program revolves around randomly chosen arpeggios of the 7 extended Triads in each Major or Minor key.

To finish, there's also a Coda of one of my own pieces (it sounds infinitely better on a real guitar, of course), which uses one of my favourite weird chords - the "add #11". The piece uses the A6, E6, Dsus2 and D(#11) chords, and is in the key of A Major.

Celestial Chords: Executable or Text Version

This program was a bit of an accidental discovery, in reality. It uses the built-in MIDI instruments in your PC to play a number of different chords ALL based around the SAME root-note. Then it switches to another root note. It uses all 45 "nameable" chords (all Minor, Major, Dominant, Diminished, Augmented and Altered types), but excluding so-called polytonal "slash" chords, with an additional bass note, and excluding inversions of all the above. That's still 12 x 45 = 540 chords altogether.

I was surprised it sounded good, since this outcome was a trial-run on the way to doing something else.

The user can choose one from 120 of the built-in MIDI instruments.

3 Body Problem: Executable or Text Version

Here, the double-iteration Improved Euler method is perfectly accurate enough, rather than the more sophisticated (but rather slower) Runge-Cutta method, so long as I reduced the time-steps whenever there is a "close encounter" of any 2 planets.

The program numerically solves a system of 6 pairs of inter-dependent or coupled 2nd order non-linear differential equations "on the fly". The continuing check on the accuracy of calculations is the Energy Error; in theory the energy should remain constant.

N-Body Problem: Executable or Text Version

I'm surprised I managed to get this program to work beyond just a few iterations, but it's very well-behaved. It simulates any number of Asteroids near a more massive Planet, all moving under the combined influence of each others' gravity. It gets too slow beyond about 500 Asteroids, and I had to compromise a bit of accuracy for execution speed.
Luckily, our own Solar System of planets appears to be in a very long period of stable trajectories, but it is nonetheless as inherently UNstable as the mish-mash of paths generated by the 3 Body program.

Return to Top Page

Next Page