FoxDot Part 1: Coding Music for Beginners

FoxDot Part 1

Index:

  1. FoxDot Workshop

    1.1. Introduction

    1.2. Workshop Index

    1.3. Workshop Slides

  2. Create Hotspot and use Troop

    2.1. Create a Wifi Hotspot

    2.2. Connect and get Troop started

  3. FoxDotSpot Dongle

    3.1. How to use a FoxDotSpot Dongle

    3.2. D.I.Y. Instructions

1. FoxDot Workshop

1.1. Introduction

FoxDot is an easy-to-use Python library that creates an interactive programming environment and talks to the powerful sound synthesis engine, called
SuperCollider
to make music. FoxDot schedules musical events in a user-friendly and easy-to-grasp manner that makes live coding easy and fun for both programming newcomers and veterans alike. Ready to get going?

The FoxDot Workshop will lead you through the basics of FoxDot, to point you can make Music with Live Coding alone or with other people together. The FoxDot environment can also be used to write musical compositions in a more traditional way, by dedicating the timing using Python functions.

1.2. Workshop Index

  1. An Introduction

    1.1. What is Live Coding?

    1.2. Why using code for music?

    1.3. What is FoxDot?

  2. Getting Started with FoxDot

    2.1. Player Objects

    2.2. Patterns

    2.3. TimeVars

    2.4. "play" and "loop" Players

  3. First, a little bit Music Theory

    3.1. Song structure

    3.2. Chords and Notes

    3.3. Scales and Modes

    3.4. BeatBox

  4. Live Jam

    4.1. Connect to The Wifi Network

    4.2. Run Troop

1.3. Workshop Slides

Download Presentation Slides (English)

Presentation herunterladen (Deutsch)


2. Group Jam Session using Troop

In order to collectively create music with FoxDot, we will use Troop, a server <--> client environment written in Python. This will create a server<->client connection through a network, preferably using Wifi to connect to the network. FoxDot will use OSC (a digital better of ol' MIDI) to communicate, which is the same way it communicates to SuperCollider under the hood.

The server will only deal with all the clients OSC messages.

The clients will run the SuperCollider audio server underneath of FoxDot in order to get sound out of the can.

2.1. Create a Wifi Hotspot

Search for a guide online, that explains "How to Create a Wifi Hotspot on....." in order to get the Troop server and client running. Check on the server computers IP address, that is used to connect to the Wifi hotspot. This will be the IP you are using in Troop!

If you do not want to run the hotspot on your machine, or like with my case, your Ubuntu laptop troubles you to create a hotspot, get one of the FoxDotSpot dongles below, which makes it easy.

Once the hotspot is established, follow the guide below:

2.2. Connect and get Troop started

  • Run Supercollider, and execute FoxDot.start and Troop.start (If this is your first time, execute Quark.gui first. Select "FoxDot" and "TroopQuarks", and recompile)

  • Open a terminal and run the server script

  • Now open another terminal window and run the client script on the same computer

  • The client program will open a popup window. Check on the ip the terminal windows shows, and use it to fill in Host:
  • Then, choose a Name: and Password: like shown in the following image

  • After you pressed "OK", the editor should open like the following image shows
  • Every other person, who wants to join the Jam Session runs the client script, fills in the same IP, adds a name and password...and off you go!


3. FoxDotSpot Dongle

The FoxDotSpot Dongle is a RaspberryPi Zero W, that runs an offline Wifi Server with a hotspot for users to connect to. Furthermore, you have the option to connect this server to the internet and connect to the OS via ssh.

3.1. How to use a FoxDotSpot Dongle

  • How to get it started?

    Just plug the dongle into a power supplied USB slot, directly to a plug or into a Pc/Laptop, and off you go.
    After a minute, you will be able to connect to a Wifi Hotspot with the name and password below:

    SSID: FoxDotSpot

    Password: jamsession2020

  • Shutdown the Wifi Server OS:

    Press the little button longer than a second, and wait till the green LED is off.

    Unplug the dongle.

    Thats it!

3.2. D.I.Y. Instructions

What do you need?

  • Raspberry Pi Zero W - 19.49 €
  • SD Card 32GB - 5.99 €
  • Male USB to DIP Adapter Converter 4pin 2.54mm PCB Board - 1 €
  • Micro Push Button 665mm 4pin - <1 €
  • PLA 3D Print material
  • 4 short wires
  • 2 screws for USB Module, 4 Screws for the case
  • Soldering gears
  • Some isolation tape to protect electronic parts

First, lets buid the hardware:

  1. Connect Usb Module with Raspberry Pi

    1.1. Take wires, Usb Module, and Rpi and solder it together like the images shown

    Which pin where

    1.2. Use isolation tape to avoid short circuit. You do not need to hot clue the use onto the RPi board, if you bought a Usb module with board.

    This can be srewed to the case later on.

    After soldering

  2. The Shutdown Button

    2.1. Cut the unused legs off. Check the image which ones. I used a multimeter to test the currency flow to be sure.



    2.2. Plug the remaining legs into the GPIO pin holes like shown. Red is GPIO20, which is used by the OS to trigger the shutdown, Black is Ground. Use some isolation tape between the cut-off legs of the button and the board to avoid short circuit.



    2.3. Solder the legs to the RPi board. The board should now look like shown in the image below:


  3. The Printed Case case

    In case you do not have a 3D printer, there are ways to build a case without it

    Example: Tic Tac Case

    3.1. Download the FoxDot Dongle Case

    3.2. Load this 2 STL files one afte another into Slic3r or your preferred slicing software.

    (I used PLA, a 0.4 Nozzle, and scaled models up 1% as counteract to shrinking process while cooling)



    3.3. Test after printing, if it fits, but do not screw it together. We need to install the OS and slot in the SD card.

Secondly, lets install the software:

  1. Download and install Etcher
  2. Download and extract the FoxDotSpot SD Image
  3. Connect an SD card reader with the SD card inside.
  4. Open balenaEtcher and select from your hard drive the FoxDotSpot .img
  5. Select the SD card you wish to write the image to.
  6. Review your selections and click 'Flash!' to begin writing data to the SD card.
  7. Take the SD card out of the reader and slice it into the RPi slot.
  8. Run in the first time, before you close the case

Thirdly, in to the case and done:

  • If everything, worked out, you should see the green LED flickering, after you plugged in the dongle
  • Wait till the green LED lights up permanent
  • Now, you should see "FoxDotSpot" in available Wifi Connections
  • Click on it, and use the password: "jamsession2020"

Now you should be able to start using Troop

In case you want to access the GUI of the offline server as administrator (e.g. changing password)

  1. Open a browser and type in 10.3.141.1
  2. Login with user name: "admin", and password: "jamadmin2020"

In case you want to access Raspbian via ssh connection, you will need following details:

Hostname: wifiserver

Login: ds

Password: offline2020

If you want to get internet for the FoxDotSpot Dongle, you will need to create a Hotspot on your phone or computer with
following details (This settings are manually set in Raspbian OS of FoxDotSpot Dongle)

SSID: 4RPiZero

Password: fe3556d042ec

Be aware this option remains untested. It has been used to install and configure the dongle OS

Share