-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabc.rb
More file actions
66 lines (42 loc) · 1.31 KB
/
abc.rb
File metadata and controls
66 lines (42 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class ABCTuneHeader
attr_accessor :a_area, :b_book, :c_composer, :d_discography,
:f_file_url, :g_group, :h_history, :i_instruction,
:l_unit_note_length, :m_meter, :mm_macro,:n_notes,
:o_origin, :r_rhythm, :rr_remark, :s_source,
:u_user_defined, :z_transcription, :k_key, :p_parts,
:q_tempo, :t_tune_title, :v_voice, :w_words,
:x_reference_number
end
class ABCFileHeader
attr_accessor :a_area, :b_book, :c_composer, :d_discography,
:f_file_url, :g_group, :h_history, :i_instruction,
:l_unit_note_length, :m_meter, :mm_macro,:n_notes,
:o_origin, :r_rhythm, :rr_remark, :s_source,
:u_user_defined, :z_transcription
end
class ABCTune
attr_accessor :parts, :abc, :file_header, :tune_header, :tune_body
end
class ABCTuneBook
ABC_VERSION = '%abc-2.1'
ABC_MIME_TYPE = 'text/vnd.abc'
attr_accessor :tunes
def initialize(abc = nil)
@abc = abc
if @abc then
parse
else
end
end
def parse
@abc.each do |line|
count = 0
while count < line.size do
puts line[count]
count += 1
end
end
end
private :parse
end
tb = ABCTuneBook.new(["X:1"])