Dubstep in Ruby with Sonic Pi

Dubstep in Ruby with Sonic Pi

(Or how to combine Ruby, Education and Audio Synthesis for fun and profit)

Links:

Download Sonic Pi RC: http://sonic-pi.net/get-v2.0
Computer Science: A curriculum for schools 2012: http://www.computingatschool.org.uk/data/uploads/ComputingCurric.pdf
Video explaining harmonics: http://www.mindbites.com/lesson/4603-physics-in-action-standing-waves-on-a-rope

Gists
recreating the thx deep note in 30 lines: https://gist.github.com/xavriley/418f8283af2fbe95fc90

Funky drummer: https://gist.github.com/xavriley/dd6b61c24c3aed28c892

ASCII Drum tab player: https://gist.github.com/xavriley/cdacb93dc127eafd1f16

Wobble bass: https://gist.github.com/xavriley/92dbba5de1c78177c33d

Auto dubstep: https://gist.github.com/xavriley/71b255775829b486249b

B2af84945053d954748431aa829fd324?s=128

xavriley

June 10, 2014
Tweet

Transcript

  1. Dubstep in Ruby with Sonic Pi Tuesday, 10 June 14

  2. (Or how to combine Ruby, Education and Audio Synthesis for

    fun and profit) Tuesday, 10 June 14
  3. download Sonic Pi 2.0 RC here: http://sonic-pi.net/get-v2.0 Tuesday, 10 June

    14
  4. @xavriley Tuesday, 10 June 14

  5. Nothing to do with Sonic Pi, all views my own...

    Tuesday, 10 June 14
  6. Outline on teaching programming audio synthesis 101 tour of SonicPi

    Dubstep Tuesday, 10 June 14
  7. on teaching programming Tuesday, 10 June 14

  8. Why does Sonic Pi matter? Tuesday, 10 June 14

  9. Tuesday, 10 June 14

  10. GCSE Computing 2014 Tuesday, 10 June 14

  11. Computer Science: A curriculum for schools endorsed by * Google

    * Microsoft * Intellect (UK STEM trade assoc.) Computer Science: A curriculum for schools 2012 Tuesday, 10 June 14
  12. training for industry, by industry = lobotomy (possibly...) Tuesday, 10

    June 14
  13. “ It is practically impossible to teach good programming to

    students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. Edsger Dijkstra Tuesday, 10 June 14
  14. what he’s saying here is this: It matters what you

    learn first Tuesday, 10 June 14
  15. We need hackers People who are self-motivated to learn, through

    playing with code Tuesday, 10 June 14
  16. Ruby is the perfect language to start hacking Tuesday, 10

    June 14
  17. “Ah, music,” he said, wiping his eyes. “A magic far

    beyond all we do here!” Albus Dumbledore Tuesday, 10 June 14
  18. made for classrooms designed for Raspberry Pi simple and fun

    to program Making Computer Science Audible Tuesday, 10 June 14
  19. lets you synthesize audio in *RUBY* a “real” language with

    transferable skills that’s FUN to program in Tuesday, 10 June 14
  20. works on Raspberry Pi AND OSX, Linux and windows Tuesday,

    10 June 14
  21. demo Tuesday, 10 June 14

  22. Outline on teaching programming audio synthesis 101 tour of SonicPi

    Dubstep Tuesday, 10 June 14
  23. Audio Synthesis 101 Tuesday, 10 June 14

  24. Tuesday, 10 June 14

  25. ALL ABOUT WAVES Tuesday, 10 June 14

  26. ALL ABOUT WAVES (we need to know this to make

    wobble bass later...) Tuesday, 10 June 14
  27. Sine Waves and harmonics Tuesday, 10 June 14

  28. Sine wave Pure, sterile sounding no ‘edges’ (no harmonics) Tuesday,

    10 June 14
  29. demo Tuesday, 10 June 14

  30. demo natural harmonics a.k.a. harmonic series video: http://www.mindbites.com/lesson/4603-physics-in- action-standing-waves-on-a-rope Tuesday,

    10 June 14
  31. All sounds have a mix of natural + unnatural harmonics

    Tuesday, 10 June 14
  32. Any sound can be recreated with enough sine waves see

    Fourier Transform Tuesday, 10 June 14
  33. Tuesday, 10 June 14

  34. Not a Sine (a Sawtooth wave!) Loads of crazy harmonics

    Tuesday, 10 June 14
  35. Not a Sine Loads of crazy harmonics ! Different x-axis

    ! Tuesday, 10 June 14
  36. Some more synth jargon Tuesday, 10 June 14

  37. ADSR Attack, Decay, Sustain, Release Tuesday, 10 June 14

  38. Image: https://flic.kr/p/61T21q Tuesday, 10 June 14

  39. ADSR Think “loudness over time” Tuesday, 10 June 14

  40. Noise Many/All the sine waves at once (no fundamental) Tuesday,

    10 June 14
  41. Image: http://memegenerator.net/instance/50615527 Tuesday, 10 June 14

  42. Additive Subtractive FM (Frequency modulation) Synthesis Tuesday, 10 June 14

  43. Different ways of getting the sound you want Tuesday, 10

    June 14
  44. comb filter, sawtooth, square wave, eq, pitchshift, flange, phase cancellation,

    reverb, distortion, zawa, 808, audio rates, control rates, LFO, slicer, delay, compression, FFT, pink noise, brown noise, white noise, wave shaping, red-and- yellow-and-pink-and-green-noise... Tuesday, 10 June 14
  45. comb filter, sawtooth, square wave, eq, pitchshift, flange, phase cancellation,

    reverb, distortion, zawa, 808, audio rates, control rates, LFO, slicer, delay, compression, FFT, pink noise, brown noise, white noise, wave shaping, red-and- yellow-and-pink-and-green-noise... Ask me on twitter Tuesday, 10 June 14
  46. Outline on teaching programming audio synthesis 101 tour of SonicPi

    Dubstep Tuesday, 10 June 14
  47. tour of Sonic Pi Tuesday, 10 June 14

  48. synths Tuesday, 10 June 14

  49. synths Tuesday, 10 June 14

  50. effects Tuesday, 10 June 14

  51. samples Tuesday, 10 June 14

  52. samples Psst... you don’t actually need “in_thread do ... end”

    for this to work Tuesday, 10 June 14
  53. samples You can also use any .wav file that’s available

    via a local filepath Tuesday, 10 June 14
  54. Outline on teaching programming audio synthesis 101 tour of SonicPi

    Dubstep Tuesday, 10 June 14
  55. DUBSTEP Tuesday, 10 June 14

  56. DUBSTEP Wobble bass 6/4 rhythms Funky hi-hats Samples Tuesday, 10

    June 14
  57. demo + dojo Tuesday, 10 June 14

  58. for people just viewing slides I’m linking to gists of

    all my examples recreating the thx deep note in 30 lines: https:// gist.github.com/xavriley/418f8283af2fbe95fc90 Funky drummer: https://gist.github.com/xavriley/ dd6b61c24c3aed28c892 ASCII Drum tab player: https://gist.github.com/xavriley/ cdacb93dc127eafd1f16 Wobble bass: https://gist.github.com/xavriley/ 92dbba5de1c78177c33d Auto dubstep: https://gist.github.com/xavriley/ 71b255775829b486249b Tuesday, 10 June 14
  59. Outline on teaching programming audio synthesis 101 tour of SonicPi

    Dubstep Tuesday, 10 June 14
  60. See also Overtone (Clojure) SuperCollider Max MSP / Ableton Tuesday,

    10 June 14
  61. Conclusion teach! github! make tunes! Tuesday, 10 June 14

  62. THANKS! feedback/questions to @xavriley Tuesday, 10 June 14