-
Notifications
You must be signed in to change notification settings - Fork 0
/
这世界那么多人Demo.java
395 lines (337 loc) · 27.6 KB
/
这世界那么多人Demo.java
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.MidiEvent;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.MidiUnavailableException;
import javax.sound.midi.Sequence;
import javax.sound.midi.Sequencer;
import javax.sound.midi.ShortMessage;
import javax.sound.midi.Track;
public class 这世界那么多人Demo {
public static void main(String[] args)
throws InvalidMidiDataException, MidiUnavailableException, InterruptedException {
final int scale = 8; // scale 随意,体现 beat 和 Sequence 2nd param resolution 的关系即可
final int beat = scale * 4;
final int channel = 6;
final int volume = 100;
final int length = beat * 4;
Sequencer player = MidiSystem.getSequencer();
Sequence sequence = new Sequence(Sequence.PPQ, scale * 4);
player.setSequence(sequence);
Track track = sequence.createTrack();
MyNoteImpl myNoteImpl = new MyNoteImpl(MyNote.Major.B);
这世界那么多人right(track, channel, myNoteImpl, volume, beat, length);
player.open();
Thread.sleep(100);
player.setTempoInBPM(72);
player.start();
}
public static void 这世界那么多人right(
Track track, int channel, MyNoteImpl myNoteImpl,
int volume, int beat, int length) throws InvalidMidiDataException {
int tick = 0;
tick += addNote(track, channel, 0, 0, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(2), volume, tick, beat, tick + length);
// 3
tick += addNote(track, channel, myNoteImpl.getLa(1), volume, tick, beat * 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(1), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat, tick + length);
// 5
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat * 2, tick + length);
// 6
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
// 7 这世界有那么多
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
// 8 人 人群
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat * 2, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 9 里敞着一扇
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
// 10 门 我
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
// 11 迷朦的眼睛里
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
// 12 长存 初见
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 13 你蓝色清
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
// 14 晨 这
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat * 2, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
// 15 世界有那么多
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
// 16 人 多幸
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat * 2, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 17 运我有个我
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
// 18 们 这
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
// 19 悠长命运中的
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
// 20 晨昏 常让
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat * 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 21 我望远方出
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat, tick + length);
// 22 神
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat * 3, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat, tick + length);
// 23 灰树叶飘转
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 24 在池塘
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat * 2, tick + length);
// 25 看飞机轰的一声
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
// 26 去远乡 光阴
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 27 的长廊
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat * 2, tick + length);
// 28 脚步声叫嚷 灯一
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
// 29 亮 无人的空
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
// 30 荡
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat * 3, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat, tick + length);
// 31 晚风中闪过
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(1), volume, tick, beat, tick + length);
// 32 几帧从前啊
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat * 2, tick + length);
// 33 飞驰中旋转
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
// 34 已不见了吗
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat * 2, tick + length);
// 35 远光中走来
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(1), volume, tick, beat, tick + length);
// 36 你一身晴朗
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat * 2, tick + length);
// 37 身旁那么多人
tick += addNote(track, channel, 0, 0, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
// 38 可世界不声不
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
// 39 响
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat * 2, tick + length);
// 40
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(1), volume, tick, beat * 2, tick + length);
// 43 (重复的省略,到结尾部分) 这
tick += addNote(track, channel, 0, 0, tick, beat * 3, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat, tick + length);
// 44 世界有那么多
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
// 45 人 活在
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat * 2, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 46 我飞扬的青
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
// 47 春 在
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat * 3 / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
// 48 泪水里浸湿过的
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
// 49 长吻 常让
tick += addNote(track, channel, myNoteImpl.getLa(0), volume, tick, beat * 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat, tick + length);
tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 50 我想啊想出
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat * 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getLa(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getSol(-1), volume, tick, beat / 2, tick + length);
tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// 51 神
tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat * 3, tick + length);
tick += addNote(track, channel, 0, 0, tick, beat, tick + length);
// 52 最后的伴奏找不到简谱,这个谱也不对,先注释了
// tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat / 2, tick + length);
// tick += addNote(track, channel, myNoteImpl.getRe(0), volume, tick, beat / 2, tick + length);
// tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat, tick + length);
// tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat, tick + length);
// tick += addNote(track, channel, 0, 0, tick, beat, tick + length);
// tick += addNote(track, channel, myNoteImpl.getDo(0), volume, tick, beat * 2 / 3, tick + length);
// tick += addNote(track, channel, myNoteImpl.getMi(0), volume, tick, beat * 2 / 3, tick + length);
// tick += addNote(track, channel, myNoteImpl.getSol(0), volume, tick, beat * 2 / 3, tick + length);
// tick += addNote(track, channel, myNoteImpl.getDo(1), volume, tick, beat, tick + length);
}
public static int addNote(Track track, int channel, int note, int volume, int tick, int length, int endTick)
throws InvalidMidiDataException {
// channel: instrument. different kinds of piano
ShortMessage shortMessage = new ShortMessage(ShortMessage.NOTE_ON, channel, note, volume);
MidiEvent midiEvent = new MidiEvent(shortMessage, tick);
track.add(midiEvent);
ShortMessage shortMessage2 = new ShortMessage(ShortMessage.NOTE_OFF, channel, note, volume);
MidiEvent midiEvent2 = new MidiEvent(shortMessage2, endTick);
track.add(midiEvent2);
return length;
}
}