SMCS Resources

This is an initial list of downloadable resources. They are also available via the CAS forum. They cover aspects of digital audio ("data representation"), and examples of music computing in Scratch and Python.

GenerativeMusic-Bett2015.pptx Presentation for OCR at BETT 2015, demonstrating generative music (or "algorithmic composition"). It is aimed at the dual audience of Music and Computing teachers and students. It demonstrates the use of random numbers to generate musical patterns, examples of musical recursion (rounds), simple running-sum processing of a random number stream, and some useful sound effects. It ends with a music example asking the question "have you worked out what it's doing yet?". All examples are written in MIT Scratch.
SMCS-14-11-12.ppt An overview of core topics in SMC, oriented towards the general CS “Data representation” topic, summarising sampling, quantisation and reconstruction, Nyquist limit and aliasing, terminology for periodic waveforms, log scales and the Decibel, and use of frequency domain representations (via Audacity).
SoundExamples.zip Quantisation and aliasing examples for the above. For the effects of quantisation to be heard easily, even 8-bit sounds may too subtle in the classroom. The example presents progressive bit reduction right down to 1 bit (see also the Python program “sfbits.py”). Other files demonstrate progressively extreme aliasing.
SMCScripts.zip A collection of Scratch examples, including loops, “wraparound” or modulo arithmetic, use of dynamic control via sliders, sonification of a parabola and a bubble sort, and one probable (but useful!) Scratch bug. While mostly very simple in terms of code, they demonstrate some of the opportunities for working algorithmically with sound and music. We hope they will also be enjoyable to listen to and play with. They may offer a way for visually impaired students to listen to algorithms.
SMC-ScratchExamples.pdf Documentation for the above.
SMCPython.zip

A set of four utility sound file oriented command line programs in Python 2.7:

  • sinesweep.py: generate linear (Hz/sec) sine wave sweep

  • logsweep.py: generate log-law (oct/sec) sweep

Both synthesis programs can be adapted to demonstrate aliasing. These days it is impossible to demonstrate aliasing by recording, as all ADCs include the necessary filtering. It can however be demonstrated very easily using digital synthesis and processing.

No third-party Python libraries are needed - e.g. they use the standard Python wave module. The programs demonstrate basic “table-lookup” synthesis, and block processing for efficiency. They have hard-wired parameters (no c/l arguments).

  • sf2text.py: print first 1024 samples of a soundfile (8 bit or 16 bit) as numeric text. Arguments via command line. The output text file can for example be loaded into Excel or Gnuplot for study.

  • sfbits.py: demonstrate quantisation by emulating “bit-reduction” of a sound file (8-bit or 16-bit input WAVE file), e.g. right down to 1-bit quantisation. Arguments via command line. Electronic music composers often use bit-reduction techniques when working on forms of “glitch”.