Download presentation
Presentation is loading. Please wait.
Published byClare Smith Modified over 9 years ago
1
Copyright 2004 Ken Greenebaum Introduction to Interactive Sound Synthesis Lecture 4: Interfaces Ken Greenebaum
2
Copyright 2004 Ken Greenebaum Assignment Clarifications: Clarifications:getopt() GNU and freegetopt versions GNU and freegetopt versions Will provide a library soon Will provide a library soon Optimization should not obfuscate Optimization should not obfuscate For now if you want to show off provide two copies (would be a shame to loose points) For now if you want to show off provide two copies (would be a shame to loose points) Error handling optional (this time!) Error handling optional (this time!)
3
Copyright 2004 Ken Greenebaum Assignment Standardize Pi 3.14159265 Standardize Pi 3.14159265 SIGFIGS? SIGFIGS? 2000 has how many SIGFIGS? 2000 has how many SIGFIGS?
4
Copyright 2004 Ken Greenebaum Significant Figures 1 sigfig 2x10^3 1 sigfig 2x10^3 Between 1x10^3 and 3x10^3 Between 1x10^3 and 3x10^3 1000-3000 1000-3000 2 sigfig 2.0x10^3 2 sigfig 2.0x10^3 Between 1.9x10^3 and 2.1x10^3 Between 1.9x10^3 and 2.1x10^3 1900-2100 1900-2100
5
Copyright 2004 Ken Greenebaum Significant Figures When multiplying or dividing When multiplying or dividing sigfigs = lowest sigfigs for any term sigfigs = lowest sigfigs for any term Ex: (12.34x12.1)/9.1 = 16 Ex: (12.34x12.1)/9.1 = 16 When subtracting When subtracting round to least number of decimal places ex: round to least number of decimal places ex: 1.03 + 1.03 + 0.00001 + 0.00001 + 57 57 = 58.03 = 58.03
6
Copyright 2004 Ken Greenebaum Significant Figures Extra Credit Question: Extra Credit Question: How will the value of Pi affect the output of our assignment? How will the value of Pi affect the output of our assignment?
7
Copyright 2004 Ken Greenebaum Assignment Clarifications: Clarifications: Output should be a stream of values Output should be a stream of values Emitted faster than realtime Emitted faster than realtime If played at the framerate would generate the desired sinewave If played at the framerate would generate the desired sinewave
8
Copyright 2004 Ken Greenebaum Assignment Motivation: Motivation: First synthesizer First synthesizer Gets us all programming Gets us all programming Leads us to synthesizing audio in real-time Leads us to synthesizing audio in real-time Next we will interface to PABLIO Next we will interface to PABLIO
9
Copyright 2004 Ken Greenebaum Assignment How many have started the assignment? How many have started the assignment? Completed the assignment? Completed the assignment? Questions? Questions? Understand sampling? Understand sampling? Understand quantization? Understand quantization?
10
Copyright 2004 Ken Greenebaum Simple Interfaces: Small (Hello) World Questions on the reading? Questions on the reading?
11
Copyright 2004 Ken Greenebaum Simple Interfaces: Small (Hello) World My philosophy of UI design My philosophy of UI design Smart defaults Smart defaults Make often used things easy Make often used things easy The 80% solution The 80% solution Make infrequently used things possible Make infrequently used things possible Limit redundancy Limit redundancy Should be clear which functions to use Should be clear which functions to use Can create helper libraries Can create helper libraries
12
Copyright 2004 Ken Greenebaum Simple Interfaces: Small (Hello) World My philosophy of UI design My philosophy of UI design Don’t design baroque interfaces Don’t design baroque interfaces Understand what it is you are providing an interface Understand what it is you are providing an interface “Hello World” should fit on one screen! “Hello World” should fit on one screen!
13
Copyright 2004 Ken Greenebaum Simple Interfaces: Small (Hello) World My philosophy of UI design My philosophy of UI design A good design radiates features from the core A good design radiates features from the core Adds interfaces at appropriate layers Adds interfaces at appropriate layers Doesn’t enforce uniformity at the top layer Doesn’t enforce uniformity at the top layer Spackling over cracks Spackling over cracks Example: Example: Implementing Symbolic links in the filesystem Implementing Symbolic links in the filesystem Or in the shell Or in the shell
14
Copyright 2004 Ken Greenebaum Simple Interfaces: Small (Hello) World Great examples: Great examples: UNIX/POSIX UNIX/POSIX A file is a file (a driver is a file) A file is a file (a driver is a file) All files have common interface All files have common interface open, read, write, seek, ioctl open, read, write, seek, ioctl Blocking I/O Blocking I/O STDIO (standard I/O) STDIO (standard I/O)
15
Copyright 2004 Ken Greenebaum PABLIO Portable Portable Audio Audio Blocking Blocking I/O I/O
16
Copyright 2004 Ken Greenebaum PABLIO Developed for AudioAnecdotes examples Developed for AudioAnecdotes examples Very easy to program Very easy to program Requires minimal boilerplate Requires minimal boilerplate Portable across Portable across Windows, MacOSX, Linux Windows, MacOSX, Linux
17
Copyright 2004 Ken Greenebaum PABLIO Manages flow control Manages flow control High and low water marks High and low water marks Auto blocking Auto blocking Performs quantization Performs quantization
18
Copyright 2004 Ken Greenebaum PABLIO Cons Cons Built on layers Built on layers Latencies additive Latencies additive Only as good as the worst layer Only as good as the worst layer Missing opportunities to interface to OS Missing opportunities to interface to OS
19
Copyright 2004 Ken Greenebaum PABLIO Example: #include “pablio.h” void main(void) { short sample[1000]; PABLIO_Stream *in, *out; OpenAudioSteam(&in, 8000, paInt8, PABLIO_READ); OpenAudioSteam(&out,8000, paInt8, PABLIO_WRITE); while(1){ ReadAudioStream( in, sample, 1000); ReadAudioStream( in, sample, 1000); WriteAudioStream(out, sample, 1000); WriteAudioStream(out, sample, 1000); }}
20
Copyright 2004 Ken Greenebaum PABLIO and Interface design We are going to use PABLIO for our next assignment We are going to use PABLIO for our next assignment Questions? Questions?
21
Copyright 2004 Ken Greenebaum Readings: Audio Anecdotes Volume2 Audio Anecdotes Volume2 Wrapped I/O Wrapped I/O Audio Anecdotes Audio Anecdotes Perceivable Auditory Latencies Perceivable Auditory Latencies (finish assignment and #6 before this reading) (finish assignment and #6 before this reading)
22
Copyright 2004 Ken Greenebaum Next class: More advanced I/O More advanced I/O Perception of Latency Perception of Latency Next assignment Next assignment
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.