Preface |
|
xxi | |
Acknowledgments |
|
xxvii | |
About the Companion Website |
|
xxix | |
|
|
1 | (12) |
|
|
1 | (1) |
|
|
2 | (1) |
|
What You Can Do with Arduino |
|
|
2 | (1) |
|
What You Can't Do with Arduino |
|
|
3 | (1) |
|
|
3 | (4) |
|
|
3 | (3) |
|
Programming and the Arduino IDE |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
8 | (2) |
|
Things You Will Need to Get Started |
|
|
10 | (2) |
|
|
10 | (1) |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
2 Introduction to Programming |
|
|
13 | (42) |
|
What Is a Programming Language? |
|
|
14 | (1) |
|
|
14 | (1) |
|
|
15 | (1) |
|
Writing Your First Sketch |
|
|
16 | (3) |
|
|
17 | (1) |
|
|
18 | (1) |
|
"Hello, world!" in Detail |
|
|
19 | (3) |
|
|
19 | (1) |
|
|
20 | (2) |
|
|
22 | (1) |
|
|
22 | (1) |
|
Variables, Data Types, and Operators |
|
|
22 | (1) |
|
|
23 | (4) |
|
|
23 | (1) |
|
|
24 | (1) |
|
|
24 | (1) |
|
Signed and Unsigned Data Types |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
27 | (1) |
|
Comparison Operators and Control Structures |
|
|
28 | (2) |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
32 | (3) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
35 | (2) |
|
|
37 | (1) |
|
|
37 | (5) |
|
|
38 | (1) |
|
|
38 | (4) |
|
A First Sketch Involving Hardware |
|
|
42 | (2) |
|
|
44 | (4) |
|
|
44 | (1) |
|
|
45 | (3) |
|
The Ugly Truth: Working with Text in C |
|
|
48 | (2) |
|
|
48 | (1) |
|
|
48 | (1) |
|
An Easier Way: Using the String Class |
|
|
49 | (1) |
|
|
49 | (1) |
|
A Complete Demonstration Program |
|
|
50 | (4) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
52 | (1) |
|
|
53 | (1) |
|
|
54 | (1) |
|
3 Introduction to Electronics |
|
|
55 | (27) |
|
|
55 | (1) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
58 | (2) |
|
|
58 | (1) |
|
|
59 | (1) |
|
|
59 | (1) |
|
|
59 | (1) |
|
|
60 | (1) |
|
A First Breadboard Project |
|
|
60 | (1) |
|
|
61 | (2) |
|
Conceptualizing Voltage, Current, and Resistance |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (2) |
|
Practical Example of Ohm's Law |
|
|
64 | (1) |
|
Using a Digital Multimeter |
|
|
65 | (6) |
|
|
65 | (1) |
|
|
66 | (1) |
|
|
67 | (1) |
|
A Word About Resistor Color Codes |
|
|
68 | (2) |
|
Safety Diode and Potentiometer |
|
|
70 | (1) |
|
Emergency Music Stand Light |
|
|
71 | (2) |
|
|
72 | (1) |
|
Incorporating a Photoresistor and Transistor |
|
|
73 | (1) |
|
|
73 | (6) |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (1) |
|
Connecting an Audio Signal to the Amplifier |
|
|
77 | (1) |
|
|
77 | (2) |
|
|
79 | (1) |
|
|
79 | (1) |
|
|
80 | (1) |
|
Mocking Up the Simple Theremin |
|
|
80 | (1) |
|
|
80 | (2) |
|
4 Interfacing with Arduino |
|
|
82 | (15) |
|
|
83 | (1) |
|
|
84 | (1) |
|
Overview of the Metronome Project |
|
|
84 | (12) |
|
|
84 | (1) |
|
Metronome with Potentiometer |
|
|
85 | (3) |
|
Metronome with Pushbutton Switch |
|
|
88 | (4) |
|
|
92 | (2) |
|
Metronome with Quadrature Rotary Encoder |
|
|
94 | (2) |
|
|
96 | (1) |
|
5 Music Instrument Digital Interface I/O |
|
|
97 | (31) |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
98 | (1) |
|
|
98 | (1) |
|
|
99 | (1) |
|
|
99 | (1) |
|
|
99 | (1) |
|
|
100 | (1) |
|
Channel Messages and System Messages |
|
|
100 | (9) |
|
|
100 | (7) |
|
Other Control Changes and Mode Changes |
|
|
107 | (1) |
|
|
108 | (1) |
|
|
109 | (5) |
|
|
109 | (1) |
|
System Real-Time Messages |
|
|
109 | (1) |
|
System Exclusive Messages |
|
|
110 | (1) |
|
Universal System Exclusive Messages |
|
|
111 | (3) |
|
|
114 | (10) |
|
|
114 | (6) |
|
|
120 | (1) |
|
|
120 | (1) |
|
Creating Permanent MIDI Circuits |
|
|
120 | (4) |
|
|
124 | (3) |
|
|
125 | (2) |
|
|
127 | (1) |
|
6 Real-Time Input: Musical Expression |
|
|
128 | (15) |
|
|
129 | (3) |
|
|
129 | (1) |
|
|
130 | (2) |
|
|
132 | (3) |
|
|
132 | (1) |
|
Reading the X and Y Positions |
|
|
133 | (2) |
|
|
135 | (2) |
|
|
135 | (1) |
|
Wiring the Pressure Sensor |
|
|
135 | (1) |
|
Reading Values from the Pressure Sensor |
|
|
135 | (2) |
|
|
137 | (2) |
|
|
137 | (1) |
|
Reading Values from a Joystick |
|
|
137 | (2) |
|
|
139 | (1) |
|
|
139 | (2) |
|
|
140 | (1) |
|
|
141 | (2) |
|
|
143 | (30) |
|
|
143 | (1) |
|
Music Instrument Shield (SparkFun Electronics) |
|
|
143 | (6) |
|
|
144 | (3) |
|
|
147 | (2) |
|
|
149 | (6) |
|
|
149 | (1) |
|
|
150 | (1) |
|
Preparing Audio Files for Use with the Wave Shield |
|
|
150 | (1) |
|
|
151 | (1) |
|
WaveHC Member Functions and Data Members |
|
|
152 | (1) |
|
|
153 | (2) |
|
|
155 | (7) |
|
|
156 | (2) |
|
|
158 | (1) |
|
|
159 | (3) |
|
|
162 | (8) |
|
|
163 | (1) |
|
|
164 | (1) |
|
Additive Gameduino Synthesizer |
|
|
164 | (1) |
|
Using a Structure and an Array |
|
|
164 | (2) |
|
|
166 | (4) |
|
|
170 | (1) |
|
|
170 | (1) |
|
|
171 | (2) |
|
8 Introduction to C++ Programming |
|
|
173 | (24) |
|
Overview: Moving Away from a Procedural Approach |
|
|
173 | (1) |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
174 | (10) |
|
|
175 | (1) |
|
|
176 | (1) |
|
Public and Private Keywords |
|
|
177 | (1) |
|
Constructors and Destructors |
|
|
177 | (1) |
|
|
178 | (1) |
|
|
179 | (1) |
|
|
180 | (3) |
|
|
183 | (1) |
|
More on Overriding Methods |
|
|
183 | (1) |
|
|
184 | (1) |
|
Developing a Rotary Encoder Class |
|
|
184 | (3) |
|
|
186 | (1) |
|
|
187 | (1) |
|
|
187 | (1) |
|
Developing a 12-Tone Matrix Class |
|
|
188 | (8) |
|
|
188 | (2) |
|
|
190 | (1) |
|
|
191 | (1) |
|
|
192 | (2) |
|
Using ToneRow in a Sketch |
|
|
194 | (2) |
|
|
196 | (1) |
|
9 Audio Output and Sound Synthesis |
|
|
197 | (47) |
|
|
197 | (1) |
|
Sample Rate and Resolution |
|
|
198 | (1) |
|
|
199 | (1) |
|
Conceptualizing a Digital Audio Converter |
|
|
199 | (1) |
|
|
200 | (10) |
|
|
200 | (9) |
|
|
209 | (1) |
|
|
209 | (1) |
|
|
210 | (4) |
|
|
211 | (1) |
|
|
212 | (1) |
|
Synthesizing a Ramp Waveform |
|
|
213 | (1) |
|
|
214 | (2) |
|
|
215 | (1) |
|
|
216 | (1) |
|
|
216 | (3) |
|
|
217 | (2) |
|
Developing an Oscillator Class |
|
|
219 | (12) |
|
|
219 | (1) |
|
|
220 | (4) |
|
Using Inheritance to Create a Ramp Oscillator |
|
|
224 | (1) |
|
|
225 | (1) |
|
|
225 | (2) |
|
|
227 | (1) |
|
|
228 | (1) |
|
|
229 | (2) |
|
|
231 | (3) |
|
|
233 | (1) |
|
|
234 | (2) |
|
|
234 | (1) |
|
|
235 | (1) |
|
|
236 | (5) |
|
|
239 | (1) |
|
Summing Signals and Adjusting Levels |
|
|
240 | (1) |
|
|
241 | (1) |
|
Audio Output with Teensy 3 |
|
|
241 | (3) |
|
|
243 | (1) |
|
|
244 | (31) |
|
|
244 | (1) |
|
Analog-to-Digital Conversion |
|
|
244 | (9) |
|
Preparing a Signal for Input |
|
|
245 | (3) |
|
Setting Up a Timer for Analog-to-Digital Conversion |
|
|
248 | (3) |
|
Building a Simple Arduino Preamp |
|
|
251 | (1) |
|
Building an Electret Microphone |
|
|
252 | (1) |
|
|
253 | (4) |
|
Interfacing with Processing |
|
|
254 | (3) |
|
|
257 | (1) |
|
|
257 | (5) |
|
|
259 | (1) |
|
|
259 | (2) |
|
Other Uses for FFT and FHT |
|
|
261 | (1) |
|
A Brief Introduction to Signal Processing |
|
|
262 | (7) |
|
A Few Words About Buffers |
|
|
262 | (1) |
|
|
263 | (1) |
|
|
264 | (3) |
|
|
267 | (2) |
|
High-End Audio Using the Open Music Labs Codec Shield for Real-Time Processing |
|
|
269 | (3) |
|
Using Mozzi for Audio Input and Processing |
|
|
272 | (2) |
|
|
272 | (1) |
|
|
272 | (1) |
|
Setting Up a Low-Pass Filter |
|
|
272 | (1) |
|
updateControl() Mechanism |
|
|
273 | (1) |
|
|
273 | (1) |
|
Scaling Amplitude in updateAudio() |
|
|
273 | (1) |
|
|
274 | (1) |
|
|
275 | (17) |
|
Creating a Permanent Project |
|
|
275 | (1) |
|
|
275 | (1) |
|
|
276 | (1) |
|
Protecting Sensitive Electronic Components |
|
|
276 | (1) |
|
|
276 | (1) |
|
|
276 | (1) |
|
|
277 | (1) |
|
Visualizing a Final Project |
|
|
277 | (2) |
|
|
277 | (1) |
|
|
277 | (1) |
|
|
278 | (1) |
|
|
278 | (1) |
|
|
278 | (1) |
|
Print Drilling/Cutting Guides |
|
|
278 | (1) |
|
|
279 | (1) |
|
Moving from a Solderless Breadboard to a Solder Breadboard |
|
|
279 | (4) |
|
Staying Neat: Layout and Wires |
|
|
279 | (1) |
|
|
280 | (1) |
|
|
280 | (1) |
|
Solder Breadboard Options |
|
|
280 | (2) |
|
Homemade Printed Circuit Boards |
|
|
282 | (1) |
|
Ordering Online Printed Circuit Boards |
|
|
282 | (1) |
|
|
283 | (2) |
|
|
284 | (1) |
|
|
284 | (1) |
|
|
284 | (1) |
|
|
285 | (1) |
|
|
285 | (1) |
|
|
285 | (1) |
|
|
285 | (2) |
|
|
286 | (1) |
|
|
286 | (1) |
|
|
287 | (2) |
|
|
287 | (2) |
|
|
289 | (1) |
|
|
289 | (3) |
|
|
290 | (2) |
|
|
292 | (14) |
|
|
292 | (1) |
|
|
292 | (4) |
|
|
293 | (1) |
|
|
294 | (2) |
|
Burning a Bootloader to a Blank ATmega328 |
|
|
296 | (4) |
|
|
297 | (2) |
|
Other Programming Options |
|
|
299 | (1) |
|
|
300 | (6) |
|
Rotary Encoder with Switch |
|
|
300 | (1) |
|
|
301 | (1) |
|
|
301 | (2) |
|
|
303 | (1) |
|
|
303 | (3) |
|
13 MIDI Hand Drum Project |
|
|
306 | (23) |
|
|
306 | (1) |
|
|
307 | (1) |
|
|
308 | (2) |
|
|
308 | (1) |
|
|
309 | (1) |
|
Developing the Mongo Firmware |
|
|
310 | (14) |
|
Software Setup, Global Constants, and Variables |
|
|
311 | (2) |
|
|
313 | (2) |
|
|
315 | (6) |
|
|
321 | (1) |
|
|
322 | (2) |
|
|
324 | (5) |
|
|
324 | (1) |
|
|
325 | (1) |
|
|
325 | (1) |
|
|
326 | (1) |
|
Adding Corner Posts and Circuit Base |
|
|
326 | (1) |
|
Installing Components on the Face Plate |
|
|
326 | (1) |
|
|
327 | (1) |
|
|
328 | (1) |
|
14 Stella Synthesizer Project |
|
|
329 | (19) |
|
Stella Digital/Analog Synthesizer |
|
|
329 | (5) |
|
|
330 | (2) |
|
|
332 | (1) |
|
Software: Encoders and Buttons |
|
|
333 | (1) |
|
|
334 | (1) |
|
|
335 | (2) |
|
|
337 | (9) |
|
|
338 | (5) |
|
SetFrequencyFromMidiNote() |
|
|
343 | (2) |
|
|
345 | (1) |
|
|
346 | (1) |
|
|
347 | (1) |
|
|
347 | (1) |
|
15 Step Sequencer Project |
|
|
348 | (22) |
|
|
348 | (1) |
|
|
349 | (18) |
|
|
350 | (3) |
|
|
353 | (4) |
|
|
357 | (8) |
|
Using the Shift Out IC: turnOnLED() |
|
|
365 | (1) |
|
|
366 | (1) |
|
Building the Step Sequencer |
|
|
367 | (2) |
|
|
367 | (1) |
|
|
368 | (1) |
|
|
368 | (1) |
|
|
368 | (1) |
|
|
369 | (1) |
|
|
370 | (9) |
|
|
370 | (1) |
|
|
371 | (1) |
|
|
372 | (6) |
|
|
372 | (1) |
|
MIDI Breath Controller Class |
|
|
372 | (2) |
|
|
374 | (1) |
|
Mapping Modulation Values (Y-Axis) |
|
|
374 | (2) |
|
Mapping Pitch Bend (X-Axis) |
|
|
376 | (1) |
|
|
377 | (1) |
|
|
378 | (1) |
Conclusion |
|
379 | (2) |
Appendix A MIDI Control Changes |
|
381 | (7) |
Appendix B MMC Commands |
|
388 | (2) |
Appendix C Introduction to Bit Twiddling |
|
390 | (9) |
Notes |
|
399 | (6) |
Bibliography |
|
405 | (6) |
Index |
|
411 | |