Learn how the code runs in text mode and uses mouse input. Based on the click location, the sound generated is loud or soft, or high or low. The sound doesn't play continuously. The limitations of the C language, and the desire to create code that runs on a variety of platforms, limits the solution to this problem.
- [Dan] The C language is old.…It's about input, and output,…and fairly basic, even low-level programming concepts.…Libraries can extend the C language's capabilities,…but for some tasks, it just falls short.…To put it another way, if I were given an assignment…to create a theremin-like program,…I'd probably write it in Java, not C.…I wasn't provided that latitude for this assignment.…Many operating systems have routines or interfaces…for accessing the mouse and speaker.…Back in the 1980's, I programmed DAWs in C…and easily used the mouse!…I could also access the speaker hardware directly.…
In the spirit of this course, however,…I felt it was best to attempt a universal solution.…One that would run in a variety of environments.…My solution is theremin.…A program that uses the PortAudio library to render sound,…and the Ncurses library to read the mouse,…and access the screen for interactive, full-display output.…The resulting program can run in a Cygwin window on a PC,…or in iTerm on a Mac.…I've not been able to use the Terminal program…
Skill Level Intermediate
1. Summarize the Weather
2. Geolocation with C
3. Eight Queens with C
4. Build a Musical Instrument with C
5. Face Recognition with C
6. Web Dashboards with C
Next steps1m 2s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.