Posts Tagged ‘audio’

The Last Minute Change of Plan

Wednesday, February 24th, 2010

Right. A long time since I last ‘blogged’, so I have some housekeeping to do. Updates by the shed-load. My sound app has now changed dramatically to reflect my new instrument.

My original idea was to create a tactile-less instrument (similar to the one shown below) that required little or no musical experience. My new idea is similar, but with a new and different application of hardware.

My original design required the use of ping, or ultrasonic sensors that used echolocation (making very high-pitched clicking sounds and listening for the echo) to determine the distance to a surface (similar to bats and dolphins) or lasers that used a similar method, but with light instead of sound.

I discovered that there were a few problems with the ping sensors, the most worrying being that because I needed 2, and unless I could wire in a switch so that alternated the source and receiver or created 2 different wavelengths, the 2 pings would interfere with each other. The ping sensors for the Arduino cost around £35-40 each and being a final year student, I am very very very low on cash and I decided to look for a cheaper alternative. The biggest problem however, was that if I choose to use my own sensors (which I have sitting on my desk now) I had no idea how to create the circuit to make them work.

So began my search into alternatives. Whilst experimenting with getting values from LDRs into Max5 via an Arduino, I discovered that covering up an LDR was very inaccurate in that my hand covered such a large area that the poor little LDRs resistance would read close to infinity whenever I went near it. However, when I was playing around with one, I tilted it down onto the desk and the reading was a lot more consistent. I suddenly realised that if I were to attach one to the end of each finger, I could use them to trigger notes and chords by moving my fingers up and down. On my white desk, the LDR was giving back values until it was only a few millimetres off the surface of the desk.

However, as with the hand-covering, the data retrieved from the LDR varied quite considerably. I came to realise that the only true and reliable way of using LDRs was as a switch, giving a value of 0v or >0v. But this property completely destroyed my analogue-based distance system, so once again, I had to put pen to paper and have a re-think.

I have 5 digits on each hand, making 10 in total. If each of them could give a value of 0 or 1, using binary notation I could have a potential 1,023 (210 – 1) combinations of fingers, ignoring the combination 0000000000 (all fingers up). That is far more than I originally had planned and maybe too many. If I split my hands up however and treat them as 2 separate entities, I could have 62 (2(25 – 1)) combinations, which would be more than enough, seeing as there are only 8 notes in a scale. Splitting the 2 hands up, I would have chords on the left and melody on the right, with 31 combinations of each.

Above is the map I drew to illustrate the combinations. The actual number of combinations in this configuration is 40 ((23 – 1) + (22 – 1) + 2(24 – 1)). The number I am using is less because I am restricting the notes playable by the 4 fingers of the right hand to 12, rather than the maximum of 15, purely because there are 12 notes in the chromatic scale and the thumb can then act as an octaver, adding 12 semi-tones to the current note. This means I can have 2 full octaves in the right hand and all 7 major triads, each with 3 optional variations on the left hand.

The other brilliant thing about this idea is its flexibility. In the future, I may look into the possibility of allowing the user to switch between playing notes and percussion. There is also the possibility of using more sensors for a wider range of possible sounds, instruments and dynamism in the music. Of course, the current design acts as a MIDI controller, so you can just alter the voice on the system to whatever you want, but you must remember that the mapping of the fingers would need to be made more intuitive for the instrument chosen.

The LDRs will be attached to a glove to allow the wearer to play the instrument anywhere, within reason. The position of the fingers in relation to one another is not important as it is with any tactile instrument. Given the right material, the wearer may even be able to play by tapping their fingers against their clothes.

Of course, my current working patch in Max5 was useless, so I set out to create a new one, stealing bits and pieces from the one that previously took me several weeks to carefully prepare. A work in progress:

Of course, the unlocked patch is as nasty-looking as ever:

There was of course, the problem I was dreading – I had to make 2 Arduinos talk to Max5 separately. This caused me a few headaches, but I overcame it. Lucky I bought 2, eh? :D

The only problem that I can foresee is that not many people can think in binary very quickly. I am having a lot of trouble trying to grasp it because I can only think either musically or binarily. Mixing the 2 is not easy for me! So as a fix, I am building LEDs into the fingers of the gloves and if I take the idea further, I will create a system that can flash the lights of the fingers you have to tap to play a particular song. I could also build in a function to allow the recording of your taps and play them back to you.

There are a few points that I believe make this instrument better than the one I had originally planned. With analogue inputs, it was hard to find a point at which to trigger the playing of the chord or note. There are of course, no such problems with digital; it’s either on or it’s not! Although not as technically outstanding, the new instrument should be more reliable, easier to reconfigure and more accurate.

This idea has already been produced (such as here and here), but every existing application only allows the user to play a single not per finger. My design allows a chord to be played with a single finger, making for many more possibilities.

Gloves off eBay – Check!
Arduino x2 – Check!
LDRs, LEDs and wire – Check!
Time – ARGH!

My Sound App – What The Hell Is It And How On Earth Does It Work?

Tuesday, December 15th, 2009

I got (from what I can gather) a positive responce from the guys in the sound app ‘show and tell’ when I showcased my app for people who know nothing about music but still want to be able to perform really good tunes (AFPWKNAMBSWTBATPRGT…the name needs some refining) this afternoon.

As long as you don’t unlock the patch, the UI is hopefully quite simple. Since I coloured the sections to keep myself from going crazy looking at boxes and lines, I shall try to explain by colour.

Screen shot 2009-12-16 at 03.08.27

  • Orange – This is your main control panel. From the top down:
    • The volume dial controls the volume of the chords, preset to 127
    • The tempo of the song to be made, between 60 and 200bpm, preset to 90
    • The 4 LEDs flash in sequence, dentoning the beats of the bar (1 – red, 2, 3 and 4 – blue)
    • The length of a bar for the given tempo in milliseconds (non-editable)
    • The current position in the bar in milliseconds (non-editable)
    • Left In and Right In denote the volume of the input channel
    • Left Out and Right Out denote the volume of the live output channel (not the MIDI output)
    • The ‘Reset’ button will set all the options back to their initial settings and values
  • Purple – This is so that you can choose the base note or ‘key’ of the song
  • Blue – Both panels work in exactly the same way to play the various chords for the song
    • The top slider is the theoretical height of you hand above the chord sensor and moving it up cycles through the various chords with the ‘distance’ being shown below it
    • The ‘ceiling’ is the highest point of the top chord and until the hardware is implimented, this value should not need to be changed
    • The LEDs display the current chord
    • The checkbox is to activate the chord – clicking on will strike the chord and clicking it off will stop it
    • The patch below is for development purposes only
  • Green – This is to active different variations of the chord in terms of tonality and dissonance
    • When checked the top checkbox ensures that a chord is output, but when unchecked, only a single note is output
    • The 4 buttons are to manually override the chord variations, however, changing the value on the sensor of the blue panel resets the variation to its intended form
  • Yellow – This overrides the inversion of the chord, from root (1st note on bottom) to 1st inversion (3rd on bottom) and 2nd inversion (5th on bottom)
  • Brown – This is the live recording panel, for which there are 3 channels each with a button which when clicked will record a sound
    N.B. Although a sound of up to 16 seconds can be recorded, the patch only supports the playback of a sound equal in length to a bar (orange panel)
  • Turquoise – This is the playback panel of the patch
    • The checkbox should enable and disable the playback of the patch, but due to the complexity of the patch this can sometimes malfunction
    • The slider to the right of the checkbox adjusts the volume of the playback (use this if clicking and un-clicking the checkbox fails)
    • Below are 2 level indicators for the output sound – left on top and right on the bottom
    • The bottom slider (non-moveable) displays the current position of the sampled audio playback
  • Grey – This panel is only used for creating the chords and provides no user-centric functionality

The patch was created on a Mac running GarageBand. My usual proceedure is to output the MIDI control from Max and use GarageBand to play a more realistic-sounding instrument, such as a grand piano or more usefully, some orchestral strings as these can be held for as long as needed.

I hope the patch is easier to use and understand than it was to make!

Download the patch (MaxMSP Patch – 262kb)

Argh! Sound App Madness!

Monday, December 14th, 2009

O…M…G! I have spent God-know-how-many hours on my sound app and I’ve only just discovered some functions that would have cut my development time in half!

I am currently working on the recording and looping part of the app. The test patch looks as follows:

Screen shot 2009-12-14 at 04.19.16

The patch is only for 1 (YES – ONE!) channel and it has a few bugs still. so I have to make it suitable for 3 channels and tidy up the routing.

The main interface is looking quite nice and tidy:

Screen shot 2009-12-14 at 04.24.49

…assuming you don’t unlock it!

Screen shot 2009-12-14 at 04.26.12

…and the subpatches are all good and working:

Screen shot 2009-12-14 at 04.24.52

…if not slightly overcrowded.

All in all, it’s going quite well(ish) and if I don’t encounter any major problems, then all will be good for the deadline on Tuesday!

My Sound App is Coming Along Nicely

Wednesday, December 9th, 2009

Well, after failing to find out why my copy of Max5 wasn’t talking in MIDI and with a worryingly small amount of support on the net, Dan solved my problem with a well-placed double-click. Now I can get a real move on!

My third forth fifth idea was to create an instrument with no haptic feedback that anyone could play reasonably well with very little knowledge of music.

Touch-free instruments like the theremin require a high level of musical knowledge and skill to play well, as they are almost analogue in nature which means the player must be able to pitch the note perfectly. I wanted to create a structured instrument with a set of pre-defined chords created in such a way that it is easy to use if you stick to the first 3 chord shapes, but is also complex enough to add some colour into the more advanced creations.

My (fifth) initial idea was inspired by Omer Yosha who managed to create a virtual array of controls above the surface of his infrared-controlled instrument. I have used a similar concept, but with an easier interface. Omer used 7 sensors to detect 3 levels making a virtual 21 hot-spot array. I plan to use 2 sensors with 4 levels, making an array of 8 hot-spots.

airpiano

Music theory tells us that there are 7 different notes in a standard scale, 5 in a pentatonic, 6 in various others and 11 in a chromatic. In the key of C, the scale of chords are as follows:

C, Dm, Em, F, G, Am, Bdim

Hopefully, I will be able to connect up 2 ultrasonic sensors for use with the left hand. I plan to include the 4 most common (C, F, G and Am – in that order) on a left sensor and the secondary chords (Dm, Em, Eb and Bb – in that order) on a right sensor. I would also like to use a potentiometer to choose the base note, allowing you to translate your music into different keys.

Mobile Photo 11 Dec 2009 20 54 09

The left hand will be used to control all the pre-defined structured sound and the right hand will be used to control all the analogue and user-generated sounds.

More details to follow soon…

Oh…My…God! Dynamic spectral anaylysers in Flash!

Wednesday, November 4th, 2009

gaming
Whist looking around for cool stuff to incorporate into our game, I stumbled across this. It’s a Flash movie that anaylyses the audio playing within itself and dynamically creates a spectral pattern. I would imagine that without much trouble, it could be modified to dynamically create a waveform of the pre-recorded audio. This would add a really cool effect to the game and give it the dazzling edge that it needs!

sound9

Kudos to the developer, Lee Brimelow.

However, looking even further, I found this. Another spectral anaylyser, but with more variations, including…A WAVEFORM! The developer, Antti Kupila (who has a great portfolio FYI) has also included the source files for download. WIN!

revolt-screenshot

However, I believe that both of these cool effects are a direct result of AS3, and since we are still waiting for Adobe to get their ass in gear and give Orrin Flash 10 with AS3 on his phone, these effects may just have to wait. The other option is to fake the anaylyser like this.

HURRY UP ADOBE!