So…it seems that the combination of XBee RSSI data and the Mozzi synth can only produce intermittent or pulsing sound and doesn’t allow for constant tones, as witnessed by the following video demos. All the data that has to be sent from Arduino to the XBee in order to get it to send and receive packets is causing the audio to stutter.

To get the tones required for the final piece, the circuits will need to be created using SX1278 LoRa modules instead. These will connect the four Space Rocks via an additional transmitter, and based around this circuit:

This should guarantee that the Mozzi synths can play continuous tones rather than interrupted pulses. Although I’ll now need to find a way to fit 4+”  433MHz antennaes into the Space Rocks too.

433MHz antennae
433MHz antennae

Some Mozzi audio experiments

Using my own samples with Mozzi

Have finally cracked getting my own samples into Mozzi. The sound clips need to be VERY short (around 0.5 seconds) or they are too big for the Nano. I also tried mono to see if that saved space, but then there was no sound at all. I really raised the volume of this sample and the clipping isn’t too noticeable compared to the previously-encoded version , as it clips because of the processing anyway.

Here’s the code:

/*  Example of playing a sampled sound,
    using Mozzi sonification library.
    Demonstrates one-shot samples scheduled
    with EventDelay.
    Circuit: Audio output on digital pin 9 on a Uno or similar, or
    DAC/A14 on Teensy 3.1, or 
    check the README or http://sensorium.github.com/Mozzi/
    Mozzi help/discussion/announcements:
    Tim Barrass 2012, CC by-nc-sa.

#include <MozziGuts.h>
#include <Sample.h> // Sample template
#include <samples/alienwave.h>
#include <EventDelay.h>

#define CONTROL_RATE 64

// use: Sample <table_size, update_rate> SampleName (wavetable)
Sample <alienwave_NUM_CELLS, AUDIO_RATE> aSample(alienwave_DATA);

// for scheduling sample start
EventDelay kTriggerDelay;

void setup(){
  aSample.setFreq((float) alienwave_SAMPLERATE / (float) alienwave_NUM_CELLS); // play at the speed it was recorded
  kTriggerDelay.set(1500); // 1500 msec countdown, within resolution of CONTROL_RATE

void updateControl(){

int updateAudio(){
  return (int) aSample.next();

void loop(){

With thanks to Tim Barass and his very helpful forum for help getting this working.

Testing the XBees – at distance and enclosed

XBees turning on a red LED at 4 foot distance. I also tried this from one floor down and it still worked perfectly.

And testing them both inside Space Rock ‘shells’.