Finally, it was time to start printing real audio! All my initial audio tests were done with the first 30 seconds from the opening track of one of the greatest albums ever written, The Pixies "Debaser."
In the first test I used the same parameters that I'd had luck with in the sine wave tests:amplitude: 16 x 16 micron z axis steps
groove width: 2px
groove depth: 3 x 16 micron z axis steps
sampling rate: 11,025hz (one quarter of normal mp3 sampling rate)groove spacing: 20 pixels (at 600 dpi)
My processing code is below. The code is heavily commented, but here's the overall gist:
An audio file is basically a list of numbers that plot a waveform over time. The data that I pulled from Python in the last step is just that, the list of data points in the audio file. Essentially what I did in this Processing sketch was use this data to set the depth of a long, spiral groove on the record's surface. Later when the needle passes over this groove, its tip will follow this path and actually trace out the original waveform stored in the audio data.
and here is the result:
Success! You can clearly hear The Pixies coming through, but the signal to noise ratio is not great. In my next test I amplified the original audio signal a little bit before sending it to my Processing sketch. This way some of the louder drum sections would get slightly clipped and allow the overall amplitude of the normalized signal to get a little larger. Here's what that sounds like:
Signal to noise is getting better, I added a little more audio to this file so that you can start to hear Frank Black's vocals coming in. Next I increased the amplitude of the signal to see if I could get a better signal out. In my sine tests I thought that an amplitude of 16 was plenty loud, but not so large that it caused excessive distortion in the signal. Since the Pixies signal is not always spanning the full amplitude allowed by my program I increased the amplitude of the algorithm (most of the time the waveform is hovering around half of its peak amplitude, only the drums are able to kick the signal up to full amplitude). This may cause some extra distortion on the drum beats, but since drums are already pretty noisy I was ok with that. Here's the result of amplitude 32:
Signal to noise is better, but there is quite a bit of distortion. I decreased the amplitude to 24 next:
This sounds a lot better. Good signal to noise without too much distortion. Next I made a slight edit to my code to minimize the amount of data packed into the stl file. In the previous examples I created some space between grooves, basically a flat surface parallel to the top of the record. In the code below I removed this space and used the last upper edge of the previous groove as the upper edge of the next groove. The difference in the model is shown in fig 2.
And here's what it sounds like:
I was really happy with the way this came out, this is the code I used moving forward.