How to play raw data

Hello everyone,

I’m trying to do something a little weird, and I’m not sure if I’ll be able to do it in FoxDot.

I’m running on linux with an Alsa-JACK bridge.

First, for the last month I’ve been piping non-audio files like the output of journalctl (which is just a log-file containing text) into aplay. The resulting noise is pretty interesting. I decided it would be fun to put together some tracks in this way. My first approach was to
write BASH scripts to do this (using sox to apply effects). This has been fun and interesting, but I’m not able to change effects while the program is executing, so it is not very suitable for live-coding.

I’d like to use FoxDot for more control. Thus far I’ve tried to convert the files to .wav files such that I might use the loop synth, but this has not worked. I just get silence. I’m able to play other samples fine, so I’m sure its an issue with my particular approach to this issue.

I admit that I am pretty naive regarding the workings of SC and FoxDot, so I apologize if
this question is silly, but I couldn’t find anything about it on the net.

Anyone have any ideas?


A couple of questions and comments

  • Does the resulting wav file that you have created does it play in other audio players ?? Like for example Audacity
  • Check the format, Byte Order, Encoding format and Sample rate of the two files and see if the one that you have created is the same as the one that plays

From what you have described I think that you can use Audacity to do exactly what you want to do see the following

You’re probably best of exploring this in SuperCollider first, which might have a way of reading non-audio data into a buffer - I’m not sure how to do this. FoxDot uses the PlayBuf UGen, which, when given a non-audio file, prints an error:

File 'C:\Users\Ryan\Pictures\Picture1.png' could not be opened: File contains data in an unknown format.

And doesn’t load anything into the buffer. I would search the docs for “buf” and see if you can wrap an appropriate UGen in a SynthDef. That way you can import it and use in FoxDot.

If you are interested in playing more sophisticated raw data (maybe in real time) you could check rampcode/pd or read some stuff about bytebeat. Regards!