Skip to content

Instantly share code, notes, and snippets.

View domgetter's full-sized avatar

Dominic Muller domgetter

View GitHub Profile
| [E3GB]zz^F |
all this does is the following
EEE
G
B
zz
F
[EGB]B2 E2
E
G
B
BB
EE
^this is too many notes
[EGB2]z E2
|| [E3GB]zz^F | G3E | GG ^FE | [B^D^F2A]zB,2 |
| ^F3G | A3^F | AA G^F | [E4GB]zzzz |
| [EGB2]zz[ce2g]zz | [gbd2]zz[gbd^f]ed | [AC2E]zz BA | [E4GB2]zzzz |
| [A4C3E]zzzz | [EG4B3]zzzz | [B^D^F4A2]zz Gz | [E4GB]zzzz |
take the last measure as example
| [E4GB]zzzz |
12345
|| [E3GB]zz^F | G3E | GG ^FE | [B^D^F2A]zB,2 |
| ^F3G | A3^F | AA G^F | [E4GB]zzzz |
| [EGB2]zz[ce2g]zz | [gbd2]zz[gbd^f]ed | [AC2E]zz BA | [E4GB2]zzzz |
| [A4C3E]zzzz | [EG4B3]zzzz | [B^D^F4A2]zz Gz | [E4GB]zzzz |
-- becomes
|| [E3GB]zz^F | G3E | GG ^FE | [B^D^F2A]zB,2
| ^F3G | A3^F | AA G^F | [E4GB]zzzz
| [EGB2]zz[ce2g]zz | [gbd2]zz[gbd^f]ed | [AC2E]zz BA | [E4GB2]zzzz
@domgetter
domgetter / songbook.config
Created December 23, 2013 17:06
This is the correct songbook.config. If you replace your songbook.config (located in the assets directory) your songs will play without crashing. If your songs sound funny, take out the K: line in the .abc file for that song.
{
"keys" : {
"B LOCRIAN" : "C",
"BLOCRIAN" : "C",
"BLOC" : "C",
"F LYDIAN" : "C",
"FLYDIAN" : "C",
"FLYD" : "C",
"E PHRYGIAN" : "C",
"EPHRYGIAN" : "C",
//... lines 17 explains changes
if (String::isAsciiLetter(head)) {
int note = (String::toLower(head) != head) ? 60 : 72 ;
while (peek() == ',') {
buffer.takeFirst();
note -= 12;
}
while (peek() == '\'') {
buffer.takeFirst();
irb(main):001:0> "a".object_id
=> 22205184
irb(main):002:0> "a".object_id
=> 21699816
irb(main):003:0> :a.object_id
=> 357224
irb(main):004:0> :a.object_id
=> 357224
File.read("NO.txt", "r:utf-8") {|line| line.split("\t")[1]}.uniq.each do |place|
puts place
end
require 'gosu'
class Game < Gosu::Window
def initialize
super 640, 480, false
@song = Gosu::Song.new("file.ogg")
@loop_time = Gosu.milliseconds
end
# reads file backwards by byte
File.open("some_file.txt", "r") do |file|
file.size.downto(0) do |byte|
file.pos = byte
char = file.read(1)
puts char unless char =~ /\r/
end
end