Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. # Define Music:
  2. # Vocal or instrumental sounds (or both) combined in such a way as to produce beauty of form, harmony, and expression of emotion.
  3.  
  4.  
  5. class Music
  6. has_many :sounds
  7. has_many :notes , through: :sounds
  8. sequences_of_emotions = []
  9.  
  10. def good user
  11. sequences_of_emotions.select { |e| e == user.definition_of(Music, :good) }
  12. end
  13. end
  14.  
  15. class Sound
  16. has_many :notes
  17. end
  18.  
  19.  
  20. class Note
  21. has_many :sequences
  22. end
  23.  
  24.  
  25. class Vocal < Sound
  26. end
  27.  
  28. class User
  29. DEFINITIONS = {
  30. music: {
  31. good: []
  32. }
  33. }
  34. def definition_of klass, type
  35. DEFINITIONS[klass.downcase][type]
  36. end
  37. end
  38.  
  39. # a user can say:
  40. #
  41. # Play some good music
  42. #
  43. # 1. play = action the computer has to execute
  44. # 2. some = the range
  45. # 3. good = a selection based on the user for the object(music)
  46. # 4. music = the subject
  47.  
  48.  
  49.  
  50. # the only hard to explain here is the "good" because the good based on the expectation we want.
  51. # what is good music? and what is good in general?
  52.  
  53. # good: to be desired or approved of.
  54.  
  55. # So we should define what is good for us based on the previus examples
  56. # How can u define good? what music is do so will do "good" to me?
  57.  
  58. # IF: i accept these type of sequences and i will hear them it is good for me
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement