Step 7: Make Your Own

Picture of Make Your Own
You can convert your own audio files into vector cutting paths in ten easy steps:

1.  Download Processing.

2.  Download Python 2.5.4.

3.  Download Audacity.

4.  Download the code from GitHub (you can download the zip file by clicking on the cloud button).  Unzip and open the folder called LaserCutRecord.

5.  Open an audio file of your choice with Audacity.  Go to Effect>Equalization and select RIAA.  Hit inverse and apply, you should now hear the higher frequencies of your track boosted.

6.  Go to Effect>Low Pass Filter... and apply an anti-aliasing filter (a fancy word for a low pass filter) to your audio.  You will have to choose the cutoff frequency according to the max sampling rate that you can get with your cutter.  For example, my laser cutter melts anything above 2.5kHz at 45rpm, so I set my anti-aliasing filter cutoff to this same frequency.  Set the drop off as high as possible, for me this was 48dB/octave, that way the filter will have a hard cutoff.

7.  Use Effect>Amplify to amplify the signal as much as you can without noticeable effects of clipping (you will be able to get away with some clipping, and remember this is not crystal clear audio anyway). You may also want to mess around with Effect>>Compressor.

8.  Make sure there are 2 sec of blank audio at the end of the track so that nothing gets clipped and keep the audio under 3:10.  File>Export this file and save it in the "LaserCutRecord" folder as a wav file. 

9.  Open the Python file called "wavtotxt".  Copy the file name of the file you just saved in the line:

             fileName = "your_file_name_here.wav"

Hit Run>RunModule, after a minute or two you will have a .txt file saved in the Record Generator folder.

10.  Open the Processing sketch.  Change the name of the import file in the Processing sketch to your txt file name:

             String filename = "your_file_name_here.txt";

Run the Processing sketch Sketch>Run.  The Processing sketch will output several files, none larger than 700KB (I found that larger files were crashing the laser cutter).  The last file will also contain the cut paths for the inner hole and outer edge of the record, you will need to set your laser cutter to cut these lines at a higher power, so that it cuts all the way through the material.  Another very important note about cutting these files - the reason I had to split each song up into five parts is because I found that files larger than 800KB would crash my laser.  When you are cutting out the sequential files, you MUST shut down the laser for a second to clear it's memory and then turn it back on before sending it a new 700KB file to cut, you will have problems if you forget this.

Once you've made cutting files, post them!  You can upload files in the comments by clicking on "Rich Editor."  Enjoy, and let me know if you have questions or need help getting this to work.  I've tested this process Mac OS using the latest version of Processing.  If you actually end up cutting your own record, please post the results in the comments, I'm really curious to see where this code ends up!

In case you are stuck trying to find a machine to cut your files, check this list of worldwide hackerspaces, these are places where anyone can go for little to no money and use tools in a collaborative work environment.  If you are in school, you might ask the engineering or art departments if they have a machine than can cut vector files.  Otherwise, I'd recommend checking out an online fabrication service such as Ponoko.  Some people even build their own laser cutters, there are many builds documented right here on Instructables, we're even giving one away in our Epilog Challenge.
shwey18 days ago

Hi Amanda, I've run the code through Python 2.5.4 and it is saying there is a syntax error. Here is the code I'm running:

import wave

import math

import struct

bitDepth = 8#target bitDepth

frate = 44100#target frame rate

fileName = "FemmeMono.wav"#file to be imported (change this)

#read file and get data

w = wave.open(fileName, 'r')

numframes = w.getnframes()

frame = w.readframes(numframes)#w.getnframes()

frameInt = map(ord, list(frame))#turn into array

#separate left and right channels and merge bytes

frameOneChannel = [0]*numframes#initialize list of one channel of wave

for i in range(numframes):

frameOneChannel[i] = frameInt[4*i+1]*2**8+frameInt[4*i]#separate channels and store one channel in new list

if frameOneChannel[i] > 2**15:

frameOneChannel[i] = (frameOneChannel[i]-2**16)

elif frameOneChannel[i] == 2**15:

frameOneChannel[i] = 0


frameOneChannel[i] = frameOneChannel[i]

#convert to string

audioStr = ''

for i in range(numframes):

audioStr += str(frameOneChannel[i])

audioStr += ","#separate elements with comma

fileName = fileName[:-3]#remove .wav extension

text_file = open(fileName+"txt", "w")



amandaghassaei (author)  shwey17 days ago

does it say what line?

Thank you for your reply! I fixed the problem, how thick was the wood that you used for the record?
amandaghassaei (author)  shwey9 days ago

doesn't really matter, I used 1/8 to 1/4". as long as it's pretty flat and stays flat it should be ok.

I keep getting unterminated string constant

amandaghassaei (author)  shadowchameleon17 days ago

are you missing a closing double quote on your filename variable?

I am confused on step 10 what do I rename in processing?

if your text file was called mySong.txt then you should change the line to:

String filename = "mySong.txt";

shieldy4 months ago

hi there - when you say the track length must be 3:10 is this minutes or hours? many thanks! stephen

amandaghassaei (author)  shieldy4 months ago


Hi, When I go to open the Python wavtotext file it flashes up for a second then disappears, do you know why this would happen?

I had this problem to so I had to open python idle

peigan1 year ago

im getting an error on python:

Traceback (most recent call last):

File "/Users/eidtecnico/Downloads/LASER RECORDS/LaserCutRecord-master/LaserCutRecord/wavtotext.py", line 26, in <module>

frameOneChannel[i] = frameInt[4*i+1]*2**8+frameInt[4*i]#separate channels and store one channel in new list

TypeError: 'map' object is not subscriptable


amandaghassaei (author)  peigan1 year ago

did you put the audio file in the same folder as the python script?

Hello! I'm also getting the same problem when I run the file in Python 3.4.1. When I run the file in Python 2.7.8 it says

Traceback (most recent call last):

File "/Users/flaviawilson/Desktop/UNIVERSITY/CCDN244 Expanded Photographics/Project Two - Lomo/LaserCutRecord-master/wavtotext.py", line 26, in <module>

frameOneChannel[i] = frameInt[4*i+1]*2**8+frameInt[4*i]#separate channels and store one channel in new list

IndexError: list index out of range

Do you have any ideas? The audio file is definitely in the same folder as the python script. Sorry to be a bother, I'm new to python but super excited about this instructable! You've done an awesome job, thanks so much :)

FlaviaW FlaviaW11 months ago

Figured out the problem - I'd already converted the audio track to mono, so the python code was getting confused because it was thinking the track was in stereo.

Also the code does only seem to work in 2.5.4, but I might be wrong.

amandaghassaei (author)  FlaviaW11 months ago

cool, yeah I haven't tested other versions.

rolandjays1 year ago

when you say " hit run, run module" where is that?

amandaghassaei (author)  rolandjays1 year ago
At the top of the processing window it says run
phillipppp2 years ago
First off, I'm very excited to try this! I will be making one within the next week or so.

I seem to be having the same problem, when I create the .pdf files, import them to illustrator and try to combine them to one, there is a huge gap between the 3 sections. Should I try scaling the lines to match up?

On our laser cutter, we import Illustrator files to CorelDraw and print from CorelDraw. I've never had any problem with file size, I have run some very large jobs, mostly etching, that run for hours. 

Thanks for the project! I look forward to some feedback. 

Did you ever have any luck with the gap problem, I have come across a similar problem and no matter what file I convert it too or which program I put it in it doesn't work

amandaghassaei (author)  phillipppp2 years ago
there seems to be an issue with importing these files into illustrator. try opening them up in preview or in adobe reader, you will see that there is actually much more information there. can you try this and let me know. there should be five sections and each of them is much thicker than the sections shown in this file. they will line up with each other
I do not have CorelDraw on my personal computer, only the workstations at work. I opened them in photoshop and they seemed to line up properly but they are no longer vector art. Any idea whats going on? I only got 3 PDF files when it was generated as well.
amandaghassaei (author)  phillipppp2 years ago
yeah, that's the problem with photoshop. I'd say try opening them in corel and see if the import works ok. did you use a short piece of audio? that might be why you only have three files. If you use the full 3min you will end up with five files. let me know how it works
Opened the files in CorelDraw, same as Illustrator. Weird! Any ideas?
amandaghassaei (author)  phillipppp2 years ago
that's strange, can you just print from adobe reader? that's what I've been doing.
I'm having a bit of an issue running the processing sketch.

Processing crashes when I load the split strings into this array. My .txt file is 43mb. Which seems gigantic for a plain text. But at 44100 x 180~ sec. I guess that makes some sense.

it's this line that causes the sketch to run out of memory. I've changed my processing prefs to allocate 512MB but it still crashes. I suppose I'm confused, or not doing something right, as no one else has posted this issue...

float audioData[] = float(split(rawDataString,',')); //separated by commas

any thoughts?
wouter912 years ago
Great idea and great instructable! I've tried to convert an audiofile myself since we have a trotec speedy 300 lasercutter at our school. I've managed to receive 5 .pdf files with a vector line but if I put the five files together they don't fit. What you see is an outer spiral, then a space with nothing, then the second spiral, then again a space with nothing, third spiral etc. Could you help me out because I'm pulling hairs here ;) Love the idea of music out of wood!
amandaghassaei (author)  wouter912 years ago
Can you attach the files?
aden breems2 years ago
Best Instructable I have read in a long time!!!
And you could be onto something really revolutionary: using lasers to cut records...

I imagine you can get better fidelity if you cut the record more in a fashion of how its traditionally done; by spinning the acetate (material) at a constant velocity and having the cutting head replicate the needle's movement. Of course that isn't natural for the laser cutter...

Anyways, I don't have a laser cutter :-(
but I'm still going to go thru it again and maybe run a little of the code <3 python
amandaghassaei (author)  aden breems2 years ago
that might help, esp if you can customize the laser setup to be extremely precise on that one axis, but yeah, the laser cutter isn't really set up for that right out of the box. check to see if there's a fab lab or hackerspace around you, maybe you can get time on their laser.