Advertisement
EditorRUS

Piano

Mar 11th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. var/sound/note_sound = sound('sound/violin/A4.ogg')
  2. var/const/A4Freq = 440
  3. var/const/A4Pos = 12 * 4 + 10
  4. var/list/mobs/heard_by = hearers(15, get_turf(src))
  5. var/note_num = semitones_num[tones.Find(uppertext(copytext(note,1,2)))] + cur_oct[cur_note] * 12
  6. if (cur_acc[cur_note] == "#")
  7. note_num++
  8. if (cur_acc[cur_note] == "b")
  9. note_num--
  10. var/note_freq = A4Freq * 2**(note_num-A4Pos)/12
  11. var/note_acc = note_freq / A4Freq
  12. note_sound.channel = chan
  13. note_sound.frequency = note_acc
  14. heard_by << note_sound
  15. spawn(song.tempo / text2num(notes[2]))
  16. heard_by << sound(null, channel=chan)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement