Digital Electronics for Musicians -  Alexandros Drymonitis

Digital Electronics for Musicians (eBook)

eBook Download: PDF
2015 | First Edition
XXI, 490 Seiten
Apress (Verlag)
978-1-4842-1583-8 (ISBN)
Systemvoraussetzungen
66,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen
This is the perfect book for musicians who want to dive into the world of computer music and physical computing. This book is aimed at adventurous musicians who want to learn about music programming with Arduino, sensors, and Pure Data, and how to make new interfaces and even new instruments with that knowledge.
 
You'll learn the basics of the Pure Data and Arduino languages, how to incorporate sensors into your musical projects, and how to use embedded computers, like the Raspberry Pi, to create stand-alone projects. Along the way, you'll learn how to create a variety of innovative (Mark, Michelle, I guess they are innovative, but not 100% sure) musical projects, including an interactive bow for stringed instruments, a MIDI clavier synthesizer, an interactive drum set, a patch-bay matrix synthesizer, a guitar looper, and even a DIY theremin.
 
If you are a musician or tinkerer who wants to explore the world of electronic and electroacoustic music and musical interfaces with Arduino, sensors, and Pure Data, Digital Electronics for Musicians is the book for you.
 
What You Will Learn
• Learn the basics of the Pure Data and the Arduino languages
• Learn more about the available sensors on the market, and how you can      incorporate them into your musical projects
• Focus on physical computing by combining Arduino and Pure Data, bringing the    physical world to the world of the computers
• Make use of additional libraries that extend the capabilities of the Arduino
• Make use of external objects in Pure Data that help achieve certain goals,  depending on the project
• Learn how a Pure Data patch functions and be able to modify other people's work  that fits your needs
• Learn how the Arduino language works, enabling the modification of already  existing code, according to your needs
• Get insight on the serial communication between the Arduino and Pure Data
• Learn how to approach various programming challenges in different ways

Who This is For 
Musicians who want to explore the world of electronic and electroacoustic music and musical interfaces with Arduino, sensors, and Pure Data.                                        



Alexandros Drymonitis is a musician from Athens, Greece. He studied at the Conservatory of Amsterdam where he got his first stimuli on music technology. Ever since he has been making electronic music using open source software and hardware, like Pure Data and Arduino, as well as giving workshops on electronic music programming and digital synthesizer building. He is also very keen on community building, and is a founding member of the Patching Circle Athens group, a group of users of visual programming languages.                         
This is the perfect book for musicians who want to dive into the world of computer music and physical computing. This book is aimed at adventurous musicians who want to learn about music programming with Arduino, sensors, and Pure Data, and how to make new interfaces and even new instruments with that knowledge. You'll learn the basics of the Pure Data and Arduino languages, how to incorporate sensors into your musical projects, and how to use embedded computers, like the Raspberry Pi, to create stand-alone projects. Along the way, you'll learn how to create a variety of innovative musical projects, including an interactive bow for stringed instruments, a MIDI clavier synthesizer, an interactive drum set, a patch-bay matrix synthesizer, a guitar looper, and even a DIY theremin. If you are a musician or tinkerer who wants to explore the world of electronic and electroacoustic music and musical interfaces with Arduino, sensors, and Pure Data, Digital Electronics for Musicians is the book for you. What You Will LearnLearn the basics of the Pure Data and the Arduino languagesLearn more about the available sensors on the market, and how you can incorporate them into your musical projectsFocus on physical computing by combining Arduino and Pure Data, bringing the    physical world to the world of the computersMake use of additional libraries that extend the capabilities of the ArduinoMake use of external objects in Pure Data that help achieve certain goals,  depending on the projectLearn how a Pure Data patch functions and be able to modify other people's work  that fits your needsLearn how the Arduino language works, enabling the modification of already  existing code, according to your needsGet insight on the serial communication between the Arduino and Pure DataLearn how to approach various programming challenges in different waysWho This is For Musicians who want to explore the world of electronic and electroacoustic music and musical interfaces with Arduino, sensors, and Pure Data.                                        

Alexandros Drymonitis is a musician from Athens, Greece. He studied at the Conservatory of Amsterdam where he got his first stimuli on music technology. Ever since he has been making electronic music using open source software and hardware, like Pure Data and Arduino, as well as giving workshops on electronic music programming and digital synthesizer building. He is also very keen on community building, and is a founding member of the Patching Circle Athens group, a group of users of visual programming languages.                         

Contents at a Glance 4
Contents 5
About the Author 15
About the Technical Reviewer 16
Acknowledgments 17
Introduction 18
Chapter 1: Introduction to Pure Data 19
Pd Basics: How It Works 20
Our First Patch 21
The Control Domain 24
Execution Order 25
Bang! 26
Comments 28
Getting Help 28
GUIs 29
Pd Patches Behave Like Text Files 30
Making Oscillators in Pd 31
Making a Triangle Wave Oscillator 32
Making a Sawtooth Oscillator 33
Making a Square Wave Oscillator 34
Using Tables in Pd 35
Subpatches and Abstractions 38
Control Domain vs. Signal Domain 42
Audio Input in Pd 44
Basic Electronic Music Techniques 45
Additive Synthesis 45
Ring Modulation 46
Amplitude Modulation 47
Frequency Modulation 48
Envelopes 49
Delay Lines in Pd 52
Reverb 56
Filters 57
Making Wireless Connections 60
Audio and MIDI Settings 64
MIDI Settings on Linux 66
A Bit More on MIDI 67
Additional Thoughts 67
Conclusion 68
Chapter 2: Introduction to Arduino 69
Arduino Jump Start 69
Parts List 70
The Blink Sketch 71
Digital Input 77
Defining Variables in Arduino 78
Further Explanation of the Code 78
Classes in Arduino and the Serial Communication 79
Further Explanation 79
Building Circuits on a Breadboard 79
Pull-up vs. Pull-down Resistors 82
Both Digital Input and Output 84
Analog Input 87
Analog Input and Output 89
Reading More Than One Pin, Arrays, and the for Loop 92
Explaining the for Loop 92
Using Arrays in Arduino 93
Analog and Digital Input 95
Communicating with Pd 99
Sending Data from Pd to Arduino 109
Conclusion 113
Chapter 3: Embedded Computers and Going Wireless 115
Before You Begin 115
Parts List 116
Why Use Embedded Computers? 116
Which Embedded Computer? 117
Getting Started with the Pi 118
Getting Your Computer’s IP 119
Logging in the Pi from OS X and Linux 120
Logging in from Windows 120
Configure the Pi 124
Navigating Through the Linux system 125
Editing Text Files in Linux 127
Installing Software 128
Installing Pd 128
Launching Pd 129
Setting up External Libraries in Pd 130
Installing Arduino 132
Let’s Talk About Versions 133
Exchanging Files Between Your Computer and the Pi 134
Transfer Files from OS X and Linux to the Pi, and Vice Versa 134
Transfer Files from Windows to the Pi and Vice Versa 135
Changing the IP of the Pi 137
Setting a Static IP on Linux 138
Setting a Static IP on OS X 139
Setting a Static IP on Windows 140
Log in to the Pi Without a Router 141
Save Login Sessions on Windows 142
Shutting Down the Pi 142
Going Wireless 144
Bluetooth vs. XBee 144
Using a Bluetooth Module with Arduino 146
Using the XBee with Arduino 149
Connecting to the XBee from Linux and OS X 149
Connecting to the XBee from Windows 152
Configuring the XBee 153
Conclusion 156
Chapter 4: Getting Started with Musical Applications 158
Parts List 158
Phase Modulation Interface 158
How Phase Modulation Works 159
Making the Pd Patch 160
Receiving Values from the Arduino 160
Implementing Phase Modulation in Pd 160
Building the Modulator Oscillator 161
Mapping the Index Values 162
Handling the Values Received from the Arduino 162
Sending Data from Pd to the Arduino 163
Arduino Code for Phase Modulation Patch 163
Defining Constants, Variables, and Pin Modes 165
Handling Input from the Serial Line 165
Reading the Analog and Digital Pins and Writing the Values to the Serial Line 165
Circuit for Arduino Code 166
A Simple Drum Machine Interface 167
Building the Pd Patch 168
The Parent Patch 168
The arduino_stuff Subpatch 168
The sound_tabs Subpatch 169
The audio_out Subpatch 171
The metronome Subpatch 172
The set_sequence Subpatch 175
The diffuse_beats Subpatch 175
The set_tab Subpatch 178
Concluding the Patch and Explaining the Data received from the Arduino 179
Arduino Code for Drum Machine Patch 179
Circuit for Arduino Code 181
Drum Machine and Phase Modulation Combination 183
Arduino Code 183
Arduino Circuit 186
Pd Patch for Drum Machine-Phase Modulation Interface 187
The arduino_stuff Subpatch 187
The metronome Subpatch 189
The drum_machine Subpatch 190
The phase_modulation Subpatch 190
The modulator Subpatch 192
Conclusion 193
Chapter 5: A Simple Synthesizer Using a MIDI Keyboard and Arduino 194
Parts List 195
What Is MIDI? 195
Pd and MIDI 196
How [notein] Works 197
Using a Different Tuning and an Amplitude Envelope with [notein] 198
Holding the Sustain Part of the Envelope 199
Polyphony with MIDI in Pd 200
MIDI Control Messages in Pd 203
Pitch Bend Messages in Pd 205
Program Change MIDI Messages in Pd 207
Arduino Code 208
Explaining the Code 211
The setup and loop Functions 212
Enter the New Technique 212
Pd Patch 213
The arduino_stuff Subpatch 214
The create_envelope and generic_data Subpatches 215
The [poly_synth~] Abstraction 217
The [pd $0-voice_creation_loop] subpatch 218
How Dollar Signs Work in Pd 220
The [synth_voice~] Abstraction 220
The modulator Subpatch and Its Subpatches 225
The carrier Subpatch 225
The Amplitude Envelope 226
The gate Subpatch, How It Works, and How We Manage the Audio of [synth_voice~] 226
The filter~ Subpatch 227
Done with Patching, Time to Test 228
Arduino Receiving MIDI Messages from the MIDI Keyboard 230
Arduino Circuit Additions 230
Arduino Code Additions 232
Pd Patch Receiving MIDI Data from Arduino 234
Pd Patch Receiving a Constant Velocity 235
Running the Pd patch on Raspberry Pi 236
Launching Pd on Boot with the Raspbian Jessie Image 237
Launching Pd on Boot with the Raspbian Wheezy Image or with Another Embedded Computer Running Debian Jessie 238
Using a USB MIDI Keyboard with the Pi 239
Shutting Down the Pi (or Any Embedded Computer) While Running Headless 240
A Small Caveat for the Raspbian and Debian Wheezy Images 241
Using an External Sound Card with the Pi 242
Editing the Pd Patch When Pd is Running on Boot 244
Enclosing the Pi in the Keyboard 245
Choosing the Perforated Board 245
Reducing the Wires of Your Circuit Board 246
Choosing the Right Power Supply and Getting Access to the Power Pins 247
Accessing the MIDI Pins 247
Bringing the Power Input and Audio Output out of the Enclosure 249
Conclusion 249
Chapter 6: An Interactive Bow 250
Parts List 250
Writing Custom Functions 251
A Function of the Data Type void 253
Actual Code for the Project 254
Detecting Button Pressed and Acting Accordingly 255
The Custom Function of the Project 256
The Test Circuit of the Accelerometer 257
The Test Pd Patch 259
Building the Pd Patch 260
How to Use the Graph-On-Parent Feature 260
Setting the Properties of the GOP GUIs 262
What We Have Achieved So Far in this Project’s Pd Patch 262
Using the Canvas to Create Visual Feedback 263
Building the Audio Processing Part of the Patch 265
Pitch Shift Subpatch 265
Frequency Modulation Subpatch 268
The Finished Patch 272
Additions to the Arduino Sketch 275
Finalizing the Circuit 277
Using Bluetooth and a Voltage Divider Instead of the XBee 281
Conclusion 283
Chapter 7: An Interactive Drum Set 284
Parts List 284
Other Things We’ll Need 285
First Approach to Detecting Drum Hits 285
First Version of the Circuit 286
Read the Drum Hits in Pd 287
Getting the Maximum Value in Arduino 288
Updating the sensor_thresh Array 289
Reading All Values Above the Threshold Along with the Maximum Value 289
Debouncing the Fluctuation Around the Threshold 291
Getting Time Stamps 293
Getting the Maximum Value in Pd 294
Having Some Fun Before We Finalize 297
Working Further with the Circuit and Arduino Code 299
Adding Switches and LEDs to the Circuit and Code 299
Using the Switches to Control Either Playback Type or Sensor Activity 303
Building the Final Pd Patch 306
Building the Audio File Abstraction 306
Converting Samples to Milliseconds and Dealing with the Sampling Rate 307
Creating Different Types of Playback 308
The “$0-ascend” subpatch 310
The $0-descend Subpatch 311
The $0-repeatedly Subpatch 313
The $0-extract_list Subpatch 314
The $0-repeat_list Subpatch 315
The $0-set_ramp_length Subpatch 316
Building the Abstraction to Receive Input from the Arduino 318
Sending the Threshold and Debounce Values to the Arduino 319
The Main Patch 319
The sound_tabs Subpatch 320
The make-window Subpatch 321
The control_type Subpatch 323
Change the Properties of the Playback Type Canvases 325
Scaling the Output of the [read_samp] Abstractions in the Parent Patch 325
Finalizing the Arduino Code 325
Making the Circuit Enclosure 328
Conclusion 332
Chapter 8: A DIY Theremin 333
Parts List 333
Using a Proximity Sensor with the Arduino 334
Refreshing Our Memory on Serial.write 335
Proximity Sensor Circuit 335
Pd Patch That Reads the Proximity Sensor Data 336
Smoothing out the Sensor Values 337
Smoothing Out Even More 340
Using Two Proximity Sensors and Four Potentiometers 342
The Arduino Code 343
The Circuit 345
The Pd Patch 346
Building the Oscillators for the Theremin 347
Creating Band-Limited Waveforms 347
Creating a Triangle Waveform with sinesum 348
Creating a Sawtooth Waveform with sinesum 349
Creating a Square Waveform with sinesum 350
Reading the Stored Band-Limited Waveforms 351
Reading Waveforms with [tabosc4~] 352
Reading Waveforms with [tabread4~] 352
Applying Phase Modulation to a Band-Limited Oscillator 353
Finalizing the Interface 355
Adding Push Buttons to the Arduino Code to Control the Waveforms of the Oscillators 355
The Global Variables 357
The setup Function 357
Using the Push Buttons to Select a Waveform 358
Controlling the LEDs According to the Switch and the Push Buttons 358
Writing the Data to the Serial Line 359
Making the Circuit 359
Putting It All Together 361
Building the Final Pd Patch 365
The Subpatches for Choosing Waveform 367
Waveforms Subpatch 368
Enclosing the Project with an Embedded Computer 370
Adding a Push Button for Switching off the Embedded Computer 372
Reading the Extra Push Button in Pd 374
Writing the Script to Shut the Embedded Computer Down 376
Loading the Pd Patch on Boot 376
Launching Pd on the Raspberry Pi with the Raspbian Jessie Image 376
Launching Pd on Other Embedded Computers or on the Raspberry Pi with the Raspbian Wheezy Image 377
Conclusion 378
Chapter 9: Making a Looper 379
Parts List 379
What Is a Looper? 380
Recording Our First Sounds in Pd 380
Playing Back the Recorded Sound 381
Smoothing the Start and End of the Recording 383
Changing the Direction of the Playback 386
Making Recordings of Arbitrary Lengths 388
Retrieving the Length of the Recording 390
Overdubbing 392
Getting Rid of Clipping 392
Getting the Start Position of the Overdubbing 393
Knowing When to Stop Overdubbing 394
Synchronizing End of Recording with Beginning of Playback 396
Start Building the Interface 397
Writing the Arduino Code 397
Writing Functions for the Foot-Switches 398
The Recording Foot-Switch Function 398
The Forward Playback Function 399
The Backward Playback Function 400
Calling the Foot-Switch Functions Dynamically 401
Introducing Pointers in C++ 401
Using Pointers to Functions 403
Defining a New Data Type for the Function Pointer 404
The First Version of the Arduino Code 405
Building the Circuit on a Breadboard 408
Working Further on the Pd Patch 409
The Recording Module 409
The Phase Module 410
The Playback Module 412
The Overdub Module 412
The Overdub Position Module 413
The Arduino Module 415
The Table Copying Module 416
Putting It All Together 419
Making Some Final Improvements 422
Modifying the Arduino Code 422
Modifying the Recording Function 422
Modifying the Forward Playback Function 423
Modifying the Backward Playback Function 424
Modifying the Beginning of the loop Function 425
Modifying the Pd Patch 425
Modifying the Phase Module 425
Modifying the Overdub Module 427
Modifying the Table Copying Module 427
Enclosing the Circuit in a Box 430
Conclusion 432
Chapter 10: A Patch-Bay Matrix Synthesizer 433
Parts List 433
What We Want to Achieve in this Chapter 434
Extending the Arduino Analog Pins 435
How a Multiplexer Works 437
Writing Code to Control a Multiplexer 438
Defining Preprocessor Directives 439
Explaining the Code Further 440
Setting the Control Pin Numbers and the Binary Masks 440
Reading the 16 Values of the Multiplexer 440
Wiring 16 Potentiometers to the Multiplexer 442
Reading the 16 Potentiometers in Pd 443
Extending the Arduino Digital Pins 444
Using the Input Shift Register 444
Writing the Arduino Code 444
Including the SPI Library 445
Defining the Global Variables and Setting up Our Program 445
The Main loop of the Program 445
Making the Input Shift Register Circuit 446
The Pd Patch That Reads the Eight Switches 447
Daisy Chaining the Input Shift Registers 448
Extending the Pd Patch to Read 16 Push Buttons 449
Using the Output Shift Register 450
Writing the Arduino Code 450
The bitSet and bitClear Functions 451
Making the Output Shift Register Circuit 452
Daisy Chaining The Output Shift Registers 454
Combining the Input and Output Shift Registers 455
Making a Patch-Bay Matrix 457
Implementing a Patch-Bay Matrix with the Arduino 457
The Main Mechanism of the Code 460
The check_connections Function 460
Continuing with the loop Function 460
Making the Pd Patch That Reads the Connections 461
Explaining the Pd Patch 462
The Heart of the Patch Mechanism 462
Detecting Connections 463
Making the Patch-Bay Matrix Circuit 463
Start Building the Audio Part of the Pd Patch 465
A Signal Matrix in Pd 465
Building the Modules for the Synthesizer 467
The First Module, a Non-Band Limited Oscillator 467
The get_inlet_outlet_switch Subpatch 468
The choose_ndx_input Subpatch 469
The choose_amp_input Subpatch 471
The waveforms Subpatches 472
The Second Module, a Band-Limited Oscillator 474
The tables Subpatch 476
The triangle Subpatch 476
Third Module, a Multiple Type Filter 476
The choose_filter_type Subpatch 477
The get_inlet_outlet_ switch Subpatch 478
The Fourth Module, Two Envelopes 479
The envelope1 Subpatch 480
The get_inlet_switch Subpatch 481
The Final Patch 482
The arduino_stuff Subpatch 483
The potentiometers Subpatch 483
The create_mtx_msg Subpatch 484
The get_switches Subpatch 486
The Final Arduino Code 487
Using Binary Numbers for Masking 491
The check_connections Function 491
The Main loop Function 491
Controlling the LEDs with the Switches of the Shift Registers 492
The Final Circuit 492
Making an Enclosure 493
Shutting down the Embedded Computer 494
Conclusion 495
Index 496

Erscheint lt. Verlag 30.12.2015
Zusatzinfo XXI, 490 p. 345 illus.
Verlagsort Berkeley
Sprache englisch
Themenwelt Kunst / Musik / Theater Musik
Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Informatik Theorie / Studium Algorithmen
Informatik Weitere Themen Hardware
Technik Elektrotechnik / Energietechnik
Technik Maschinenbau
Schlagworte Arduino • Computer Music • Drum • electroacoustic • electronic music • Electronics • Embedded • guitar • Keyboard • microtonal • music • Music Programming • programming • Pure Data • Synthesizer
ISBN-10 1-4842-1583-4 / 1484215834
ISBN-13 978-1-4842-1583-8 / 9781484215838
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 17,0 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Build memory-efficient cross-platform applications using .NET Core

von Trevoir Williams

eBook Download (2024)
Packt Publishing (Verlag)
29,99
Learn asynchronous programming by building working examples of …

von Carl Fredrik Samson

eBook Download (2024)
Packt Publishing Limited (Verlag)
29,99