Skip to content

Instantly share code, notes, and snippets.

@mutagene
mutagene / disquietjunto-0097
Last active December 27, 2015 18:49
automate transcription of disquiet junto human readable form
#!/usr/bin/ruby
notes = ["A","A#","B","C","C#","D","D#","E","F","F#","G","G#"]
prev_note = "-"
ARGV.join('').each_byte do |c|
cur_note = nil
if c >= "a"[0] && c <= "z"[0]
cur_note = notes[ (c - "a"[0])%12 ]
elsif c >= "A"[0] && c <= "Z"[0]
cur_note = "*emphasis* " + notes[ (c - "A"[0])%12 ]
elsif c == ","[0] or c == ";"[0]