game_controller

So You’re Going To Make A Game For The Very First Time?

You’ve thought about making games for a long time, but you haven’t seriously pursued it. Until you get serious about it, you’ve accomplished nothing, you’re a mere dilettante. So today you’ve decided to make a game. How are you going to go about it?

First, unless you have well-developed programming skills you’re going to have a much better chance of achieving something if you make a tabletop game, or (perhaps) make a level for a videogame. The most important thing is to get to where you play the game. All the idea generation and other preliminary stuff is effectively airy-fairy head-in-the-clouds daydreaming that almost anyone can do but which does them no good if it doesn’t result in a playable prototype. Without well-developed programming skills or at least a good working knowledge of small game engine such as Gamemaker, you won’t be able to make a videogame prototype soon enough for it to be practical. You may be able to use a level editor that’s included in an existing game to make a variation, and that can be a good way to start.

Second, beginners almost always make a game based on another game. Often the best way to start out is to make a variation of an existing game, because it takes a lot less time and work to get to the point where you can play it. Again this applies to tabletop games or to video games that provide ways to modify them, usually a level/scenario editor. If you can’t bring yourself to make tabletop games then the level editor is definitely the easiest way to start out, even though you’ll have to learn how to use the level editor, a non-trivial task.

Third, reign back your ambition. Try to pick a type or form of game that is fairly common, not one that’s unusual; unusual forms are frequently more difficult to achieve, that’s why they’re unusual. For example, cooperative games are especially difficult in tabletop form because it’s so hard to provide significant opposition. This is much easier to do with a videogame IF you have the programming and “artificial intelligence” skills. But it is still much harder to program a game that can be played by two or more people at the same time, than to program one that is played by one person at a time.

In other words try to choose a project you actually have a chance to complete. This can be generalized to “keep it simple”. Making a game is almost always harder than it seems at first, even for experienced people. The most common mistake of people seriously trying to make a video game is to plan a project that they have virtually no chance of ever finishing, because it will take much too long. Remember, AAA video games take hundreds of man-years to complete for professionals with vast budgets.

Fourth, focus on the gameplay not on the appearance (or the story) of the game. You’re making a prototype, not a finished game. You want something that people can play so that you find out whether they enjoy playing, and how you can improve it. You can’t rely on flashy looks to make games fun, even if you’re an outstanding artist. A major mistake of novice game designers is to make something that’s pretty rather than something that’s functional. If you have something that just looks functional and people like to play then imagine how much more they’ll enjoy it when it looks professionally pretty. You only need it to look good enough that playtesters will be willing to play, and that depends in great part on what playtesters are available, how well you know them, how persuasive you are, and many other factors not related to the game itself.

In most cases, you may be excited about your story, but other people won’t be. Most games are played for the game, not the story (which is often only an excuse to get to the action). If you’re heavily into story, write a novel, don’t design a game! When you’re experienced you may be able to rely on a story to make a game enjoyable, when you start out that’s a big mistake.

Fifth, when you have a playable prototype play it yourself, solo, before you inflict on other people. I say “inflict” deliberately. You may be super excited, you may think it’s the greatest thing ever, but in reality it will be like almost every other initial prototype of a game, it will suck. Experienced designers have a much better chance of recognizing what will suck before the game is played: they play the game in their mind’s eye, so to speak, and anticipate many problems before it’s ever played in reality. Beginners should try to do the same but will be much less successful at spotting the flaws. What solo testing can do is quickly reveal where the game really sucks so that you can change it before other people have to put up with it. In other words, be nice to your playtesters: get rid of the really bad aspects yourself rather than foist them on other people who want to play a fun game.

Some people confronted with the notion of solo playing a multiplayer tabletop game will say they just can’t do it, they just can’t dissociate themselves from one side when they play another side. Wags like to say “well at least when you play solo always win”. Of course you also always lose. But the point of solo playtesting is not to win or lose, it’s to find out whether the game is worthwhile and how it can be improved. And that dispassionate dissociation from one side to another when you play a solo game will actually help you recognize what’s good and bad about the game.

I cannot say this enough: play the game yourself before anybody else plays.

Sixth, if you got this far you’re doing really well. But you’ve only just begun. The really hard part of making a game is a last 20% of improvement that takes 80% of the time. This is a process of playtesting, evaluating the results, modifying the game to improve it in light of the results, playtesting again, and going through the whole cycle again and again and again. This is called the iterative and incremental development of the game. If you want to make a really good game then you are probably going to be sick and tired of it by the time you get toward the end of this process.

Finally, the game is never really done, you just come to a point where the value of the improvement is less than the cost of the time required to achieve it (Law of Diminishing Marginal Returns). Moreover, you might think you’re “done”, and then find out that improvements need to be made either for your peace of mind or because the publisher requires it.

Good luck. And remember: “A designer knows he has achieved perfection not
when there is nothing left to add, but when there is nothing
left to take away.” Antoine de Saint-Exup’ery

Summary:
• make a tabletop game, or use a simple level editor to modify an existing videogame
• make something based on a game you know
• reign in your ambition–try to complete a small project, not a large one
• focus on gameplay not prettiness or story
• play the game yourself before anybody else plays, even if it isn’t intended to be a one person game
• iteratively and incrementally playtest and improve the game
• your never really finish

Dilla-Time-thumb

DillaTime

These days I’m having an amazing time reading Dan Charnas’ book Dilla Time, enjoying the blending of historic biography and musical breakdowns. If you read my blog you’ll know I’m a fan of visual representations of music and sound and Dilla Time’s central sentiment is best summarized by this image of J Dilla’s main approach to juxtaposing varying rhythmic feels:


Straight time is best described as rhythm that is evenly spaced and metronomic, like a clock ticking. Swing time typically means that the second half of each beat is delayed in a laid-back feel. (think of most Count Basie tunes.)


Dilla time means that there are multiple rhythmic time feels simultaneously, some straight, some swinging, either right on the grid or ahead of or behind the grid. Listen to what J Dilla did with Herbie Hancock’s classic Watermelon Man:


J Dilla’s approach to creating music is not easily summarized with traditional musical notation and goes further than simply layering multiple rhythmic patterns in a typical polyrhythmic style. It’s as though different drummers were playing each component of a drum set. The person playing the kick drum would play behind the beat, the one playing the snare would play just a hair ahead – pushing the beat and the high hats roughly on the grid or slightly behind with a bassline just behind the beat. This approach was so unique when it came to creating beats on drum machines that J Dilla has earned a spot in music history.

There’s more to dig into about Dilla’s signature grooves and I’m sure to write a few more posts about it…

IMG_20101202_071939

Modding a SD-1 Pedal

I’ve had a Boss Super Overdrive pedal on my pedalboard for decades, it’s gives me a crunchy overdriven tube amp sound at lower volumes and now that I’m comfortable with modifying my guitar pedals I’ll take the soldering iron to this old classic.

Today I started with the Brian Wampler’s Cuervo Mod, which I found in his book How to Modify Guitar Pedals, more of a half-baked collection of mods than a book, but we should support the guy that almost single-handedly started the whole pedal modding community.

There’s a few popular mods for the SD-1, it’s an easy pedal to modify because the PCB is spacious and gives you lots of room to add components. The SD-1 circuit is a slight variation of the famous Tube Screamer (TS-808) pedal and many of the mods are about making more like the TS-808. I’ve built a few TS-808 clones and would rather make the SD-1 have it’s own character. I’d like to have my SD-1 have a tad more distortion and have a bit more headroom, it’s seems to compress the guitar’s signal a fair bit and takes away some of the dynamics.

a typical Super Overdrive to TS-808 Mod

How do you like your Clipping?

You can get different types of distortion by swapping clipping diodes in your Tube Screamer or Super Overdrive. For example, replacing the existing diodes with germanium diodes will yield a compressed, smooth fuzz sound. In contrast, silicon diodes (1n4148, 1n4001, 1n914, etc.) tend to provide a crisper, tighter, more focused sound. LEDs sound warmer, offering a great crunch, and usually making the pedal sound louder.

You can also experiment with different diode configurations. Two types of clipping can be achieved through different configurations: symmetrical and asymmetrical. Asymmetrical clipping—the type of clipping achieved in a stock Boss SD-1 circuit (see Fig. 2)—tends to yield a more dynamic and responsive overdrive resembling the feel and response of an amp overdrive. You can get asymmetrical clipping by putting two series-wired diodes in parallel with one diode oriented in the opposite direction (as shown in the mod instructions).

The Mid Hump
SD-1 Component Layout with highlighted capacitors that were replaced with different values

Tonal Changes

I’m not looking for the typical “Mid-range Hump”, an increase in the frequencies between 300hz – 3KHz, that the TubeScreamer give you. If you’re curious about that, there’s a great in-depth TubeScreamer Analysis by Electrosmash.

For my first mod, I chose to replace a few capacitors to different values to give me a wider frequency response. These changes are according to Wampler’s Cuervo Mod.

Capacitor 2 (C2) – 47nf
Capacitor 3 (C3) – 150nf
Capacitor 6 (C6) – 1uf Electrolytic

I tried out the pedal after these quick changes and was happy with the frequency response. The tone reminded me of the Timmy overdrive pedal, which I then put next the the SD-1 so I could AB test between the two pedals. The SD-1 Cuervo Mod gave almost the same amount of overdrive and tonal character as the Timmy pedal. A huge improvement.

Next Mod to Try

In the process of researching different mods I found the following SD-1 mod with higher gain, which can be dialled down for a transparent full-range clean boost. The main difference in this mod is an added pot which gives a ‘bright gain’ control. In combination with the original gain pot and the tone knob, this mod covers a lot of tonal territory, a bit like mixing normal and bright channels on an amp.

C2: increased to 0.056uF, for more bass
C3: increase to 0.15uF, more bass
R10: bypass or omit, for more volume
C6: removed, for more high treble
C5: decease to 0.018uF, to shift tone control up into the treble range for better control
R6: replaced by 2.2k in series with a 10k pot.

At a minimum setting the new pot sets a low gain range for boost/crunch with a wide transparent frequency response, from clean boost (add a bit of treble to get balance) up to a medium thick overdrive combined with the main gain pot. Turned up, the new pot kept the bass mostly unchanged, increasingly adding mids and then highs, returning the tones to more like normal SD-1 range, but with more gain available.

I’ll be posting the results from this next mod next.

ds-1-modding

Building a Stomp Box

For ages I have been curious about what goes into making guitar effects pedals. I’ve had so many stomp boxes over the years, seen articles on people building them but stayed away from trying it myself until this past year when I picked up a few books on the topic:
Craig Anderton’s Electronic Projects for Musicians
Brian Wampler’s How to Modify Guitar Pedals

Wampler’s book in particular was helpful in getting me started – turning my run-of-the-mill Boss Overdrive pedal into a classic Ibanez Tube Screamer by switching out only two components. That was a six months ago and now I’ve build 12 pedals and I can’t tell you how strangely satisfying it is to build and play your own pedals.

In this posting I’d like to take the time to explain some pedal building basics and show you how to get into it using the last pedal as a case study. I’ll give you deep explanation of the infamous Fulltone’s OCD overdrive circuit and how I created a clone.

The schematic, or blueprint of the OCD is easily found online at any number of Pedal building forums like https://www.diystompboxes.com/, http://pedalpcb.com and https://www.madbeanpedals.com. As far as schematics it’s not too complicated and makes a good starter pedal. If you don’t have a lot of experience with reading electronic schematics I’ll do my best to explain how they work. First, we’re take a higher level look at the overall circuit, breaking it down into sections and their functions.`

Simplified OCD Schematic

Essentially in all pedals the guitar signal is amplified then modified, in the case of the OCD there is a clipping section that distorts the signal, then amplified and given a tonal shape. In the OCD the clipping section uses diodes to drop the voltage (more on this later). This signal flow is typical of many overdrive or distortion pedals with the sonic differences primarily caused by variations in equalization in both amps and clipping circuit.

Power Section

As the schematic shows, both the amplifiers are created using one double operational amplifier (TL082 – Dual Opamp). Normally op amps has double power supplies with central point, but pedals commonly use single 9V power supply, so the voltage needs to be split into two.

Power Section – splits voltage into two 4.5v

This power section is quite common for all pedals and uses capacitors C1 and C2 to filter and store the power supply voltage. These caps will supply current to the rest of the pedal. C1 is an electrolytic capacitor which are good for storing current but not particularly good at filtering high frequencies. That’s why we’ve used a smaller value film capacitor C2.

D1 is protection diode used in case power supply with wrong polarity (reverse) is plugged into the pedal. The diode prevents the current from flowing to and damaging other pedal components.

Converting a single power supply into a lower one is done using voltage divider circuit , see the two resistors (R1, R2). This produces a new virtual ground (white triangle in the diagram). Current flows through these resistors (I=U/2R) from power source and voltage drop on each resistor is equal to half of power source  (U1=U2=I*R=U/2R*R=U/2). Beside the current which goes from R1 to R2 we have current which will go to our virtual ground. This mean that voltage drop will be not equal on both resistors. This effect could be reduced by decreasing value of R1 and R2. This will increase current going through the resistors and virtual ground current will be smaller comparing to it. Ground current in average should be equal to 0 as we do not have any DC voltage on the input of the op-amp. This means that we can reduce variation of voltage drop by adding capacitor parallel to R2. Here we can use higher values then original (OCD) to increase dynamic range of the op-amp.

Preamp section

The Preamp or Gain stage is a simple negative feedback circuit. Here’s a breakdown of the components:

Preamp section – op-amp with negative feedback loop

The guitar signal comes from the left and is labeled “in”. As we move to the right we can trace the signal flow, we see the R5 resistor which links capacitor C5 to ground. C5 removes DC (direct current) from the main signal. Without this resistor when true bypass is on the left connector of the capacitor C5 will be ungrounded. Voltage can arise on this side and result in a “bump” sound when you turn on the switch. The “bump” you hear is the voltage on the capacitor going to 0. Because of input capacity of the op-amp, some current will go to this capacitor. To reduce this current after the capacitor there is resistor R3. Then resistor R4 links input to our virtual ground.

Amplification coefficient of op-amp can be calculated using simple formula for a negative feedback amplifier ( k=1+(R6+R7) / R17 ). Using this formula we can calculate maximum and minimum possible gain of this stage.

Max: k = 1 + (1M+18k) / 2.2k = 464 or 53db.

That’s crazy! so much gain

This means that even without diode clipping stage we will have a fair bit of overdrive. Now let’s imagine that in the input we have 0.5V amplitude signal coming from a guitar. Then in the out we will have 464*0.5=232V. With our +-4.5V power supply we are not able to get more then about +-4V output. In such extreme cases the sound of the pedal depends on the op-amp model and power supply. Nothing is stopping us from increasing the voltage of power supply for the op-amp, in fact, that’s exactly what the Klon Centaur does, doubling the 9 volts to 18 volts in the final output stage to increase the headroom. For more info on the legendary Klon Centaur pedal, check out ElectroSmash’s in-depth analysis.

Capacitor C6 is widely used with op-amps. This capacitor cuts very high frequencies which can lead to trigger self generation in op-amp. Capacitor C7 plays double duty, first, we can not use virtual ground and the cap decreases current passing through. Second, C7 lets us cut some low frequencies. Value of this capacitor varies from revision to revision and is a commonly modded part of the OCD pedal.

Clipping Section

The section is probably the most atypical part of the OCD schematic.

You might wonder why it has MOSFET transistors instead of diodes here? And yes, we are actually using a diode too. The 2n7000 transistor has its own protection diode which prevents reversed polarity voltage in the transistor. Protection diodes have a voltage drop of about 0.7V. In some versions of the OCD the diode is Germanium. Germanium diodes have a smaller voltage drop then silicon ones. This diode adds asymmetry to the clipping. Symmetrical clipping (exact same diodes in reverse polarity) create a soft smooth distortion while asymmetrical clipping sounds more like a single-ended tube amp’s overdrive, which is what the OCD is going for. The resistor R8 is an important one, with the diodes it makes a “nonlinear” voltage divider. The resistor has dual purpose here, first, it prevents the op-amp from high-output current. Secondly, it makes the clipping shape smoother.

Tone and Amp Section

Finally, there is one more amp with tone and volume control. Much like the preamp section, we have the second part of dual operational amplifier (op-amp). Resistors R10 and R11 gives us amplification factor a bit smaller then 5. This mean that maximum amplitude of the signal is 0.7 times 5 (3.5).

After the op-amp we have to connect to ground. For this reason we’ll need a coupling capacitor C11 to change our signal’s impedance from low to high. The end of the signal path is similar to how a guitar tone and volume controls work. Resistors R12 and R13 together with C12 and R14  are high frequency voltage dividers. When switch is in on position total resistance of parallel R12 and R13 is smaller and  and voltage drop on high frequencies is smaller resulting in a brighter sound.

This concludes my epic rundown of the OCD clone pedal that I’ve now built twice. There are so many variations in components that result in subtle sound differences. I’ll try to round up some of the most used modifications to this pedal circuit next time.

IMG_4571

Updating Bluez on RPi

Update (Jul 9, 2019):
Now, Raspbian Buster, released on 6/20/2019, has bluez 5.50 by default!


This post shows how to update BlueZ on Raspberry Pi from 5.43 (the default version comes with Raspbian Stretch) to 5.50 (released notes [1]). In this post, I assume that you already have a Raspberry Pi 3 B+ or Raspberry Pi Zero W running Raspbian Stretch.

Steps [2]
1. Check Current BlueZ Version
1-1. Before starting, let’s check the current BlueZ version.

bluetoothctl -v

In case of Raspbian Stretch, the BlueZ version should be 5.43.

bluetoothctl -v5.43

2. Install Dependencies
2-1. Update the package list.

sudo apt-get update

2-1. Install the dependencies.

sudo apt-get install libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev -y

3. Install BlueZ
3-1. Download BlueZ source code.

wget www.kernel.org/pub/linux/bluetooth/bluez-5.50.tar.xz

3-2. Uncompress the downloaded file.

tar xvf bluez-5.50.tar.xz && cd bluez-5.50

3-3. Configure.

./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental 

3-4. Compile the source code.

make -j4

3-5. Install.

sudo make install

3-6. Reboot Raspberry Pi 3.

sudo reboot

4. Verify Update[3] [4]
4-1. Verify the BlueZ version by issuing the command below.

bluetoothctl -v

The result should be like this:

bluetoothctl -vbluetoothctl: 5.50

References
[1] BlueZ Release Notes
[2] Installing Bluez 5.44 onto Raspbian? – Stack Exchange
[3] Bluetooth LE upgrade not working – Raspberry Pi Forum
[4] Why does bluetoothd show version 5.37 after installing Bluez 5.45? – Stack Exchange

song-sketching

Song Sketching

Today I also listened to an interesting podcast by TapeOp with an interview with Michael Beinhorn, the producer of Herbie Hancock’s Future Shock album (featuring Rockit) and Soundgarden’s seminal album Superunknown. The interview centred around the importance of preproduction, detailing the lack of proper preparation that most artists experience before going into a studio to record an album. It was fascinating to hear how Beinhorn pushed Chris Cornell to work harder and break through his stagnated song writing. Cornell was limiting his imagination to what he thought the band Soundgarden’s style was.

I’m thinking a lot about preproduction these days as I write new songs and dig through my archive to weed out the best compositions to focus on recording. It makes me think that I’d like to have someone to use as a sounding board much like how Michael Beinhorn vetted Soundgarden’s song sketches and only the best were tunes that they collaboratively arranged and structured.

album-word-map

Arranging music

I’ve always been fascinated with the art of music arrangement, from the early days of playing in a band and figuring out the length of sections, introductions, middle sections and bridges to endings. In university I learned about how to write for larger ensembles and various instruments, learning about harmonic support of melodies in Jazz like you might hear in Count Basie or Gil Evans.

This reminded me of an earlier conversation with my friend, Richard Freeman, who happens to be an immensely talented jazz piano player. Over drinks a few nights ago I was talking about how I’m in the early stage of writing music and he interjected with the comment to make sure they’re well arranged. At first I agreed that yes, arranging is important but he insisted that it was at least as important as the song writing. That didn’t sit well with me. I believe it’s crucial to focus at first on writing a great song: melody (possibly lyrics) chords and rhythm. Personally, if I start working on arrangement, instrumentation and structure a may get distracted and shift my attention to the sonic details. I just didn’t seem right but then again I’ve written plenty of song by being inspired by a specific sound I’m getting on a guitar going through some combination of pedals. Maybe I should try going back and forth between arranging and composing and see what that yields.

Here’s a few interesting articles about music arrangement:

Ways of thinking about song arrangement by Paul Carr
8 intelligent music arrangement tips for producters by Ask Audio

How do you write music? Melody first? drum pattern first?

tumo-entrance-2019

Algorithmic Composition

Teaching a workshop on Algorithmic Composition at an amazing school in Yerevan, Armenia called Tumo – Centre for Creative Technologies. As a person with equal parts enthusiasm for music, design and code, I’ve always been intrigued by the idea of using technology to enhance and propel our experiences with music, both creating and enjoying.

I chose to work on algorithmic music composition with the p5.sound library. P5.sound is an add-on library that equips p5.js with the ability to do all manner of audio-related tasks, from playing a sound file to applying audio effects directly on the browser.

The p5.sound library provided basic support for synthesizing sounds at different frequencies, and gave access to the Web Audio clock, which allows for accurate audio-scheduling. These features provided a solid foundation for working with generative music.

Many Questions

There were so many questions to consider about how a composition program might look in the context of a p5.js sketch: How do we represent musical qualities like pitch and velocity in code? What about timing information? How do we write a program which handles composition tasks and visual animation simultaneously, and how do we make sure both tasks can interact and sync with one another? Most importantly, how do we make all of this simple and intuitive to use?

Interestingly, I found that the more I worked on the examples and tried to make them sound good – more musical, the more I had to hand-engineer ideas from musical theory into the code. Simultaneously, I never really knew what results I would get when I put new rules into the system. This was challenging yet exciting at the same time, and suggests that perhaps the role of algorithms in music will never be to replace humans entirely, but to facilitate new ideas and give us new ways to be creative.

arduino_toy_piano

Start Music Hacking Now

I keep hearing myself say:

There has never been a better time to get into music technology than now

– Haig Armen

These days there is so many choices of software and hardware platforms and resources designed specifically for any level in what was once an extremely specialized field.

Not that kind of Hacking…

‘Hacker culture’ is a subgroup of the DIY ethic, so by ‘hacking’ I don’t mean the process of illegally breaching the security of computers as the term is often incorrectly defined.

Hacking is the process of building software and hardware through experimentation, and includes extending a system’s functionality or repurposing technologies for other uses. Examples of music tech hacks include; developing custom software that allows a games controller to control your music software, or adding various sensors to your guitar to control its sound in unique ways.

1. Learn Graphical Programming

Graphical or visual programming languages are probably the easiest way to get into software development, as they just involve connecting or ‘patching’ together graphical objects instead of having to write any code. The two most popular graphical programming languages for music and audio are Max (which you may know in it’s Max For Live form) developed by Cycling ’74, and the community-driven Pure Data (aka Pd). Both are very similar in their functionality, however while Max provides a more user-friendly interface and professional support, Pd is free and can run on a higher number of platforms and devices. 

Max MSP
Pure Data, otherwise known as Pd, not as pretty as Max but more open

2. Learn Some Beginner-Friendly Coding

The next step up from learning a graphical programming language is to learn a textual programming language. While it may seem like a daunting task, there are now many coding languages, environments and toolkits designed specifically for beginners to create music and audio programs quickly and easily. Even though there is a steeper learning curve for coding compared to graphical programming, textual languages generally offer a lot more flexibility and provide you with a much better and more expandable skillset for not just DIY and hacking but also for more serious software development endeavours. As you’ll see later on in this article, knowing textual programming languages is essential for hacking and developing for certain hardware platforms and devices.

There are two broad types of coding platforms to mention here – Audio Programming Environments, which are designed specifically for creating music and audio programs; and Creative Coding platforms, which are used for developing software containing a range of different types of multimedia including music and audio. Here are some examples of the most popular coding platforms within the music tech DIY & hacking community:

  • SuperCollider – SuperCollider is an environment and programming language designed for audio synthesis and algorithmic composition, and is very popular for live coding and algoraves.
  • Processing – Processing is a creative coding environment and programming language originally designed for teaching programming, however it has since been adopted by the DIY community for creating rich multimedia applications.
  • openFrameworks – openFrameworks is a creative coding toolkit that uses the C++ programming language and a range of third party development environments. While less beginner-friendly compared to Processing, it is more flexible with much stronger audio capabilities.
  • Other platforms include ChucKCsoundFAUST, and Cinder.
  • Sonic Pi.

3. Start with Arduino or Pi

Arduino was the most popular platform for hobbyists to create their own interactive hardware projects and devices but it seems to have been surpassed by the Raspberry Pi in recent years. Whereas the Arduino comprises of a single microcontroller boards, with dedicated software application and programming language, the Raspberry Pi provides a full Linux OS and multiple programming languages to choose from including Python, Javascript and C++. Both platform are popular in the music tech DIY and hacking community due to being extremely beginner-friendly and highly programmable as almost any type of music or audio device. As you’ll see later on in this article a few commercial hackable musical products are built using Arduino and RaspberryPi platforms.

Arduino UNO

Arduino has many core and extension libraries for dealing with MIDIsynthesis, and almost everything else music related, and there are many hardware ‘shields’ for Arduino boards for providing extended music-related functionality and IO, such as MIDIaudio playbackFX, and synthesis.

An Arduino board being used to hack a toy piano into a MIDI controller

4. Hack an Audio Platform Device

Programmable audio devices are hardware/software platforms designed specifically for developing your own electronic musical instrument, synth, MIDI controller, FX unit, sequencer and so on. They usually consist of a piece of hardware containing freely assignable controls and inputs/outputs, as well as a software element for programming exactly how the hardware behaves. Compared to using a general purpose platform – such as Arduino – they’re generally a bit quicker and easier to use, however with that you may sacrifice some of the flexibility and configurability that general purpose platforms provide. 

The Axoloti Core micro controller board

Here are some examples of currently available programmable audio platforms:

5. Hack an instrument

You don’t need to wait for permission to hack an instrument, and some products are more hackable than others – whether it’s a synth, FX unit, MIDI controller or similar – that you are able to modify and customize in great detail so that it can operate in ways more specific to your needs. I’m not talking about opening up your expensive gear, prodding the electronics and voiding your warranty in the process – these are products that the manufacturer has allowed the end-user to hack via official methods. They’re not primarily designed for DIY development like the above list of platforms and therefore aren’t always as flexible in this aspect, however having the product’s existing functionalities and controls at your disposal can provide a quicker and easier hacking process.

Roli’s Lightpad Block is hackable

Here are some examples of currently available hackable musical devices:

  • ROLI Lightpad BLOCK – You can customize this 3D touchpad MIDI controller using a simple and specifically-designed programming language and application. See this tutorial to learn how you can go about hacking the Lightpad.
  • Critter & Guitari Organelle – This small desktop device allows you to run your own Pure Data patches on it, allowing it to become a personalized standalone synth, sampler, FX unit, or anything in between. Therefore you simply just need to learn how to use Pure Data to hack this device.
  • Bastl Instruments Kastle Synth v1.5 – This is a mini modular digital synthesiser that is DIY-friendly due to it running on two Arduino-compatible chips that the user can reprogram to modify all aspects of the synth’s engine. Prior knowledge of the Arduino platform is expected if you want to hack this device.
  • Other options include the Novation Launchpad ProSound Machines NS1nanosynthMeeblip, and Soulsby Atmegatron

Let me know if you’ve ever tried hacking an instrument or made an instrument using electronics.

pd-examle_patch

Introducing PureData

I’ve been posting my experiments exploring sound/musical instrument design and prototyping, and it occurred to me that although my writing had focussed on the creative process and user experience of playing instruments, it would you the reader to have more context and explanations of the technical side to go beyond just embedding links throughout my posts. Today i’d like to introduce you to Pure Data, an amazingly deep yet seemingly-simple music and sound creation development environment. Here’s the official description on the puredata.info website:

Pure Data

Pure Data (Pd) is a visual signal programming language which makes it easy to construct programs to operate on signals. We are going to use it extensively in this textbook as a tool for sound design. The program is in active development and improving all the time. It is a free alternative to Max/MSP that many see as an improvement.

As I learn more about Pd I realize that it has a number of redeeming characteristics that make it incredibly resilient. Apart from MaxMSP and VVVV, Pure Data is uniquely visual the only piece of software that allows you to program your own applications using a visual flowchart-like graphical user interface. Pd is open-source and platform-agnostic – working consistently across Windows, Mac and Linux platforms (and yes, RaspberryPi!). Pure Data is also extremely extendible, you can install libraries (Externals) to add new capabilities and many people write their one libraries. Finally, Pure Data can be embedded into other frameworks and hardware, there’s a libpd library that is used for iOS, Android and OpenFrameworks application development.

Ultimately, Pd enables musicians, visual artists, performers, researchers, and developers to create software graphically without writing lines of code.

Pd can be used to process and generate sound, video, 2D/3D graphics, and interface sensors, input devices, and MIDI. Pd can easily work over local and remote networks to integrate wearable technology, motor systems, lighting rigs, and other equipment. It is suitable for learning basic multimedia processing and visual programming methods as well as for realizing complex systems for large-scale projects.

Here are some of the basic components of Pure Data:

Objects

In Pd we use a flowchart with lines connecting boxes together to build programs. We call these boxes objects. Stuff goes in, stuff comes out. For it to pass into or out of them, objects must have inlets or outlets. Inlets are at the top of an object box, outlets are at the bottom. Here is an object that has two inlets and one outlet. They are shown by small “tabs” on the edge of the object box.

Connections

The connections between objects are sometimes called cords or wires. They
are drawn in a straight line between the outlet of one object and the inlet of
another. It is okay for them to cross, but you should try to avoid this since it
makes the patch diagram harder to read.

Data

The stuff or data being processed comes in a few flavours: sound signals, and messages. Objects give clues about what kind of data they process by their name. For example, an object that adds together two sound signals looks like |+ ~|. The + means that this is an addition object, and the ∼ (tilde character) means that its object operates on audio signals.

Edit Mode

When you create a new object from the menu, Pd automatically enters edit mode, so if you just completed the instructions above you should currently be in edit mode. In this mode you can make connections between objects or delete objects and connections.

Wiring

Hovering over an outlet will change the mouse cursor to a new “wiring tool.” If you click and hold the mouse when the tool is active you will be able to drag a connection away from the object.

Bang Message

This is the most fundamental and smallest message. It just means “compute something.” Bangs cause most objects to output their current value or advance to their next state. Other messages have an implicit bang so they don’t need to be followed with a bang to make them work.

Float Messages

“Floats” is another name for numbers. As well as regular (integer) numbers like 1, 2, 3 and negative numbers like −10 we need numbers with decimal points like −198753.2 or 10.576 to accurately represent numerical data. These are called floating point numbers, because of the way computers represent the decimal point position.

Number Box

For float numbers we have already met the number box, which is a dual-purpose GUI element. Its function is to either display a number or allow you to input one. A bevelled top right corner like this denotes that this object is a number box. Numbers received on the inlet are displayed and passed directly to the outlet. To input a number click and hold the mouse over the value field and move the mouse up or down. You can also type in numbers. Click on a number box, type the number and hit RETURN.

Toggle box

Another object that works with floats is a toggle box. Like a checkbox on any standard GUI or web form, this has only two states, on or off. When clicked a cross appears in the box like this and it sends out a number 1; clicking again causes it to send out a number 0 and removes the cross so that it looks like this .

Sliders and Other Numerical GUI Elements

GUI elements for horizontal and vertical sliders can be used as input and display elements. Their default range is 0 to 127, nice for MIDI controllers, but like all other GUI objects this can be changed in their properties window. Unlike those found in some other GUI systems, Pd sliders do not have a step value.

Message Box

These are visual containers for user-definable messages. They can be used to input or store a message. The right edge of a message box is curved inwards like this , and it always has only one inlet and one outlet. They behave as GUI elements, so when you click a message box it sends its contents to the outlet. This action can also be triggered if the message box receives a bang message on its inlet.

Symbolic Messages

A symbol generally is a word or some text. A symbol can represent anything; it is the most basic textual message in Pure Data. Technically a symbol in Pd can contain any printable or nonprintable character. But most of the time you will only encounter symbols made out of letters, numbers, and some interpunctuation characters like a dash, dot, or underscore.

Lists

A list is an ordered collection of any things, floats, symbols, or pointers that are treated as one. Lists of floats might be used for building melody sequences or setting the time values for an envelope generator. Lists of symbols can be used to represent text data from a file or keyboard input.

Pointers

As in other programming languages, a pointer is the address of some other
piece of data. We can use them to build more complex data structures, such
as a pointer to a list of pointers to lists of floats and symbols.

Tables, Arrays, and Graphs

A table is sometimes used interchangeably with an array to mean a two-dimensional data structure. An array is one of the few invisible objects. Once declared it just exists in memory.