Presentation is loading. Please wait.

Presentation is loading. Please wait.

Questions?.

Similar presentations


Presentation on theme: "Questions?."— Presentation transcript:

1 Questions?

2 From ( ) get: 1) 0 2) 64 3) 1000 4) ( ) 5) ( ) 6) ( ) 7) (0 1) 8) ((0)) 9) ( ) 10) (60 0)

3 From (((a) b) c) get: 1) a 2) c 3) b 4) (a b) 5) (a (b c)))

4 From (a b c d e) get: 1) (d e) 2) 5 3) (a (b (c (d (e))))) 4) (e d c b a) 5) (a b c d)

5 From a get: 1) (a) 2) (a . a) 3) (a (a)) 4) ((a) a) 5) (a ())

6 From a and (b c) get: 1) (a b c) 2) ((a) b c) 3) (a (b c)) 4) (a c) 5) (c b a)

7 From (a b) and (c d) get: 1) (a b c d) 2) ((a b) c d) 3) ((a b)(c d)) 4) (b a d c) 5) (a (b c) d)

8 (append '((1)) '(2 3))

9 ((1) 2 3)

10 (append '((2)(3)) '(4 5))

11 ((2) (3) 4 5)

12 (first '(((a)) (b c d e)))

13 ((A))

14 (rest '(((((f))))))

15 nil

16 (first '(rest (a b c)))

17 rest

18 (first (second '(((1 2))(2 3 4)((5 6 7)))))

19 2

20 (second (first '(((1 2))(2 3 4)((5 6 7)))))

21 nil

22 Define a function AVERAGE that returns the average of 5 numbers:
(average ) returns 3.

23 (defun average (n1 n2 n3 n4 n5)
(coerce (/ (+ n1 n2 n3 n4 n5) 5) 'float)) ; ? (average ) ; 3.0 ; ? (average ) ; 3.2

24 Sonification Sound from data not intended to create sound.
Both scientific and artistic value.

25 Pleiades Large scale radio telescope
Ability to view data in standard ways Ability to usefully hear data in order to find patterns otherwise not perceivable Musically interesting sonifications SETI (Search for Extraterrestrial Life)

26 Pleiades Data from the planet Jupiter Data selected by Cope
Data sonified by Peter Elsea (mid-80s) Saturday night Pleiades by Cope Sonification of planet Mars (2002 or so)

27 Sonification Where do you begin? Where do you go from there?
What do you want to have as output?

28 Divide and Conquer Find interesting data Ensure it’s diverse enough
Lispify it (listify) Normalize the data to MIDI range Produce cope-events. Save as MIDI file and play.

29 Sonification What criteria to use in finding data?

30 Data Astronomical Stocks Temperatures Seismological Measurements
Bit maps

31 DATA How do you get the data into musical shape?
The process is known as normalization How do you achieve normalization?

32 Normalization Compare range of one list to another (/)
Multiply by known element of first list (minus it’s lowest range level) Add in lower MIDI range Round it to avoid floats New MIDI note

33 Recursion The ability of a function to do the same thing to an arbitrary length list of data The ability of a function to call itself The ability of a function to automatically stop at the end of its argument The ability of a function to return the changed data in appropriate order

34 Add-One Data: ‘(1 2 3 4 5 6 7) Process: add one to each number
(cons (+ 1 7) ()) (cons (+ 1 6) (cons (+ 1 7) ()) (cons (+ 1 5) (cons (+ 1 6) (cons (+ 1 7) ()) And so on?

35 In other words (cons n3 (cons n2 (cons n1 (cons n0 ())))

36 Recursion (defun add-one (list-of-numbers)

37 Ending You must have code to end the function first in order to make sure the function ends with an empty list as second argument to the final call to cons.

38 Continuation (defun add-one (list-of-numbers)
(if (null list-of-numbers) ()

39 Continuation (defun add-one (list-of-numbers)
(if (null list-of-numbers) () (cons (+ 1 (first list-of-numbers))

40 Continuation (defun add-one (list-of-numbers)
(if (null list-of-numbers) () (cons (+ 1 (first list-of-numbers)) (add-one (rest list-of-numbers))))

41 It works ? (add-one ‘( )) ( )


Download ppt "Questions?."

Similar presentations


Ads by Google