1 / 12

Computer Music Lab

Computer Music Lab. Roger B. Dannenberg School of Computer Science Carnegie Mellon University CS4HS 27 July 2010. Let’s Start With Some Sounds. play osc(60) ; sine wave play osc(61) ; half-step higher play osc(61, 3) ; longer - 3 sec play pluck(48, 2) ; plucked string

Download Presentation

Computer Music Lab

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Music Lab Roger B. Dannenberg School of Computer Science Carnegie Mellon University CS4HS 27 July 2010

  2. Let’s Start With Some Sounds • play osc(60) ; sine wave • play osc(61) ; half-step higher • play osc(61, 3) ; longer - 3 sec • play pluck(48, 2) ; plucked string • load "pianosyn.lsp" ; load a library • play piano-note(2, 50, 100) ; parameters are: ; duration, pitch, loudness (1-127)

  3. Pitch in Nyquist (and MIDI) 62 61 63 66 59 68 70 60 62 64 65 67 69 71

  4. Music and Programs define function myscale()begin return seqrep(i, 12, pluck(60 + i))end play myscale() ~ 0.5

  5. Digression(?):Computer Music • 890 AD: Banu Musa on organ building • 995-1050: Guido de Arezzo, pitch names, strings, mnemonics, encoding • 1955: Hiller and Isaacson, Illiac Suite • Early 60s: Max Mathews made first musical sounds by computer at Bell Labs • 70’s: A few centers for computer music • 80’s: Digital synthesizers, MIDI, personal computers, compact disc • 90’s: Real time generation of audio on PCs • 00’s: Napster, iTunes, sampling, laptops, …

  6. Back to Nyquist: Your Turn • Start Nyquist • “Sal” button to get to Sal mode • “New File” button to open editing window • print "hello world" in window • “Save File” button: save to /Users/yourname/Desktop as tmp.sal • “Load” button to load/run changes

  7. Important Syntax Hint • In Nyquist/Sal, a + 3 is an expression, but a+3 is a variable name (!!!) • Use spaces around operators. • You do not need spaces before or after parentheses: pluck(60) is ok • Examples: • pluck(60+3) bad • pluck(60 + 3) good

  8. Try these functions define function chord() begin return sim(pluck(60), pluck(64), pluck(67)) end define function melody() begin return seq(pluck(60), pluck(64), pluck(67)) end play chord() play melody()

  9. Be Creative • Hints: • Use random(n) for a random number from 0 to n-1 • Use seqrep(i, n, expr) for n repetitions of expr, with i = 0, 1, …, n-1 • Instead of pluck(n), you can call your own function

  10. Challenges • Make a random melody • Make a chord with a “root” parameter, e.g. chord(67) plays pitches 67, 71, 74 • … and make a random chord sequence • Play a chord and a melody • Hint: sim and seq can be nested

  11. More Fun Stuff • Try “Browse” button • existing sounds • read the code • Nyquist can be used to write plug-ins for the Audacity editor • Nyquist is a full programming language

More Related