mirror of
https://github.com/chocolate-doom/research.git
synced 2024-11-29 15:32:34 +00:00
27 lines
285 B
Text
27 lines
285 B
Text
|
#!/usr/bin/env ruby
|
||
|
|
||
|
require "scanf"
|
||
|
|
||
|
index = 0
|
||
|
|
||
|
$stdin.each_line do |s|
|
||
|
|
||
|
if s !~ /Key on.*octave (\d+), freq 0x([0-9a-f]+)/
|
||
|
next
|
||
|
end
|
||
|
|
||
|
octave = $1.to_i
|
||
|
freq = $2.scanf("%x")
|
||
|
|
||
|
if index > 0
|
||
|
puts "#{index},#{octave},#{freq}"
|
||
|
end
|
||
|
|
||
|
index += 1
|
||
|
|
||
|
if index >= 512
|
||
|
break
|
||
|
end
|
||
|
end
|
||
|
|