From the course: Code Clinic: Swift
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Intro: Accessing peripherals - Swift Tutorial
From the course: Code Clinic: Swift
Intro: Accessing peripherals
(whirring) - [Instructor] Hello and welcome to the fourth problem of the Code Clinic series. This is a challenge to build a musical instrument controlled by the computer mouse. The concept is easy but execution is difficult because many computer languages insulate the language from the hardware of the computer. This has the advantage of allowing one program to run on multiple computers without modification but it has the disadvantage of making it difficult to access hardware that isn't available through the operating system. This challenge will illustrate this difference between different languages. Some will have absolutely no problem and some will find it impossible. Here is the challenge. Create a computer program that converts mouse movements into musical pitches. The instrument should be silent until one of the mouse buttons is held down. Move the mouse up and down to change the pitch. Move the mouse side to side to change the volume. Let go of the mouse button and the musical…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.