Digital electronics for musicians by alexandros drymonitis

505 94 0
Digital electronics for musicians by alexandros drymonitis

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TECHNOLOGY IN AC TION™ Digital Electronics for Musicians Build Intuitive Electronic and Electroacoustic Music Interfaces — Alexandros Drymonitis www.electronicbo.com Digital Electronics for Musicians Alexandros Drymonitis Digital Electronics for Musicians Copyright © 2015 by Alexandros Drymonitis This work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed Exempted from this legal reservation are brief excerpts in connection with reviews or scholarly analysis or material supplied specifically for the purpose of being entered and executed on a computer system, for exclusive use by the purchaser of the work Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publisher’s location, in its current version, and permission for use must always be obtained from Springer Permissions for use may be obtained through RightsLink at the Copyright Clearance Center Violations are liable to prosecution under the respective Copyright Law ISBN-13 (pbk): 978-1-4842-1584-5 ISBN-13 (electronic): 978-1-4842-1583-8 Trademarked names, logos, and images may appear in this book Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made The publisher makes no warranty, express or implied, with respect to the material contained herein Managing Director: Welmoed Spahr Lead Editor: Michelle Lowman Technical Reviewer: Johan Eriksson Editorial Board: Steve Anglin, Pramila Balan, Louise Corrigan, James T DeWolf, Jonathan Gennick, Robert Hutchinson, Celestin Suresh John, Michelle Lowman, James Markham, Susan McDermott, Matthew Moodie, Jeffrey Pepper, Douglas Pundick, Ben Renow-Clarke, Gwenan Spearing Coordinating Editor: Mark Powers Copy Editor: Kimberly Burton Compositor: SPi Global Indexer: SPi Global Artist: SPi Global Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc) SSBM Finance Inc is a Delaware corporation For information on translations, please e-mail rights@apress.com, or visit www.apress.com Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use eBook versions and licenses are also available for most titles For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/bulk-sales Any source code or other supplementary materials referenced by the author in this text is available to readers at www.apress.com/9781484215845 For detailed information about how to locate your book’s source code, go to www.apress.com/source-code/ Readers can also access source code at SpringerLink in the Supplementary Material section for each chapter Contents at a Glance About the Author�����������������������������������������������������������������������������������������������������xv Acknowledgments��������������������������������������������������������������������������������������������������xix Introduction������������������������������������������������������������������������������������������������������������xxi ■Chapter ■ 1: Introduction to Pure Data��������������������������������������������������������������������� ■Chapter ■ 2: Introduction to Arduino���������������������������������������������������������������������� 51 ■Chapter ■ 3: Embedded Computers and Going Wireless���������������������������������������� 97 ■Chapter ■ 4: Getting Started with Musical Applications�������������������������������������� 141 ■Chapter ■ 5: A Simple Synthesizer Using a MIDI Keyboard and Arduino������������� 177 ■Chapter ■ 6: An Interactive Bow��������������������������������������������������������������������������� 233 ■Chapter ■ 7: An Interactive Drum Set������������������������������������������������������������������� 267 ■Chapter ■ 8: A DIY Theremin�������������������������������������������������������������������������������� 317 ■Chapter ■ 9: Making a Looper������������������������������������������������������������������������������ 363 ■Chapter ■ 10: A Patch-Bay Matrix Synthesizer���������������������������������������������������� 417 Index��������������������������������������������������������������������������������������������������������������������� 481 iii www.electronicbo.com About the Technical Reviewer�������������������������������������������������������������������������������xvii Contents About the Author�����������������������������������������������������������������������������������������������������xv About the Technical Reviewer�������������������������������������������������������������������������������xvii Acknowledgments��������������������������������������������������������������������������������������������������xix Introduction������������������������������������������������������������������������������������������������������������xxi ■Chapter ■ 1: Introduction to Pure Data��������������������������������������������������������������������� Pd Basics: How It Works��������������������������������������������������������������������������������������������������� Our First Patch����������������������������������������������������������������������������������������������������������������� The Control Domain�������������������������������������������������������������������������������������������������������������������������������� Execution Order�������������������������������������������������������������������������������������������������������������������������������������� Bang!������������������������������������������������������������������������������������������������������������������������������������������������������ Comments�������������������������������������������������������������������������������������������������������������������������������������������� 10 Getting Help�������������������������������������������������������������������������������������������������������������������� 10 GUIs�������������������������������������������������������������������������������������������������������������������������������� 11 Pd Patches Behave Like Text Files�������������������������������������������������������������������������������������������������������� 12 Making Oscillators in Pd������������������������������������������������������������������������������������������������� 13 Making a Triangle Wave Oscillator�������������������������������������������������������������������������������������������������������� 14 Making a Sawtooth Oscillator��������������������������������������������������������������������������������������������������������������� 15 Making a Square Wave Oscillator��������������������������������������������������������������������������������������������������������� 16 Using Tables in Pd���������������������������������������������������������������������������������������������������������� 17 Subpatches and Abstractions����������������������������������������������������������������������������������������� 20 Control Domain vs Signal Domain��������������������������������������������������������������������������������� 24 Audio Input in Pd������������������������������������������������������������������������������������������������������������ 26 v ■ Contents Basic Electronic Music Techniques�������������������������������������������������������������������������������� 27 Additive Synthesis�������������������������������������������������������������������������������������������������������������������������������� 27 Ring Modulation������������������������������������������������������������������������������������������������������������������������������������ 28 Amplitude Modulation�������������������������������������������������������������������������������������������������������������������������� 29 Frequency Modulation�������������������������������������������������������������������������������������������������������������������������� 30 Envelopes��������������������������������������������������������������������������������������������������������������������������������������������� 31 Delay Lines in Pd���������������������������������������������������������������������������������������������������������������������������������� 34 Reverb�������������������������������������������������������������������������������������������������������������������������������������������������� 38 Making Wireless Connections���������������������������������������������������������������������������������������� 42 Audio and MIDI Settings����������������������������������������������������������������������������������������������������������������������� 46 Additional Thoughts�������������������������������������������������������������������������������������������������������� 49 Conclusion���������������������������������������������������������������������������������������������������������������������� 50 ■Chapter ■ 2: Introduction to Arduino���������������������������������������������������������������������� 51 Arduino Jump Start�������������������������������������������������������������������������������������������������������� 51 Parts List������������������������������������������������������������������������������������������������������������������������ 52 The Blink Sketch������������������������������������������������������������������������������������������������������������ 53 Digital Input�������������������������������������������������������������������������������������������������������������������� 59 Defining Variables in Arduino���������������������������������������������������������������������������������������������������������������� 60 Further Explanation of the Code����������������������������������������������������������������������������������������������������������� 60 Classes in Arduino and the Serial Communication������������������������������������������������������������������������������� 61 Further Explanation������������������������������������������������������������������������������������������������������������������������������ 61 Building Circuits on a Breadboard�������������������������������������������������������������������������������������������������������� 61 Pull-up vs Pull-down Resistors������������������������������������������������������������������������������������� 64 Both Digital Input and Output����������������������������������������������������������������������������������������� 66 Analog Input������������������������������������������������������������������������������������������������������������������� 69 Analog Input and Output������������������������������������������������������������������������������������������������� 71 Reading More Than One Pin, Arrays, and the for Loop��������������������������������������������������� 74 Explaining the for Loop������������������������������������������������������������������������������������������������������������������������� 74 Using Arrays in Arduino������������������������������������������������������������������������������������������������������������������������ 75 vi www.electronicbo.com Filters���������������������������������������������������������������������������������������������������������������������������������������������������� 39 ■ Contents Analog and Digital Input������������������������������������������������������������������������������������������������� 77 Communicating with Pd������������������������������������������������������������������������������������������������� 81 Sending Data from Pd to Arduino����������������������������������������������������������������������������������� 91 Conclusion���������������������������������������������������������������������������������������������������������������������� 95 ■Chapter ■ 3: Embedded Computers and Going Wireless���������������������������������������� 97 Before You Begin������������������������������������������������������������������������������������������������������������ 97 Parts List������������������������������������������������������������������������������������������������������������������������ 98 Why Use Embedded Computers?����������������������������������������������������������������������������������� 98 Which Embedded Computer?��������������������������������������������������������������������������������������������������������������� 99 Getting Started with the Pi������������������������������������������������������������������������������������������� 100 Getting Your Computer’s IP����������������������������������������������������������������������������������������������������������������� 101 Logging in the Pi from OS X and Linux����������������������������������������������������������������������������������������������� 102 Logging in from Windows������������������������������������������������������������������������������������������������������������������� 102 Configure the Pi���������������������������������������������������������������������������������������������������������������������������������� 106 Navigating Through the Linux system�������������������������������������������������������������������������� 107 Editing Text Files in Linux������������������������������������������������������������������������������������������������������������������� 109 Installing Software������������������������������������������������������������������������������������������������������� 110 Installing Pd���������������������������������������������������������������������������������������������������������������������������������������� 110 Launching Pd�������������������������������������������������������������������������������������������������������������������������������������� 111 Setting up External Libraries in Pd����������������������������������������������������������������������������������������������������� 112 Installing Arduino�������������������������������������������������������������������������������������������������������������������������������� 114 Let’s Talk About Versions������������������������������������������������������������������������������������������������������������������� 115 Exchanging Files Between Your Computer and the Pi�������������������������������������������������� 116 Transfer Files from OS X and Linux to the Pi, and Vice Versa������������������������������������������������������������� 116 Transfer Files from Windows to the Pi and Vice Versa������������������������������������������������������������������������ 117 Changing the IP of the Pi���������������������������������������������������������������������������������������������� 119 Setting a Static IP on Linux����������������������������������������������������������������������������������������������������������������� 120 Setting a Static IP on OS X������������������������������������������������������������������������������������������������������������������ 121 Setting a Static IP on Windows����������������������������������������������������������������������������������������������������������� 122 Log in to the Pi Without a Router�������������������������������������������������������������������������������������������������������� 123 vii ■ Contents Shutting Down the Pi���������������������������������������������������������������������������������������������������� 124 Going Wireless�������������������������������������������������������������������������������������������������������������� 126 Bluetooth vs XBee����������������������������������������������������������������������������������������������������������������������������� 126 Using a Bluetooth Module with Arduino��������������������������������������������������������������������������������������������� 128 Using the XBee with Arduino�������������������������������������������������������������������������������������������������������������� 131 Conclusion�������������������������������������������������������������������������������������������������������������������� 138 ■Chapter ■ 4: Getting Started with Musical Applications�������������������������������������� 141 Phase Modulation Interface����������������������������������������������������������������������������������������� 141 How Phase Modulation Works������������������������������������������������������������������������������������������������������������ 142 Making the Pd Patch��������������������������������������������������������������������������������������������������������������������������� 143 Arduino Code for Phase Modulation Patch����������������������������������������������������������������������������������������� 146 Circuit for Arduino Code���������������������������������������������������������������������������������������������������������������������� 149 A Simple Drum Machine Interface������������������������������������������������������������������������������� 150 Building the Pd Patch������������������������������������������������������������������������������������������������������������������������� 151 Arduino Code for Drum Machine Patch���������������������������������������������������������������������������������������������� 162 Drum Machine and Phase Modulation Combination���������������������������������������������������� 166 Arduino Code�������������������������������������������������������������������������������������������������������������������������������������� 166 Arduino Circuit������������������������������������������������������������������������������������������������������������������������������������ 169 Pd Patch for Drum Machine-Phase Modulation Interface������������������������������������������������������������������ 170 Conclusion�������������������������������������������������������������������������������������������������������������������� 176 ■Chapter ■ 5: A Simple Synthesizer Using a MIDI Keyboard and Arduino������������� 177 Parts List���������������������������������������������������������������������������������������������������������������������� 178 What Is MIDI?��������������������������������������������������������������������������������������������������������������� 178 Pd and MIDI������������������������������������������������������������������������������������������������������������������ 179 How [notein] Works���������������������������������������������������������������������������������������������������������������������������� 180 Using a Different Tuning and an Amplitude Envelope with [notein]���������������������������������������������������� 181 Polyphony with MIDI in Pd������������������������������������������������������������������������������������������������������������������ 183 viii www.electronicbo.com Parts List���������������������������������������������������������������������������������������������������������������������� 141 ■ Contents MIDI Control Messages in Pd�������������������������������������������������������������������������������������������������������������� 186 Pitch Bend Messages in Pd���������������������������������������������������������������������������������������������������������������� 188 Program Change MIDI Messages in Pd���������������������������������������������������������������������������������������������� 190 Arduino Code���������������������������������������������������������������������������������������������������������������� 191 Explaining the Code���������������������������������������������������������������������������������������������������������������������������� 194 Pd Patch����������������������������������������������������������������������������������������������������������������������� 196 The arduino_stuff Subpatch��������������������������������������������������������������������������������������������������������������� 197 The create_envelope and generic_data Subpatches������������������������������������������������������������������������� 198 The [poly_synth~] Abstraction����������������������������������������������������������������������������������������������������������� 200 The [pd $0-voice_creation_loop] subpatch���������������������������������������������������������������������������������������� 201 How Dollar Signs Work in Pd�������������������������������������������������������������������������������������������������������������� 203 The [synth_voice~] Abstraction���������������������������������������������������������������������������������������������������������� 203 The filter~ Subpatch��������������������������������������������������������������������������������������������������������������������������� 210 Done with Patching, Time to Test�������������������������������������������������������������������������������������������������������� 211 Arduino Receiving MIDI Messages from the MIDI Keyboard���������������������������������������� 213 Arduino Circuit Additions�������������������������������������������������������������������������������������������������������������������� 213 Arduino Code Additions���������������������������������������������������������������������������������������������������������������������� 215 Pd Patch Receiving MIDI Data from Arduino��������������������������������������������������������������������������������������� 217 Running the Pd patch on Raspberry Pi������������������������������������������������������������������������� 219 Launching Pd on Boot with the Raspbian Jessie Image��������������������������������������������������������������������� 220 Launching Pd on Boot with the Raspbian Wheezy Image or with Another Embedded Computer Running Debian Jessie����������������������������������������������������������������������������������������������������������������������� 221 Shutting Down the Pi (or Any Embedded Computer) While Running Headless��������������������������������������������������������������������������������������������������������������������� 223 A Small Caveat for the Raspbian and Debian Wheezy Images����������������������������������������������������������� 224 Using an External Sound Card with the Pi������������������������������������������������������������������������������������������ 225 Editing the Pd Patch When Pd is Running on Boot����������������������������������������������������������������������������� 227 Enclosing the Pi in the Keyboard���������������������������������������������������������������������������������� 228 Choosing the Perforated Board����������������������������������������������������������������������������������������������������������� 228 ix ■ Contents Reducing the Wires of Your Circuit Board��������������������������������������������������������������������� 229 Choosing the Right Power Supply and Getting Access to the Power Pins������������������������������������������ 230 Accessing the MIDI Pins��������������������������������������������������������������������������������������������������������������������� 230 Bringing the Power Input and Audio Output out of the Enclosure������������������������������������������������������ 232 Conclusion�������������������������������������������������������������������������������������������������������������������� 232 ■Chapter ■ 6: An Interactive Bow��������������������������������������������������������������������������� 233 Parts List���������������������������������������������������������������������������������������������������������������������� 233 A Function of the Data Type void�������������������������������������������������������������������������������������������������������� 236 Actual Code for the Project����������������������������������������������������������������������������������������������������������������� 237 The Test Circuit of the Accelerometer������������������������������������������������������������������������������������������������� 240 The Test Pd Patch������������������������������������������������������������������������������������������������������������������������������� 242 Building the Pd Patch��������������������������������������������������������������������������������������������������� 243 How to Use the Graph-On-Parent Feature������������������������������������������������������������������������������������������ 243 Setting the Properties of the GOP GUIs����������������������������������������������������������������������������������������������� 245 What We Have Achieved So Far in this Project’s Pd Patch����������������������������������������������������������������� 245 Using the Canvas to Create Visual Feedback�������������������������������������������������������������������������������������� 246 Building the Audio Processing Part of the Patch�������������������������������������������������������������������������������� 248 The Finished Patch����������������������������������������������������������������������������������������������������������������������������� 255 Additions to the Arduino Sketch����������������������������������������������������������������������������������� 258 Finalizing the Circuit����������������������������������������������������������������������������������������������������� 260 Using Bluetooth and a Voltage Divider Instead of the XBee��������������������������������������������������������������� 264 Conclusion�������������������������������������������������������������������������������������������������������������������� 266 ■Chapter ■ 7: An Interactive Drum Set������������������������������������������������������������������� 267 Parts List���������������������������������������������������������������������������������������������������������������������� 267 Other Things We’ll Need����������������������������������������������������������������������������������������������� 268 First Approach to Detecting Drum Hits������������������������������������������������������������������������� 268 First Version of the Circuit������������������������������������������������������������������������������������������������������������������ 269 Read the Drum Hits in Pd������������������������������������������������������������������������������������������������������������������� 270 x www.electronicbo.com Writing Custom Functions�������������������������������������������������������������������������������������������� 234 Chapter 10 ■ A Patch-Bay Matrix Synthesizer Using Binary Numbers for Masking We jumped line 39 deliberately, because we need to explain it separately In this line we define a binary number, hence the capital B in the beginning of it This way, we can define binary numbers in the Arduino language This number represents the pins of the last input shift register where the three switches are attached to These are the last three pins, that’s why the first three digits of this number are 1s and the rest are 0s Shift registers map their bytes this way, the Least Significant Bit (referred to as LSB, it’s the rightmost digit) represents the state of the first pin, and the Most Significant Bit (referred to as MSB, it’s the leftmost digit) represents the state of the last pin We’ll need this value to mask the last byte of the input_bytes array If we don’t mask it, and we change the position of a switch but we don’t make a new connection, this byte will change and the test we make in the check_connections function to see whether we have a change in the input_bytes array will succeed, even if no new connection has occurred This will result in storing this byte to the transfer_array Consequently, it will trigger the loop that detects connections in Pd, as shown in Figure 10-33 Anyway, in Pd, we only go through the connection pins, so the patch wouldn’t try to make a new connection, but the loop would be triggered Masking this byte will prevent this loop from being triggered, because we use [change], and the positions of the switches won’t affect this last byte at all Using a binary value instead of a decimal is very convenient in such cases because we don’t need to really think arithmetically With such a number, we can clearly represent our circuit, since we can just use 1s for the chip pins we’re interested and 0s for the pins we don’t need The check_connections Function We’ve introduced a small modification in the check_connections function What we is copy the byte of the input_bytes array because if we’re iterating through its last byte, we need to mask it with the binary reversed value the switch_mask variable hold We reverse this value by using the tilde character (~) This is another bitwise operation that swaps the bits of a value, replacing all 1s with 0s and vice versa The switch_mask variable has 1s in the bits of the switches, but we need to mask the last byte of the input_bytes array the other way round, having 1s in the bits of the connection pins If we don’t copy this byte, we’ll modify it and we won’t be able to detect the switch positions anymore, as the bits of the switches will have 0s no matter what we with them We could have stored a binary value with the switch pins set to 0, but I found it a bit more intuitive to set these pins to 1, as it makes it clearer that we need to isolate them The Main loop Function In the main loop function, the first thing we is check if we’ve received data from the serial line This will happen only when we turn the DSP on in Pd If we receive data, we’ll set the state of the DSP LED using the bitWrite function This function is very similar to the bitSet and bitClear functions we’ve already used, but it takes three arguments, the byte to write to one of its bits to, the bit of the byte, and the value to write to that bit The DSP LED is wired to the last output shift register, so we use the last byte of the output_bytes array The bit of that byte is set by the dsp_led variable, and the value of that bit is set by the byte we receive from the serial line After that, we go on and read the fifteen potentiometers of our circuit, and then we check if we have a new connection in the patch-bay matrix In line 154, we store the last byte of the input_bytes array to the transfer_array We’ll use that byte to retrieve the states of the three switches of our circuit For this reason we mask it with the switch_mask variable, this time without inverting it (so defining it this way and not inverted was not without a reason after all) Again, this is not really necessary, but it will prevent the loop that detects the switch states from being triggered, saving some little CPU in Pd We’ve already seen how we detect the switch states when I explained the [pd get_switches] subpatch inside the [pd arduino_stuff ] subpatch of the final Pd patch 475 Chapter 10 ■ A Patch-Bay Matrix Synthesizer Controlling the LEDs with the Switches of the Shift Registers In lines 158 and 159, we make copies of the first_switch and first_led variables, because we want to post-increment them If we used these variables immediately, we would change their values and after the first iteration of the loop function, they would already be beyond the bounds of the shift register pins In line 160, we run a loop for the two switches that control their LEDs without serial data intervening This time we use a combination of the bitRead and the bitWrite function to read each switch value and write it to its LED The former is similar to the latter, only it takes two arguments instead of three: the byte to read a bit from and the bit of the byte to read It shouldn’t be too hard to understand how this loop works Finally, we write the transfer_array to serial line This concludes the Arduino code for this project You’ll probably know how to build the circuit already, but it is shown here anyway Figure 10-39 illustrates it with breakouts for the multiplexer and the output shift registers (refer to previous sections of this chapter for wiring the ICs) The potentiometers are not included in the circuit because it would become rather messy You should know how to wire them by now The three switches wired to the last three pins of the second input shift register and the three LEDs wired to the last three pins of the second output shift register are included Take care to connect one pin of the switch to the voltage (if it’s an ON/ON switch, this should be the middle pin) You can now test your circuit with the Pd patch, you’ve made a patch-bay matrix synthesizer! Figure 10-39.  The final circuit 476 www.electronicbo.com The Final Circuit Chapter 10 ■ A Patch-Bay Matrix Synthesizer Making an Enclosure We’ve already made a few enclosures in this book, but with this one, there are a few tips and tricks that you might find helpful First, since this project is highly customizable, you could argue if the setup of the hardware interface should be project specific, or if it should be more generic so that it can host other implementations of the software This means that you should decide where to place all the components on the enclosure Having all the female banana terminals placed according to the connections of the software they represent, and the potentiometers grouped according to the modules of the software they control is very helpful for the specific project, but limits the hardware interface to this project’s software On the other hand, making a generic layout can be a bit confusing, as you should remember what each component is for, and the layout won’t help in telling that Figure 10-40 shows my approach to the hardware layout of the patchbay matrix and the other components This figure includes some connections between banana terminals to show how they are to be connected As you can see, I chose to have the patch-bay in the middle so I can use the same enclosure for another type of synthesizer This way, I’m not limited to the software built in this chapter I’ve also used 16 potentiometers instead of 15 to have as many as the multiplexer provides in case I want to use this enclosure for another project It’s up to you which route you’ll take in designing this Figure 10-40.  A patch-bay matrix synthesizer layout Another thing you might want to have is access to the Ethernet, in case you embed a computer in the enclosure A good idea is to use an Ethernet gender changer (this is actually a female-to-female Ethernet port) and a flexible Ethernet cable, so you can connect your embedded computer’s Ethernet to the gender changer, which on its other side is a female Ethernet, thus giving you access to the port of the embedded computer Lastly, concerning the banana terminals, it is a good idea to use different colors for different purposes In Figure 10-40, I’ve used black bananas for input (matrix and shift register output) and red for output (matrix and shift register input) You might want to use a third color for control signal inlets (the phase inlet of the oscillators, for example), especially if you make your layout based on the specific project All the female banana terminals are wired to the free pins of the input and output shift registers, which are pins A to H on the breakouts and D0 to D7 on the input IC and QA to QH on the output IC By free I mean all these pins that are not wired to switches or LEDs (refer to Figure 10-39) Using cables with male banana terminals enables us to make connections between input and output pins, much like we did with the jumper wires on the breadboard version of this project 477 Chapter 10 ■ A Patch-Bay Matrix Synthesizer You also might want to include a diode in each patch cord Banana terminals can be stacked so that you can connect more than one patch cord to a female banana Using diodes in the patch cords will prevent the current flowing from one patch cord to another in case of stacked bananas In Figure 10-40, if no diodes were included in the patch cords, output pin 9, which is connected to input pin 7, would seem like it’s also connected to input pin That’s because while the output pin would be HIGH, its current would flow through the cable of the patch cord to input pin But that input pin has two banana terminals stacked This would result in the current flowing further to output pin and from there to input pin Try to follow the connections in Figure 10-40 and you’ll understand The white patches in the cables include diodes, which prevent the current flowing from an input to an output The ring of the diode is oriented toward the black banana terminal, which connects to the output shift registers As you can see in Figure 10-40, I’ve included an additional push button (on the right side of the three switches) I’m using this to shut down the embedded computer, like we’ve done in previous chapters This push button is connected to one of the free digital pins of the Arduino, using the internal pull-up resistor (This means that in the circuit, its one leg should connect to the Arduino digital pin, and the other to ground.) I suggest that you read this switch at the end of all data (this means that you must modify the array index the three switch byte is stored at), using the exclamation mark to reverse its value (remember, the pullup resistor reads HIGH when the button is not pressed) As always, you need to write a script to kill Pd and shut the embedded computer down, which you can call with [shell] I’m using the DSP switch to control whether this button’s values go through or not, so that I can’t accidentally shut down the computer while the DSP is running Figure 10-41 shows the addition to the [pd get_switches] subpatch The rest are left for you to implement yourself, as you should be pretty familiar with the process by now Note that you’ll have to change the fourth argument to [serial_write], since it will now receive bytes as “digital” values 478 www.electronicbo.com Shutting down the Embedded Computer Chapter 10 ■ A Patch-Bay Matrix Synthesizer Figure 10-41.  Addition to the get_switches subpatch to shut the embedded computer down Conclusion We have built a rather complex instrument that comprises many levels, in both the software and the hardware You have been introduced to techniques and devices that expand the capabilities of the Arduino You’ve seen that you can use very simple principles, like setting a digital pin HIGH or LOW, read these voltages from another digital pin, and create a much more complex interface This last project was probably the most difficult of all the projects in this book Still, the programming level increased chapter by chapter, so by reaching this chapter, you should now have the understanding and tools to follow the process of making an instrument You have seen a lot of different techniques and approaches to making musical interfaces Now you should be able to create your own projects, solve problems, and come up with original ideas in both the technical and the creative processes 479 Index Abstractions See also Subpatches contents of, 22 definition, 22 error message, 24 preferences window, 23 Additive synthesis, 27 American Standard Code for Information Interchange (ASCII), 82 Amplitude modulation (AM), 29 Analog pins Arduino Uno, 420 binary masks, 424 breakout version, 419 explanation, 424 main loop function, 424–425 multiplexer, 421 Pd patch, 427 potentiometers, 426 preprocessor directive, 423 writing code, 422–423 Analog-to-digital converter (ADC), 26–27 Arduino advantages and disadvantages, 51 analog input and output analogRead function, 70 analogWrite function, 73 circuit, 70, 73, 80–81 code, 72, 78 components, 71, 77 control structure, 79 loop function, 72 parts list, 69 pinMode function, 72, 79 println function, 79–80 pulse-width modulation, 72 serial monitor, 71 setup function, 79 single line, 79 sketch code, 69 string, 79 arrays analogRead function, 75 features, 75 for loop, 75 potentiometer circuit, 76–77 println function, 75 blink sketch boards menu, 57 comments, 54 compilation process progress, 58 digitalWrite function, 56 Hello World! program, 55 indication, 58 LED connection, 58 loop function, 56 multiline comment, 56 sketch window, 53–54 UNO, 53 upload progress, 58 Bluetooth module, 128–130 breadboard digital input circuit, 63 push button, 63 serial monitor, 64 wiring, 62 code, 441–443 digital input and output breadboard, 61, 63–64 circuit, 67, 80–81 classes, 61 code, 78 components, 59, 77 control structure, 79 digitalRead function, 67, 69 explanation, 60–61 part list, 66 pinMode function, 60, 79 println function, 79–80 programming code, 59–60, 66 serial communication, 61 setup function, 79 www.electronicbo.com „„         A 481 ■ index Arduino (cont.) single line, 79 string, 79 variable definition, 60 drum machine circuit, 164–165, 169 interface, 162–163 programmimg code, 162–164, 166–168 Firmata library, 52 for loop, 74 Genuino, 52 installation, 114–115 main mechanism check_connections function, 444 code, 443 loop Function, 444 overview, 51 parts list, 52–53 Pd (see Pure data (Pd):Arduino) vs phase machine circuit, 169 programming code, 166–168 phase modulation analog and digital pins, 148 circuit, 149–150 code, 146–148 constants, variables and pin modes, 148 handling input, 148 pin, 74 prototyping platform, 51 pull-up vs pull-down resistors, 64–65 sending data analogWrite function, 94 components, 91 else if statement, 93 if control structure, 91, 93 loop function, 93 pins, 92 programming code, 91 PWM pins, 94 read function, 92 textual programming language, 51 XBee Linux and OS X, 131–133 Wondows, 134–135, 137–138 Arduino digital pins input and output, 439–441 input shift register, 428 Arduino code, 428 circuit, 430 daisy chain, 432 global variables, 429 main loop function, 429 Pd patch, 431 reading 16 push buttons, 433–434 SPI library, 429 482 output shift register bitSet and bitClear functions, 435 circuit, 436–437 code, 434–435 daisy chaining, 438–439 arduino_stuff subpatch, 197 contents of, 467 create_mtx_msg, 468 get_switches, 470 potentiometers, 467 Attack-Decay-Sustain-Release (ADSR), 32 „„         B Band-limited oscillator, 458 abstraction, 459 tables, 460 triangle, 460 Band pass filter, 40 bitSet and bitClear functions, 435, 475 bitWrite function, 475 Bluetooth module Arduino configuration, 129 connection, 128–129 firmwareversion, 131 myBTmodule, 130 vs XBee, 126–127 „„         C check_connections function, 475 Command-line interface (CLI), 11 Control vs signal domains digital electronics, 24 Hslider, 26 oscillator, 24–25 value changes, 25 create_mtx_msg subpatch, 469 Cutoff frequency, 39 „„         D Data flow programming, Debian Jessie image, 221 Delay lines arguments, 34–35 feedback, 36 oscillators, 38 slider’s properties window, 37 variable delay, 36 Digital signal processing (DSP), Digital-to-analog converter (DAC), Drum machine interface Arduino circuit, 164–165 Arduino code, 162–164 ■ Index „„         E Electronic music techniques additive synthesis, 27–28 amplitude modulation, 29 delay lines arguments, 34–35 feedback, 36 oscillators, 38 slider’s properties window, 37 variable delay, 36 envelopes ADSR, 32 ggee/envgen, 31 horizontal line, 32 modulator frequency, 33–34 filters, 39, 41–42 frequency modulation, 30 reverb, 38 ring modulation, 28–29 Embedded computers Arduino, 114–115 BeagleBone Black, 99 Debian Linux flavor, 100 DIY communities, 99 exchannging files, computer and Pi OS X and Linux, 116–117 Windows, 117–119 goal of, 98 Internet Protocol interfaces file, 120 Linux, 120–121 OS X, 121 Pi, 119 router, 123–124 subgroup, 120 Windows XP, 122 Linux system change directory, 108 command-line prompt, 107 make directory, 108 nano, 109 present working directory, 107 prompt, 107–108 remove, 110 text editing, 109 parts list, 98 Pd installation, 110–114 Raspberry Pi computer’s IP, 101 configuration, 106 external monitor, 100 OS X and Linux, 102 overview, 100 shut down, 124–125 Windows, 102–104 Zenmap’s window, 101 Raspbian, 99 shields, 97 software versions, 115 use of, 98 wireless, 126 Arduino and Bluetooth, 128–131 Bluetooth vs XBee, 126–127 XBee Arduino shield, 131–132, 134–135, 137–138 XBee, 98 envelope1 subpatch, 464 Envelopes ADSR, 32 ggee/envgen, 31 horizontal line, 32 modulator frequency, 33–34 www.electronicbo.com Pure Data arduino_stuff subpatch, 151 audio_out, 154–155 data receiving and patch, 162 diffuse_beats, 158–160 metronome, 155, 157 parent patch, 151 patch, 150 set_sequence, 158 set_tab, 161–162 sound_tabs, 152–153 Dynamic patching, 190 „„         F Filters band pass filter, 40 contents, 42 cutoff, 39 low pass filter, 40 rpole and cpole, 39 vcf action, 41 filter~ subpatch, 210 Foot-switch function backward playback function, 384 forward playback function, 383 pointer, 387 Arduino IDE serial monitor, 387 data type, 386 definition, 385 dereference operator, 386 function, 387 pseudo-code, 386 reference operator, 386 variable, 385 record, 382 483 ■ index Four-point interpolation, 336 Frequency modulation subpatch, 30 delreader subpatch, 254–255 delwriter subpatch, 254 freq_modulation, 252–253 subpatches, 251 waveforms subpatch, 253 Function pointer, 387 „„         G Genuino, 52 get_inlet_switch subpatch, 465 get_switches subpatch, 470 Graphical user interface (GUI) CLI, 11 Put menu, 11 radio, 12 text editing programs, 12 textual form, 12 Toggle, 12 Vslider and Hslider, 12 Graph-On-Parent (GOP) accelerometer, 243 canvas properties, 244 feature, 243 parent patch, 244 subpatch appearance, 244 „„         H Horizontal slider (Hslider), 12 „„         I, J, K Integrated circuit (ICs), 417 Interactive bow Arduino sketch code, 258–259 audio processing stuff finished parent patch, 255, 257 frequency modulation subpatch, 251, 253, 255 phantom power, 248 pitch_shift, 248, 250 circuit, 261 accelerometer, 260, 262 Arduino side, 262 Bluetooth module, 264 perforated board, 260–261 sensor side, 261, 263 voltage divider, 264 XBee Explorer, 261 484 parts list, 233 Pd patch Graph-On-Parent, 243–244 parent patch, 245–246 subpatches, 246 tilt sensing, 233 visual feedback canvas control, 246 contents of subpatch, 247 parent patch, 247 sensor axes, 248 writing custom functions accelerometer code, 237–238 actual code, 237–238 bytes, 235 circuit, 240–241 code, 234 custom-made function, 239–240 data type void, 236 double_val function, 235 double_val variable, 234 push buttons, 238–239 Serial.write function, 235 test Pd patch, 242 Interactive drum set analog pins, 268 Arduino code loop function, 309 new arrays initialization, 308 piezo elements, 310 serial line, 309 threshold and debounce value, 308–309 Arduino Uno, 267 audio file abstraction $0-ascend subpatch, 293 $0-descend subpatch, 294 $0-extract_list subpatch, 297 [line~], 289 milliseconds, 290 $0-playback subpatch, 292 read_sample abstraction, 290 $0-repeatedly subpatch, 296 $0-repeat_list subpatch, 298 sampling rate, 290 $0-set_ramp_length subpatch, 299 circuit box, 311 female 1/8-inch jacks, 314 IDC connectors, 314 1/4-inch jack, 314 mono male jack, 314 1MW resistor, 314 piezo element, 269, 311 ■ Index „„         L Linux system, 48, 116 command-line prompt, 107 directory, 107–108 nano, 109 prompt, 107–108 remove, 110 text editing, 109 Looper Arduino code, 381 backward playback function, 408 enumeration, 381 first version, 389 foot-switch function (see Foot-switch function) forward playback function, 407 LEDs, 381 loop function, 409 recording function, 406 circuit, 392, 414 components, 363 definition, 364 features, 364, 393 market, 363 mechanism, 363 modular program, 393 overdubbing audio boundaries, 376 [limiter~], 376 start position, 377 stop, 378 Pd patch Arduino module, 399 assembled patch, 404 init subpatch, 405 overdub module, 396, 411 overdub position module, 397 [pd init], 403, 405 [pd make-window], 405 [pd tables], 403 phase module, 394, 409 playback module, 396 recording module, 393 table copying module, 400, 411 record sound, in Pd (see Recorded sound) sounds, 363 tap tempo, 364 Low pass filter, 40 www.electronicbo.com components, 267 kick drum sample backward, 281 kick.wav file, 282 LEDs, 285–286 main patch abstraction, 303 control_type subpatch, 306 make-window subpatch, 304 playback type canvases, 308 [read_samp] abstractions, 308 sound_tabs subpatch, 303 maximum value, in Arduino code, 271 debouncing sensor readings, 274 loop function, 276 multiple highest values, single hits, 274 sensor_above_thresh array, 276 sensor_max_val, 271 sensor_thresh array, 272 time stamps, 276 maximum value, in Pd calculation, 279 code, 277 fan out technique, 280 [route bang float], 279 message, 282 Pd patch, 270, 273 piezo elements, 268 receive input, 301 samples play back, 280 sampling rate, 282 sensors, 267 switches additional srrays, 287 all_switch_vals, 285, 288 foot switches, 282, 288 for Loop, 287 full test circuit, 283 loop function, 285 Pd patch, 286 Piezo activity, 283 sensor_activity array, 285, 289 string, 287 thresholds and debounce times, 302 „„         M millis() function, 276 Momentary switches, 341 Multiple filter types, 460 choose_filter_type, 461 get_inlet_outlet_switch, 462–463 module abstraction, 461 Musical applications, 141 combination Arduino code, 166–168 circuit of Arduino, 169 Pd patch, 170, 173–175 485 ■ index Musical applications (cont.) drum machine interface Arduino code, 162–165 arduino_stuff subpatch, 151 audio_out, 154 data receiving and patch, 162 metronome, 155 parent patch, 151 Pd patch, 150 set_sequence, 158–160, 162 sound_tabs, 152–153 phase modulation Arduino code, 146, 148–150 Pd patch, 143, 145 Sinusoidal waveform, 141–142 work process, 142 Musical Instrument Digital Interface (MIDI) Arduino code, 191–193 explanation, 194 loop function, 195 osc_type_buttons, 195 setup function, 195 synthesizer project, 194 technique, 195 communication, 178 control interfaces, 178 frequency and envelope issue, 182 [hold_sustain] abstraction, 183 messages and keyboard, 179 additional circuit, 213–215 code, 215–217 female MIDI connector, 213 velocity value, 218–219 OSC protocol, 178 parts list, 178 Pd patch amplitude envelope [notein], 181, 183 arduino_stuff subpatch, 197 control message, 186–188 create_envelope, 198–199 dollar-sign numbers, 203 filter~ subpatch, 210 frequency, 180 generic_data, 199–200 keyboard, 179 [notein] object, 180 parent patch, 188 [pd $0-voice_creation_loop] subpatch, 201 [pd $0-voices], 211–212 pitch bend messages, 188–189 polyphony, 183–184, 186 [poly_synth~] abstraction, 200 program change message, 190 synthesizer Pd patch, 196–197 486 [synth_voice~] abstraction, 203–204, 208–210 voice stealing, 186 voice~ subpatch, 185, 187 Pd patch (see Raspberry Pi) Pi advantages, 228 keyboard, 228 perforated boards, 228–229 synthesizer, 177 wires/circuit board enclosure spaces, 232 potentiometers, 229 power input and audio output, 232 power pins and supply, 230 USB cable pins, 230 „„         N Non-band limited oscillator, 451 abstraction, 451 choose_amp_input, 455 choose_ndx_input, 453–454 get_inlet_outlet_switch, 452 sawtooth subpatch, 457 sine subpatch, 456 square subpatch, 458 triangle subpatch, 457 waveforms, 456 „„         O Oscillators, definition, 13 digital values, 13 sawtooth, 15 square wave, 16–17 triangle wave, 14–15 waveforms, 13 OS X, 116 „„         P, Q Parent patch canvas_control subpatch, 257 finished patch, 256 Graph-On-Parent subpatches, 257 modulator oscillator, 255 process_canvas, 256 Patch-bay matrix synthesizer, 417 analog pins Arduino Uno, 420 binary masks, 424 breakout version, 419 explanation, 424 main loop function, 424–425 ■ Index keyboard, 228 perforated boards, 228–229 USB MIDI keyboard, 222 Pitch bend messages, 188 dynamic patching, 190 parent patch, 190 voice~ subpatch, 189–190 Pitch shift subpatch contents of, 248 output, 250 [poly_synth~] abstraction, 200 Post-increment technique, 87, 319 Potentiometers subpatch, 468 Proximity sensors analog pins, 349 circuit, 319, 329 code, 318 for loop, 328 infrared, 318 Pd patch, 320, 330 second row and sixth column, 327 [serial_write] abstraction, 319 six analog pins, 327 smoothing out abstraction, 326 code, 321 infrared sensor, 323–324 initial value, 325 total and readings array, 329 two-dimensional array with six rows, 326 ultrasound, 318 write function, 318 Pull-up vs Pull-down resistors, 64–65 Pulse-width modulation (PWM), 72 Pure Data (Pd) abstractions contents of, 22 error message, 24 preferences window, 23 Arduino abstraction, 83 advantages and disadvantages, 81 analogRead function, 87 ASCII characters, 82 assemble_analog subpatch, 89 delimiter character, 85 multiline comment, 86 newline character, 85 port numbers, 84 post-increment technique, 87 println and newline, 81 sending data, 91–93, 95 serial communication, 81–83 Serial.write(), 88 subpatch, 90 visualization, 90 www.electronicbo.com multiplexer, 421 Pd patch, 427 potentiometers, 426 preprocessor directive, 423 writing code, 422–423 Arduino code, 471–474 digital signal, 441 implementation, 441–443 main mechanism, 444 arduino_stuff subpatch contents of, 467 create_mtx_msg, 468 get_switches, 470 potentiometers, 467 audio Pd patch band-limited oscillator, 458, 460 matrix messages, 449–450 modules, 451 multiple type filter, 460, 462, 464–465 non-band limited oscillator, 451 binary numbers, 475 check_connections function, 475 circuit, 447–448, 476 digital pins (see Arduino digital pins) final patch, 466 inputs and outputs, 471 main loop function, 475 parts list, 417–418 Pd patch connections, 445, 447 explanation, 446 mechanism, 446 predefined connections, 418 shift registers, 476 [pd $0-voice_creation_loop] subpatch, 201 Phase modulation Arduino, receive files, 143 Pd handling values, 145 implementation, 143 index values, 145 modulator oscillator, 144 patch, 143 send data, 146 Sinusoidal waveform, 141–142 work process, 142 Pi advantage, 228 dialog message, 222 external sound card QJackctl interface, 225 script, 227 setup, 226 sound card choices, 226 487 ■ index Pure Data (Pd) (cont.) argument, audio input, 26–27 community, 49 connections, control object, control vs signal domains digital electronics, 24 Hslider, 26 oscillator, 24–25 value changes, 25 drum machine, 150, 173 arduino_stuff, 170 arduino_stuff subpatch, 151 audio_out, 154–155 data receiving and patch, 162 diffuse_beats, 158–160 metronome, 155, 157, 172 modulator, 175 parent patch, 151 patch, 170 set_sequence, 158 set_tab, 161–162 sound_tabs, 152–153 DSP and DAC, electronic music techniques additive synthesis, 27–28 amplitude modulation, 29 delay lines, 34–38 envelopes, 31–34 filters, 39, 41–42 frequency modulation, 30 reverb, 38 ring modulation, 28–29 elements, external libraries, 113 installation, 111 path window, 112 startup flags, 113 zexy and iemmatrix, 114 GUI (see Graphical user interface (GUI)) help patch, 10 launches Pd, 111 message, object, operating systems, oscillators, definition, 13 digital values, 13 sawtooth, 15 square wave, 16–17 triangle wave, 14–15 waveforms, 13 patches, 49 atom, bang, 8–9 488 comments, 10 console, 3–4 control connection, control domain, DSP indication, editable message, execution order, 7–8 fan out, functional patch, patch, selected message, phase machine arduino_stuff, 170 metronome, 172 modulator, 175 patch, 170 phase_modulation, 173–174 phase modulation, 143 handling values, 145 implementation, 143 index values, 145 modulator oscillator, 144 send data, 146 subpatches contents, 21 parent patch, 21 percentage, 20 writing comments, 21 sudo, installation, 110 tables array, 17 audio file, 20 tab, 18 triangle oscillator, 18–19 test audio and MIDI, 112 trigger, 49 visual programming, wireless connections audio and MIDI, 46–49 clipped audio signal, 46 connection cords, 43 messy patch, 42–43 signal domain, 44 „„         R Raspberry Pi Arduino sketch, 220 computer’s IP, 101 configuration, 106 crontab file, 220 embedded computer, 221 enable shutting down, 223–224 external monitor, 100 external sound card, 225 internet router ■ Index [tabplay~], 366 [tabread4~], 366 sample rate, 365 table, 364 [tabwrite~], 364–365 Reverb, 38 Ring modulation (RM), 28–29 „„         S Sawtooth oscillator, 15 Serial.write() function, 88, 90 Square wave oscillator, 16 Subpatches contents, 21 parent patch, 21 percentage, 20 writing comments, 21 [synth_voice~] abstraction, 203–204 amplitude envelope, 209 carrier subpatch, 208 gate subpatch, 209 modulator subpatch, 205, 208 [pd sawtooth], 207 [pd sinusoid], 206 [pd square], 207 [pd triangle], 206 www.electronicbo.com PuTTY, 123 save login sessions, 124 terminal connection, 123 Internet Protocol cd command, 119 interfaces file, 120 Linux, 120–121 OS X, 121–122 subgroup, 120 Windows XP, 122 OS X and Linux, 102 overview, 100 Pd patch, 227 Raspbian Jessie image, 220 Raspbian Wheezy image, 221 shut down, 124, 126 small caveat, 224 transfer files directories, 117 OS X and Linux, 116 secure copy protocol (scp), 116 Windows, 117–118 WinSCP connection, 119 Windows PuTTY window, 102–103, 105 registration window, 104 Secure Shell, 103 SSH selection, 103 Zenmap’s window, 101 Raspbian Jessie image, 220–221 Recorded sound arbitrary lengths dropouts, 372 elapsed time calculation, 375 large array, 373 [ms2samps] abstraction, 376 [phasor~], 376 resize $1, 372 scientific notation, 373 [tabwrite~], 372 [timer], 374 [timer samp], 375 [trigger], 374 drawback, 365 microphone, 365 play back [arraysize], 365 complete silence, 367 direction change, 370 [pd make-window] subpatch, 368 [phasor~], 366, 368 [samplerate~], 365 smoothing out, 368 smoothing window, 369 synchronizing end, 380 „„         T, U Table lookup oscillator, 337 Theremin analog and the digital pins, 349 Arduino Uno/Nano, 339 band-limited waveforms amplitude, 331 apply phase modulation, 337 array size, 331 [bl_triangle], 336 guard points, 331 sawtooth waveform, 333 sinesum, 331 sine wave, 331 square waveform, 334 [tabosc4~], 335–336 [tabread4~], 336 triangle waveform, 332 choose_carrier_waveform subpatch, 351 choose_modulator_waveform subpatch, 351 circuit, 343 code, 345 components, 317 digitalRead function, 348 489 ■ index Theremin (cont.) embedded computer Arduino Uno, 355 enclosure, final version, 355 extra push button, in Pd, 358 my_scripts, 360 Proto Shield, 355 Raspberry Pi, 354–355 Raspbian Jessie image, 360 switching off, push button, 356 final Pd patch, 349 full test circuit, 349 loop function, 348 pin number, 348 proximity sensors (see Proximity sensors) push buttons amplitude sensor control, 339 car_or_mod array, 342 digital pins, 339 global variables, 341 loop function, 342 old_ctl_switch variable, 342 old_switches array, 342 overall brightness control, 339 pitch sensor control, 339 potentiometer, 339 Serial.write function, 342 setup function, 341 switches and LEDs, 339, 342 “transfer_data array”, 343 Serial.read() function, 348 setup function, 348 waveform subpatch abstractions, 352 “analog” group, 354 arduino_stuff subpatch, 353 brightness, 354 digital values, 354 490 [pd arduino_stuff ] subpatch, 352 [pd waveforms] subpatch, 352 potentiometer, 354 Triangle wave oscillator, 14 „„         V Vertical slider (Vslider), 12 Visual programming language, Voltage controlled filter, 39 „„         W Wireless connections audio and MIDI keyboards, 49 Linux, 48 sound card, 46 window, 47 clipped audio signal, 46 connection cords, 43 messy patch, 42–43 signal domain, 44 „„         X, Y, Z XBee vs Bluetooth, 126–127 Linux and OS X, 132 Arduino shield, 131 CoolTerm’s connections options, 133 explorer USB, 132 indication, 133 Windows configuration, 135–138 enable local echo, 135 PuTTY serial session, 134 ... Digital Electronics for Musicians Alexandros Drymonitis Digital Electronics for Musicians Copyright © 2015 by Alexandros Drymonitis This work is subject to copyright All rights are reserved by. .. deals with signals (a digital form of an electric signal) A signal object will run its function for as long as the audio is on (the audio is also called the DSP, which stands for digital signal processing,... in Figure 1-1 (Note the shortcut for creating objects; it’s Ctrl+1 for Linux and Windows, and Cmd+1 for OS X We’ll be using the shortcut for creating objects for now on) Now go to Put ➤ Message

Ngày đăng: 16/12/2019, 15:43

Mục lục

  • Contents at a Glance

  • About the Technical Reviewer

  • Chapter 1: Introduction to Pure Data

    • Pd Basics: How It Works

    • Our First Patch

      • The Control Domain

      • GUIs

        • Pd Patches Behave Like Text Files

        • Making Oscillators in Pd

          • Making a Triangle Wave Oscillator

          • Making a Sawtooth Oscillator

          • Making a Square Wave Oscillator

          • Using Tables in Pd

          • Audio Input in Pd

          • Basic Electronic Music Techniques

            • Additive Synthesis

            • Delay Lines in Pd

            • Making Wireless Connections

              • Audio and MIDI Settings

                • MIDI Settings on Linux

                • A Bit More on MIDI

                • Chapter 2: Introduction to Arduino

                  • Arduino Jump Start

                  • Digital Input

                    • Defining Variables in Arduino

                    • Further Explanation of the Code

                    • Classes in Arduino and the Serial Communication

                    • Building Circuits on a Breadboard

                    • Both Digital Input and Output

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan