Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var/sound/note_sound = sound('sound/violin/A4.ogg')
- var/const/A4Freq = 440
- var/const/A4Pos = 12 * 4 + 10
- var/list/mobs/heard_by = hearers(15, get_turf(src))
- var/note_num = semitones_num[tones.Find(uppertext(copytext(note,1,2)))] + cur_oct[cur_note] * 12
- if (cur_acc[cur_note] == "#")
- note_num++
- if (cur_acc[cur_note] == "b")
- note_num--
- var/note_freq = A4Freq * 2**(note_num-A4Pos)/12
- var/note_acc = note_freq / A4Freq
- note_sound.channel = chan
- note_sound.frequency = note_acc
- heard_by << note_sound
- spawn(song.tempo / text2num(notes[2]))
- heard_by << sound(null, channel=chan)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement