You are previewing Arduino Music and Audio Projects.
O'Reilly logo
Arduino Music and Audio Projects

Book Description

This book is for musical makers and artists who want to gain knowledge and inspiration for your own amazing creations. "Grumpy Mike" Cook, co-author of several books on the Raspberry Pi and frequent answerer of questions of the Arduino forums, brings you a fun and instructive mix and simple and complex projects to help you understand how the Arduino can work with the MIDI system to create musical instruments and manipulate sound.

In Part I you’ll find a set of projects to show you the possibilities of MIDI plus Arduino, covering both the hardware and software aspects of creating musical instruments. In Part II, you learn how to directly synthesize a wave form to create your own sounds with Arduino and concludes with another instrument project: the SpoonDuino. Finally, in Part III, you’ll learn about signal processing with the Arduino Uno and the Due — how to create effects like delay, echo, pitch changes, and realtime backwards audio output.

If you want to learn more about how to create music, instruments, and sound effects with Arduino, then get on board for Grumpy Mike’s grand tour with Arduino Music and Sound Projects.

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a glance
  6. Contents
  7. About the Author
  8. Acknowledgments
  9. Foreword
  10. Introduction
  11. Part I: MIDI and OSC
    1. Chapter 1: Basic Arduino
      1. About this Book
      2. The Arduino
      3. Arduino Architecture
        1. The Processor Block
        2. The Communications Block
        3. The User I/O Pins
        4. The Power Supply Control Block
        5. The Onboard Peripherals Block
      4. Arduino Ripoffs, Clones, and Compatibles
        1. Ripoffs
        2. Clones
        3. Arduino Certified Boards
        4. Compatibles
      5. Roll Your Own
        1. Arduino for Audio
        2. The Arduino Due
        3. The Arduino Uno
      6. Schematics
        1. What a Schematic Is and Isn’t
        2. Symbols
        3. Layout
      7. Constructional Techniques
        1. Boards
        2. Hand Tools
        3. Soldering
        4. Supply Decoupling
      8. Adding Extra Parts to an Arduino
        1. The I2C Bus
        2. The Nature of a Bus
        3. Signal Lines
        4. The SPI Bus
        5. Roll Your Own
      9. Summary
    2. Chapter 2: Basic MIDI
      1. What Is MIDI?
        1. The Electrical Signal
      2. MIDI Messages
        1. Note On
        2. Note Off
        3. Hexadecimal Notation
      3. MIDI Connections
        1. Arduino Implementation
        2. MIDI OUT
        3. MIDI IN
        4. MIDI Shield
        5. Construction
      4. Software MIDI Output
      5. Software MIDI Input
      6. Summary
    3. Chapter 3: More MIDI
      1. More MIDI Messages
        1. Controller Change (CC) MIDI Messages
        2. Program Change MIDI Messages
        3. Pitch Bend MIDI Messages
        4. Aftertouch MIDI Messages
      2. System MIDI Messages
        1. System Real-Time Messages
        2. System Common Messages
        3. System Exclusive Messages
      3. MIDI Direct to USB
        1. MIDI Through a Serial to USB Converter
        2. MIDI Through a HID USB
      4. Summary
    4. Chapter 4: MIDI Manipulation
      1. The MIDI Setup
      2. Double Tracking
        1. Basic Double Tracking
        2. Analogue Double Tracking
      3. Triple Tracking
        1. Bonus: Doubling a Note with Triple Tracking
      4. The One Finger Wonder
        1. Triad Chord Basics
        2. Creating a Triad Chord with Arduino
      5. The Arpeggiator
        1. Building a Simple Arpeggiator
        2. Building an Enhanced Arpeggiator
      6. Echo and Delays
        1. The Single Echo
        2. The Multi-Echo
      7. MIDI Looper
      8. Summary
    5. Chapter 5: MIDI Instruments
      1. Sensors and I/O
      2. Port Expander
      3. Analogue Multiplexer
      4. Sensors
      5. Force Sensors
      6. Piezo Electric Sensors
      7. Flex Sensors
      8. The Soft Pot
      9. The Touch Pad
      10. The Nunchuck
      11. The Distance Sensor
      12. MIDI Instruments
      13. The Spoon-o-Phone
      14. The Theremin
      15. MIDI Air Drums
      16. MIDI Light Show
      17. Summary
    6. Chapter 6: MIDI Harp Player
      1. The Mechanical Design
        1. Building the Harp Clamp
        2. The Plucking Mechanism
        3. Building the Staircase Drive Mounts
        4. Fitting Limit Switches on the CD Drives
        5. Mounting the Motors
      2. The Electronic Design
        1. Block Diagram of the System
        2. The Trigger
        3. The Limit Switch Select Circuit
        4. The Motor Control Block
        5. The Delay Block
        6. The Flip-Flop
        7. Assigning Gates and Packages
        8. The Arduino Controller
        9. Power Distribution
      3. The Firmware
        1. Test Software
        2. The Working Software
      4. Controlling the Harp Player
    7. Chapter 7: The DunoCaster
      1. The Concept
        1. Guitar Chords
        2. Picking
        3. Other Controls
        4. Indicators
      2. The Circuit Parts
        1. The Port Expanders
        2. Switches
        3. Rotary Encoder
      3. The Schematic
        1. The Processor
        2. The Port Expanders
        3. The String Touch Sensors
        4. The Rotary Encoder
      4. Constructing the Circuit
        1. Building the Case
        2. Constructing the Circuit
      5. The Software
        1. The Header Files
        2. The Main Code
        3. The Finished Instrument
      6. Summary
      7. Things to Do
    8. Chapter 8: OSC and Friends
      1. The Concept
        1. The Message
        2. Adding Data
        3. Sending a Message
        4. SLIP Protocol
        5. UDP Protocol
        6. OSC Bundles
        7. Practical OSC
        8. The Other End of the Link
        9. Using PD
        10. Using MAX
        11. OSC Theremin
        12. OSC Going Wireless
        13. Touch OSC
        14. The Arduino Code
        15. OSC Keyboard
        16. Touch OSC Screen
        17. Touch OSC Screen
        18. The Monome
        19. The Monome API
        20. Monome Variants
        21. Summary
    9. Chapter 9: Some More Projects
      1. The MIDI Pendulum
      2. The Sensor
      3. The Pendulum Support
      4. The Pendulum Schematic
      5. The Pendulum Software
      6. MIDI Footsteps
      7. Foot Switches
      8. Footsteps Schematic
      9. Footsteps Software
      10. Tripping the Light Fantastic
      11. MIDI Glockenspiel
      12. Solenoids
      13. MIDI Glockenspiel Schematic
      14. MIDI Glockenspiel Software
      15. MIDI Beater
      16. Servos
      17. MIDI Beater Schematic
      18. MIDI Beater Software
      19. MIDI Beater In Action
      20. Summary
  12. Part II: Generating waveforms
    1. Chapter 10: The Anatomy of a Sound
      1. What Makes Sound?
        1. Timbre: a Sound’s Individuality
        2. Amplitude
      2. One More Thing
      3. Summary
    2. Chapter 11: Square Waves
      1. Starting Off Simply
        1. Something More Interesting
        2. Making a Tune
      2. A Better Way to Generate a Tone
        1. The Tone Function
      3. Polyphonic Tones
        1. Theory
        2. Optimization
        3. Implementation
        4. Woops and Loops
    3. Chapter 12: Other Wave Shapes
      1. Not a High or a Low
        1. PWM
        2. Resistor Tap
        3. The Binary-Weighted D/A
        4. The R-2R Ladder
        5. The D/A Interface
      2. Generating a Waveform
        1. Sawtooth Example
        2. Triangle Wave Example
        3. Wave Table Output
    4. Chapter 13: The SpoonDuino
      1. What Is a SpoonDuino?
        1. SpoonDuino Building Blocks
        2. Playing Modes
        3. The Menu
      2. The Schematic
        1. Arduino and Power
        2. I2C Bus
        3. SPI Bus
        4. Mopping Up
      3. Construction
      4. The Software
        1. iPad/Android App
        2. Wave Calculating Software
        3. The Arduino Code
        4. Techniques
        5. Final Thoughts
  13. Part III: Signal Processing
    1. Chapter 14: Sampling
      1. Breaking Up a Sound into Chunks
        1. Sample Rate
        2. Quantization Error
      2. Playing Samples
        1. Getting the Sample
        2. Creating Arduino Code
        3. Arduino Sample Player
      3. More Samples
      4. Even More Samples
    2. Chapter 15: Audio Effects
      1. First Build Your Sound Card
        1. Amplifiers
        2. The Digital Circuit
        3. Construction
      2. Using the Sound Card
        1. Exterminate
      3. More Effects
        1. Delay
        2. Echo
        3. Pitch Up
        4. Pitch Down
        5. Speaking Backward
      4. Putting It All Together
      5. Finale
    3. Chapter 16: Digital Filters
      1. Types of Filter
        1. Low Pass Filter
        2. Notch Filter
        3. Frequency Response
      2. Fourier Transform
        1. A First Look at the FFT
      3. Summary
    4. Chapter 17: DSP Projects
      1. Understanding the Processor
        1. Processor Peripherals
      2. Using the Due
      3. Physical Modeling
        1. The Karplus Strong Algorithm
      4. Audio Excitation
        1. What Transfer Function to Use?
      5. Music Light Show
      6. Summary
  14. Index