CocoTeens7 - Hit The Tune

Jump to: navigation, search

CocoTeens7 HitTheTune front.jpgCocoTeens7 HitTheTune backside.jpgIMG 20160930 183321.jpg


Install guide

  1. Install latest arduino version (currently 1.6.12) or lower:
  2. Install "teensyduino":


Code examples can be found on github




Supercollider test patch

    p = ProxySpace.push(s.boot);;;;;
    ~mysound1 = {\ * 0.2 };
    ~mysound2 = {\ * 0.2 };
    ~mysound3 = {\ * 0.2 };
    ~mysound4 = {\ * 0.2 };{arg ...args; ~mysound1.set(\freq, args[0]*10);}, 66, 0);{arg ...args; ~mysound2.set(\freq, args[0]*10);}, 77, 0);{arg ...args; ~mysound3.set(\freq, args[0]*10);}, 88, 0);{arg ...args; ~mysound4.set(\freq, args[0]*10);}, 99, 0);


For playing wav file from memory, there is AudioPlayMemory class from teensy audio library.

More infos:

compile the converter

MacOS and *nix users need to compile the sample conversion software "wav2sketch" from command line.

The C source can be downloaded here:

Next to the wav2sketch.c source file, a "makefile" must be present to compile the program.

Copy&paste the makefile below to a file called "makefile" without file extension. Open a terminal in the directory, where "wav2sketch.c" and "makefile" is present and type "make". If no errors occured you should now have the program "wav2sketch" in the same directory.

convert wav files

WAV-Audio samples can just be placed in the same directory as the program for conversion. In the Terminal, if it points to the folder of your "wav2sketch" program already, type ./wav2sketch to execute the program. Otherwise you can just type the absolute path, for example "/Users/yourUserName/Desktop/Wavs/wav2sketch". This should generate cpp/h files for all wav files present in the folder.

As an option, uncompressed 16 bit samples can be generated by passing the option "-16" to the program. MacOS users need to install XCode environment, linux useres need gcc (should be installed anyway).

Makefile (for Mac OS/*nix users)

CC = gcc
CFLAGS = -O -Wall
all: wav2sketch
	$(CC) $(CFLAGS) -c $<
wav2sketch: wav2sketch.o
	$(CC) -o wav2sketch wav2sketch.o
	rm -f *.o