music_performances.qsrc 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # music_performances
  2. !! Constants used
  3. !! Song type:
  4. SONG = 1
  5. INSTRUMENTAL = 2
  6. VOCAL = 3
  7. !! Genres:
  8. POP = 0
  9. BLUES = 1
  10. ROCK = 2
  11. CLASSICAL = 3
  12. GRUNGE = 4
  13. COUNTRY = 5
  14. FOLK = 6
  15. DISCO = 7
  16. FUNK = 8
  17. !! Set lists
  18. if $ARGS[0] = 'add_new_set':
  19. i = ml_setlist["index"]
  20. $ml_setlist["<<i>>-code"] = "SL-<<i>>"
  21. $ml_setlist["<<i>>-name"] = $ARGS[1]
  22. ml_setlist["<<i>>-length"] = ARGS[2]
  23. ml_setlist["<<i>>-quality"] = 0
  24. ml_setlist["<<i>>-practice_level"] = 0
  25. ml_setlist["<<i>>-last_practice_day"] = 0
  26. ml_setlist["index"] += 1
  27. end
  28. !! Songwriting and composition
  29. !! ml_song_written["1-writing_skill"] = 0
  30. !! Lyrics: int; skill used: songwrit (new skill, Russian class improves it, plus practice and study)
  31. !! Music: int; skill used: instrmusic (covers melody and harmony)
  32. if $ARGS[0] = 'add_new_song':
  33. i = ml_song_written_written["index"]
  34. $ml_song_written['<<i>>-code'] = "S-<<i>>"
  35. $ml_song_written['<i>>-title'] = $ARGS[1]
  36. ml_song_written["<<i>>-type"] = ARGS[2]
  37. ml_song_written["<<i>>-genre"] = ROCK
  38. ml_song_written["<<i>>-lyrics"] = 0
  39. ml_song_written["<<i>>-music"] = 0
  40. ml_song_written["<<i>>-lyrics_work_count"] = 0
  41. ml_song_written_written["index"] += i
  42. end
  43. if $ARGS[0] = 'write_lyrics':
  44. !! base: pcs_songwrit
  45. !! mod: thirst, hunger, sleep, pain, drunk, drugs, exhaustion
  46. ml_song_written["1-lyrics"] += ( (pcs_songwrit - modifiers) * ml_genre_knowledge[ml_song_written["1-genre"]] * rand(0,130) )/100/ml_song_written["1-lyrics_work_count"]
  47. max_lyrics = (pcs_songwrit * ml_genre_knowledge[ml_song_written["1-genre"]] * 130)/100
  48. if ml_song_written["1-lyrics"] > max_lyrics: ml_song_written["1-lyrics"] = max_lyrics
  49. !! should there be a diminishing return? A limit, based on skill? Max: pcs_songwrit * 1.3 * ml_genred_knowledge?
  50. ml_song_written["1-lyrics_work_count"] += 1
  51. end
  52. if $ARGS[0] = 'write_music':
  53. !! base: pcs_songwrit
  54. !! mod: thirst, hunger, sleep, pain, drunk, drugs, exhaustion
  55. if ml_song_written["1-type"] = VOCAL:
  56. skill = (pcs_vokal + pcs_songwrit) / 2
  57. else:
  58. skill = (pcs_instrmusic + pcs_songwrit) / 2
  59. end
  60. ml_song_written["1-music"] += ( (skill - modifiers) * ml_genre_knowledge[ml_song_written["1-genre"]] * rand(0,130) )/100/ml_song_written["1-music_work_count"]
  61. max_music = (skill * ml_genre_knowledge[ml_song_written["1-genre"]] * 130)/100
  62. if ml_song_written["1-music"] > max_music: ml_song_written["1-lyrics"] = max_music
  63. ml_song_written["1-music_work_count"] += 1
  64. end
  65. if $ARGS[0] = 'rewrite_lyrics':
  66. ml_song_written["1-lyrics_work_count"] = 0
  67. ml_song_written["1-lyrics"] = 0
  68. gs 'music_performances', 'write_lyrics'
  69. end
  70. if $ARGS[0] = 'rewrite_music':
  71. ml_song_written["1-music_work_count"] = 0
  72. ml_song_written["1-music"] = 0
  73. gs 'music_performances', 'write_music'
  74. end
  75. --- music_performances ---------------------------------