smf 0.15.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/MANUAL +172 -0
  2. data/MANUAL.en +135 -0
  3. data/MANUAL.en.html +150 -0
  4. data/MANUAL.en.rd +144 -0
  5. data/MANUAL.html +201 -0
  6. data/MANUAL.rd +179 -0
  7. data/README +33 -0
  8. data/README.en +33 -0
  9. data/lib/smf.rb +736 -0
  10. data/lib/smf/divert.rb +21 -0
  11. data/lib/smf/io.rb +1278 -0
  12. data/lib/smf/toy/beatmap.rb +73 -0
  13. data/lib/smf/toy/gm.rb +327 -0
  14. data/lib/smf/toy/groove.rb +34 -0
  15. data/lib/smf/toy/macro.rb +282 -0
  16. data/lib/smf/toy/macro/mml.rb +34 -0
  17. data/lib/smf/toy/macro/mml/parser.rb +545 -0
  18. data/lib/smf/toy/macro/mml/parser.ry +239 -0
  19. data/lib/smf/toy/macro/stt.rb +33 -0
  20. data/lib/smf/toy/morse.rb +126 -0
  21. data/lib/smf/toy/quantize.rb +32 -0
  22. data/lib/smf/toy/rmi.rb +29 -0
  23. data/lib/smf/toy/searchsegment.rb +24 -0
  24. data/lib/smf/toy/shuffle.rb +39 -0
  25. data/lib/smf/toy/tempomap.rb +75 -0
  26. data/lib/smf/toy/text.rb +369 -0
  27. data/lib/smf/toy/velcomp.rb +42 -0
  28. data/lib/smf/toy/virtual.rb +118 -0
  29. data/lib/smf/toy/xml.rb +377 -0
  30. data/sample/Makefile +58 -0
  31. data/sample/bwv772.mid +0 -0
  32. data/sample/bwv772.mml +94 -0
  33. data/sample/bwv775.mid +0 -0
  34. data/sample/bwv775.mml +157 -0
  35. data/sample/bwv787.mid +0 -0
  36. data/sample/bwv787.mml +129 -0
  37. data/sample/groove.grv +33 -0
  38. data/sample/groove.rb +45 -0
  39. data/sample/ltvddpd2.mid +0 -0
  40. data/sample/ltvddpd2.stt +60 -0
  41. data/sample/merge.rb +38 -0
  42. data/sample/mml-samp.rb +19 -0
  43. data/sample/mml.rb +36 -0
  44. data/sample/morse-samp.rb +11 -0
  45. data/sample/morse.rb +31 -0
  46. data/sample/play-oss.rb +215 -0
  47. data/sample/play-oss2.rb +253 -0
  48. data/sample/play-oss3.rb +150 -0
  49. data/sample/play-spkr.rb +97 -0
  50. data/sample/play-win.rb +195 -0
  51. data/sample/quantize.rb +41 -0
  52. data/sample/rand1.rb +21 -0
  53. data/sample/rand2.rb +24 -0
  54. data/sample/rmi2smf.rb +26 -0
  55. data/sample/shuffle.rb +43 -0
  56. data/sample/smf2rmi.rb +26 -0
  57. data/sample/smf2smf.rb +26 -0
  58. data/sample/smf2text.rb +27 -0
  59. data/sample/smf2wav.rb +123 -0
  60. data/sample/smf2xml.rb +27 -0
  61. data/sample/split.rb +40 -0
  62. data/sample/stt-samp.rb +19 -0
  63. data/sample/stt.rb +36 -0
  64. data/sample/text2smf.rb +28 -0
  65. data/sample/velcomp.rb +45 -0
  66. data/sample/virtual-samp.rb +19 -0
  67. data/sample/xml2smf.rb +28 -0
  68. metadata +128 -0
data/MANUAL ADDED
@@ -0,0 +1,172 @@
1
+
2
+ ���饹
3
+
4
+ * Sequence <format, division, tc=nil>
5
+ * Track
6
+ * Event <offset>
7
+ + MIDIMessage
8
+ o ChannelMessage <..., ch>
9
+ # VoiceMessage
10
+ @ NoteOff <..., note, vel>
11
+ @ NoteOn <..., note, vel>
12
+ @ PolyphonicKeyPressure <..., note, val>
13
+ @ ControlChange <..., num, val>
14
+ @ ProgramChange <..., num>
15
+ @ ChannelPressure <..., val>
16
+ @ PitchBendChange <..., val>
17
+ # ChannelModeMessage
18
+ @ AllSoundOff <..., ch>
19
+ @ ResetAllControllers <..., ch>
20
+ @ LocalControl <..., ch, val>
21
+ @ AllNotesOff <..., ch>
22
+ @ OmniOff <..., ch>
23
+ @ OmniOn <..., ch>
24
+ @ MonoMode <..., ch, val>
25
+ @ PolyMode <..., ch>
26
+ + SystemMessage
27
+ o ExclusiveMessage
28
+ # ExclusiveF0 <..., data>
29
+ # ExclusiveF7 <..., data>
30
+ + Meta
31
+ o SequenceNumber <..., num>
32
+ o Text <..., text>
33
+ # GeneralPurposeText (Text01)
34
+ # CopyrightNotice (Text02)
35
+ # TrackName (SequenceName, Text03)
36
+ # InstrumentName (Text04)
37
+ # Lyric (Display, Text05)
38
+ # Marker (Text06)
39
+ # CuePoint (Text07)
40
+ # ProgramName (Text08)
41
+ # DeviceName (Text09)
42
+ # Text0A
43
+ # Text0B
44
+ # Text0C
45
+ # Text0D
46
+ # Text0E
47
+ # Text0F
48
+ o ChannelPrefix <..., ch>
49
+ o MIDIPort <..., num> (PR-001 �ˤʤ�)
50
+ o EndOfTrack
51
+ o SetTempo <..., tempo>
52
+ o SMPTEOffset <..., hr, mn, se, fr, ff, tc>
53
+ o TimeSignature <..., nn, dd, cc, bb>
54
+ o KeySignature <..., sf, mi>
55
+ o SequencerSpecific <..., data>
56
+
57
+ Sequence
58
+
59
+ �������󥹤�ɽ�����륯�饹�Ǥ����������󥹤ϥȥ�å������ޤ���
60
+
61
+ �����ѡ����饹
62
+
63
+ Object
64
+
65
+ ���󥯥롼�ɤ��Ƥ���⥸�塼��
66
+
67
+ Enumerable
68
+
69
+ ���饹�᥽�å�
70
+
71
+ decode(str)
72
+ ʸ���󤫤��ɤߤ��ߤޤ���
73
+
74
+ read(io)
75
+ IO �����ɤߤ��ߤޤ���
76
+
77
+ load(fn)
78
+ �ե����뤫���ɤߤ��ߤޤ���
79
+
80
+ �嵭3�ĤΥ᥽�åɤϡ����������ƥ������ΤȤ��Ρ��ȥ���� �Ρ��ȥ�
81
+ �դ��֤��������ޤ���
82
+
83
+ new([format=1[, division=96[,tc=nil]]])
84
+ �������󥹥��֥������Ȥ�������ޤ���
85
+
86
+ ��������
87
+
88
+ format
89
+ division
90
+ tc
91
+
92
+ �᥽�å�
93
+
94
+ �ۤ� Array ��Ʊ���᥽�åɤ��Ĥ����ޤ��� ����ʳ��Τ�Ρ����դ�ɬ�פʤ�
95
+ �Τ�ʲ����������ޤ���
96
+
97
+ ntrks
98
+ nitems ��Ʊ���Ǥ���
99
+
100
+ self >> tr
101
+ ���Ǥ�����ޤ���
102
+
103
+ each{|tr| ...}
104
+ ���ǤˤĤ��Ʒ����֤��ޤ���
105
+
106
+ nil �����Ǥ�̵�뤵��ޤ���
107
+
108
+ join!
109
+ �ȥ�å���ҤȤĤˤ��ޤ��� EOT �ϡ����ե��åȤ���äȤ��礭�ʤ�
110
+ �Τ����Ѥ���ޤ���
111
+
112
+ encode
113
+ ʸ����˽񤭤ޤ���
114
+
115
+ �⤷���ȥ�å��� EOT ���ʤ���С� �ȥ�å��κǸ�˥ǥ륿���� EOT
116
+ ���ɲä��ޤ���
117
+
118
+ write(io)
119
+ IO �˽񤭤ޤ���
120
+
121
+ save(fn)
122
+ �ե�����˽񤭤ޤ���
123
+
124
+ Track
125
+
126
+ �ȥ�å���ɽ�����륯�饹�Ǥ����ȥ�å��ϥ��٥�Ȥ����ޤ���
127
+
128
+ �����ѡ����饹
129
+
130
+ Object
131
+
132
+ ���󥯥롼�ɤ��Ƥ���⥸�塼��
133
+
134
+ Enumerable
135
+
136
+ ���饹�᥽�å�
137
+
138
+ new
139
+ �ȥ�å����֥������Ȥ�������ޤ���
140
+
141
+ �᥽�å�
142
+
143
+ �ۤ� Array ��Ʊ���᥽�åɤ��Ĥ����ޤ��� ����ʳ��Τ�Ρ����դ�ɬ�פʤ�
144
+ �Τ�ʲ����������ޤ���
145
+
146
+ nevts
147
+ nitems ��Ʊ���Ǥ���
148
+
149
+ self >> ev
150
+ ���Ǥ�����ޤ���
151
+
152
+ each{|ev| ...}
153
+ ���ǤˤĤ��Ʒ����֤��ޤ���
154
+
155
+ nil �����Ǥ�̵�뤵��ޤ����ޤ������٥�Ȥϥ����Ȥ���ޤ� (����)
156
+ ��
157
+
158
+ Event
159
+
160
+ ���٥�Ȥ���ݥ��饹�Ǥ���
161
+
162
+ �����ѡ����饹
163
+
164
+ Object
165
+
166
+ ���󥯥롼�ɤ��Ƥ���⥸�塼��
167
+
168
+ Comparable
169
+
170
+ ��������
171
+
172
+ offset
@@ -0,0 +1,135 @@
1
+
2
+ Classes
3
+
4
+ * Sequence <format, division, tc=nil>
5
+ * Track
6
+ * Event <offset>
7
+ + MIDIMessage
8
+ o ChannelMessage <..., ch>
9
+ # VoiceMessage
10
+ @ NoteOff <..., note, vel>
11
+ @ NoteOn <..., note, vel>
12
+ @ PolyphonicKeyPressure <..., note, val>
13
+ @ ControlChange <..., num, val>
14
+ @ ProgramChange <..., num>
15
+ @ ChannelPressure <..., val>
16
+ @ PitchBendChange <..., val>
17
+ # ChannelModeMessage
18
+ @ AllSoundOff <..., ch>
19
+ @ ResetAllControllers <..., ch>
20
+ @ LocalControl <..., ch, val>
21
+ @ AllNotesOff <..., ch>
22
+ @ OmniOff <..., ch>
23
+ @ OmniOn <..., ch>
24
+ @ MonoMode <..., ch, val>
25
+ @ PolyMode <..., ch>
26
+ + SystemMessage
27
+ o ExclusiveMessage
28
+ # ExclusiveF0 <..., data>
29
+ # ExclusiveF7 <..., data>
30
+ + Meta
31
+ o SequenceNumber <..., num>
32
+ o Text <..., text>
33
+ # GeneralPurposeText (Text01)
34
+ # CopyrightNotice (Text02)
35
+ # TrackName (SequenceName, Text03)
36
+ # InstrumentName (Text04)
37
+ # Lyric (Display, Text05)
38
+ # Marker (Text06)
39
+ # CuePoint (Text07)
40
+ # ProgramName (Text08)
41
+ # DeviceName (Text09)
42
+ # Text0A
43
+ # Text0B
44
+ # Text0C
45
+ # Text0D
46
+ # Text0E
47
+ # Text0F
48
+ o ChannelPrefix <..., ch>
49
+ o MIDIPort <..., num> (not in RP-001)
50
+ o EndOfTrack
51
+ o SetTempo <..., tempo>
52
+ o SMPTEOffset <..., hr, mn, se, fr, ff, tc>
53
+ o TimeSignature <..., nn, dd, cc, bb>
54
+ o KeySignature <..., sf, mi>
55
+ o SequencerSpecific <..., data>
56
+
57
+ Sequence
58
+
59
+ Super Class
60
+
61
+ Object
62
+
63
+ Included Modules
64
+
65
+ Enumerable
66
+
67
+ Class Methods
68
+
69
+ decode(str)
70
+ read(io)
71
+ load(fn)
72
+ new([format=1[, division=96[,tc=nil]]])
73
+
74
+ The three methods decode(), read() and load() replace NoteOn with
75
+ NoteOff when its velocity is zero.
76
+
77
+ Accessors
78
+
79
+ format
80
+ division
81
+ tc
82
+
83
+ Methods
84
+
85
+ This nearly have all methods of array object. In addition, this also
86
+ have the following methods.
87
+
88
+ ntrks
89
+ self >> tr
90
+ each{|tr| ...}
91
+ join!
92
+ encode
93
+ write(io)
94
+ save(fn)
95
+
96
+ The iterator each{} ignores all nil elements.
97
+
98
+ Track
99
+
100
+ Super Class
101
+
102
+ Object
103
+
104
+ Included Modules
105
+
106
+ Enumerable
107
+
108
+ Class Methods
109
+
110
+ new
111
+
112
+ Methods
113
+
114
+ This nearly have all methods of array object. In addition, this also
115
+ have the following methods.
116
+
117
+ nevts
118
+ self >> ev
119
+ each{|ev| ...}
120
+
121
+ The iterator each{} ignores all nil elements and sorts events (stable).
122
+
123
+ Event
124
+
125
+ Super Class
126
+
127
+ Object
128
+
129
+ Included Modules
130
+
131
+ Comparable
132
+
133
+ Accessors
134
+
135
+ offset
@@ -0,0 +1,150 @@
1
+ <?xml version="1.0" encoding="iso-8859-1" ?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
6
+ <head>
7
+ <title>SMF</title>
8
+ <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
9
+ <link href="default.css" type="text/css" rel="stylesheet" />
10
+ <link href="index.html" rel="index" />
11
+ <link href="mailto:tadf@funaba.org" rev="made" />
12
+ </head>
13
+ <body>
14
+ <h1><a name="label-0" id="label-0">SMF module</a></h1><!-- RDLabel: "SMF module" -->
15
+ <h2><a name="label-1" id="label-1">Classes</a></h2><!-- RDLabel: "Classes" -->
16
+ <ul>
17
+ <li>Sequence &lt;format, division, tc=nil&gt;</li>
18
+ <li>Track</li>
19
+ <li>Event &lt;offset&gt;
20
+ <ul>
21
+ <li>MIDIMessage
22
+ <ul>
23
+ <li>ChannelMessage &lt;..., ch&gt;
24
+ <ul>
25
+ <li>VoiceMessage
26
+ <ul>
27
+ <li>NoteOff &lt;..., note, vel&gt;</li>
28
+ <li>NoteOn &lt;..., note, vel&gt;</li>
29
+ <li>PolyphonicKeyPressure &lt;..., note, val&gt;</li>
30
+ <li>ControlChange &lt;..., num, val&gt;</li>
31
+ <li>ProgramChange &lt;..., num&gt;</li>
32
+ <li>ChannelPressure &lt;..., val&gt;</li>
33
+ <li>PitchBendChange &lt;..., val&gt;</li>
34
+ </ul></li>
35
+ <li>ChannelModeMessage
36
+ <ul>
37
+ <li>AllSoundOff &lt;..., ch&gt;</li>
38
+ <li>ResetAllControllers &lt;..., ch&gt;</li>
39
+ <li>LocalControl &lt;..., ch, val&gt;</li>
40
+ <li>AllNotesOff &lt;..., ch&gt;</li>
41
+ <li>OmniOff &lt;..., ch&gt;</li>
42
+ <li>OmniOn &lt;..., ch&gt;</li>
43
+ <li>MonoMode &lt;..., ch, val&gt;</li>
44
+ <li>PolyMode &lt;..., ch&gt;</li>
45
+ </ul></li>
46
+ </ul></li>
47
+ </ul></li>
48
+ <li>SystemMessage
49
+ <ul>
50
+ <li>ExclusiveMessage
51
+ <ul>
52
+ <li>ExclusiveF0 &lt;..., data&gt;</li>
53
+ <li>ExclusiveF7 &lt;..., data&gt;</li>
54
+ </ul></li>
55
+ </ul></li>
56
+ <li>Meta
57
+ <ul>
58
+ <li>SequenceNumber &lt;..., num&gt;</li>
59
+ <li>Text &lt;..., text&gt;
60
+ <ul>
61
+ <li>GeneralPurposeText (Text01)</li>
62
+ <li>CopyrightNotice (Text02)</li>
63
+ <li>TrackName (SequenceName, Text03)</li>
64
+ <li>InstrumentName (Text04)</li>
65
+ <li>Lyric (Display, Text05)</li>
66
+ <li>Marker (Text06)</li>
67
+ <li>CuePoint (Text07)</li>
68
+ <li>ProgramName (Text08)</li>
69
+ <li>DeviceName (Text09)</li>
70
+ <li>Text0A</li>
71
+ <li>Text0B</li>
72
+ <li>Text0C</li>
73
+ <li>Text0D</li>
74
+ <li>Text0E</li>
75
+ <li>Text0F</li>
76
+ </ul></li>
77
+ <li>ChannelPrefix &lt;..., ch&gt;</li>
78
+ <li>MIDIPort &lt;..., num&gt; (not in RP-001)</li>
79
+ <li>EndOfTrack</li>
80
+ <li>SetTempo &lt;..., tempo&gt;</li>
81
+ <li>SMPTEOffset &lt;..., hr, mn, se, fr, ff, tc&gt;</li>
82
+ <li>TimeSignature &lt;..., nn, dd, cc, bb&gt;</li>
83
+ <li>KeySignature &lt;..., sf, mi&gt;</li>
84
+ <li>SequencerSpecific &lt;..., data&gt;</li>
85
+ </ul></li>
86
+ </ul></li>
87
+ </ul>
88
+ <h2><a name="label-2" id="label-2">Sequence</a></h2><!-- RDLabel: "Sequence" -->
89
+ <h3><a name="label-3" id="label-3">Super Class</a></h3><!-- RDLabel: "Super Class" -->
90
+ <p>Object</p>
91
+ <h3><a name="label-4" id="label-4">Included Modules</a></h3><!-- RDLabel: "Included Modules" -->
92
+ <p>Enumerable</p>
93
+ <h3><a name="label-5" id="label-5">Class Methods</a></h3><!-- RDLabel: "Class Methods" -->
94
+ <dl>
95
+ <dt><a name="label-6" id="label-6">decode(str)</a></dt><!-- RDLabel: "decode(str)" -->
96
+ <dt><a name="label-7" id="label-7">read(io)</a></dt><!-- RDLabel: "read(io)" -->
97
+ <dt><a name="label-8" id="label-8">load(fn)</a></dt><!-- RDLabel: "load(fn)" -->
98
+ <dt><a name="label-9" id="label-9">new([format=1[, division=96[,tc=nil]]])</a></dt><!-- RDLabel: "new([format=1[, division=96[,tc=nil]]])" -->
99
+ </dl>
100
+ <p>The three methods decode(), read() and load() replace NoteOn with NoteOff
101
+ when its velocity is zero.</p>
102
+ <h3><a name="label-10" id="label-10">Accessors</a></h3><!-- RDLabel: "Accessors" -->
103
+ <dl>
104
+ <dt><a name="label-11" id="label-11">format</a></dt><!-- RDLabel: "format" -->
105
+ <dt><a name="label-12" id="label-12">division</a></dt><!-- RDLabel: "division" -->
106
+ <dt><a name="label-13" id="label-13">tc</a></dt><!-- RDLabel: "tc" -->
107
+ </dl>
108
+ <h3><a name="label-14" id="label-14">Methods</a></h3><!-- RDLabel: "Methods" -->
109
+ <p>This nearly have all methods of array object.
110
+ In addition, this also have the following methods.</p>
111
+ <dl>
112
+ <dt><a name="label-15" id="label-15">ntrks</a></dt><!-- RDLabel: "ntrks" -->
113
+ <dt><a name="label-16" id="label-16">self &gt;&gt; tr</a></dt><!-- RDLabel: "self >> tr" -->
114
+ <dt><a name="label-17" id="label-17">each{|tr| ...}</a></dt><!-- RDLabel: "each{|tr| ...}" -->
115
+ <dt><a name="label-18" id="label-18">join!</a></dt><!-- RDLabel: "join!" -->
116
+ <dt><a name="label-19" id="label-19">encode</a></dt><!-- RDLabel: "encode" -->
117
+ <dt><a name="label-20" id="label-20">write(io)</a></dt><!-- RDLabel: "write(io)" -->
118
+ <dt><a name="label-21" id="label-21">save(fn)</a></dt><!-- RDLabel: "save(fn)" -->
119
+ </dl>
120
+ <p>The iterator each{} ignores all nil elements.</p>
121
+ <h2><a name="label-22" id="label-22">Track</a></h2><!-- RDLabel: "Track" -->
122
+ <h3><a name="label-23" id="label-23">Super Class</a></h3><!-- RDLabel: "Super Class" -->
123
+ <p>Object</p>
124
+ <h3><a name="label-24" id="label-24">Included Modules</a></h3><!-- RDLabel: "Included Modules" -->
125
+ <p>Enumerable</p>
126
+ <h3><a name="label-25" id="label-25">Class Methods</a></h3><!-- RDLabel: "Class Methods" -->
127
+ <dl>
128
+ <dt><a name="label-26" id="label-26">new</a></dt><!-- RDLabel: "new" -->
129
+ </dl>
130
+ <h3><a name="label-27" id="label-27">Methods</a></h3><!-- RDLabel: "Methods" -->
131
+ <p>This nearly have all methods of array object.
132
+ In addition, this also have the following methods.</p>
133
+ <dl>
134
+ <dt><a name="label-28" id="label-28">nevts</a></dt><!-- RDLabel: "nevts" -->
135
+ <dt><a name="label-29" id="label-29">self &gt;&gt; ev</a></dt><!-- RDLabel: "self >> ev" -->
136
+ <dt><a name="label-30" id="label-30">each{|ev| ...}</a></dt><!-- RDLabel: "each{|ev| ...}" -->
137
+ </dl>
138
+ <p>The iterator each{} ignores all nil elements and sorts events (stable).</p>
139
+ <h2><a name="label-31" id="label-31">Event</a></h2><!-- RDLabel: "Event" -->
140
+ <h3><a name="label-32" id="label-32">Super Class</a></h3><!-- RDLabel: "Super Class" -->
141
+ <p>Object</p>
142
+ <h3><a name="label-33" id="label-33">Included Modules</a></h3><!-- RDLabel: "Included Modules" -->
143
+ <p>Comparable</p>
144
+ <h3><a name="label-34" id="label-34">Accessors</a></h3><!-- RDLabel: "Accessors" -->
145
+ <dl>
146
+ <dt><a name="label-35" id="label-35">offset</a></dt><!-- RDLabel: "offset" -->
147
+ </dl>
148
+
149
+ </body>
150
+ </html>