Changeset 5

User picture

Author: ken1.64881098.dev

(2011/06/03 15:47) 12 months ago


  

Affected files

Updated trunk/mi/CLI.cs Download diff

45
23
        private const int STATE_CLOSE = 2;
23
        private const int STATE_CLOSE = 2;
24
        private const int STATE_PLAYING = 3;
24
        private const int STATE_PLAYING = 3;
25
25
26
        public uint Division { set; get; }
27
26
        public CLI()
28
        public CLI()
27
        {
29
        {
28
            this.init();
30
            this.init();
...
...
31
        public void init()
33
        public void init()
32
        {
34
        {
33
            master = new MidiMaster();
35
            master = new MidiMaster();
34
            player = new MidiPlayer();
36
            player = new MidiPlayer(master.Division);
35
        }
37
        }
36
38
37
        int PlayTrack = 0;
39
        int PlayTrack = 0;
...
...
253
                        }
255
                        }
254
256
255
                        MidiFileReader reader = new MidiFileReader();
257
                        MidiFileReader reader = new MidiFileReader();
256
                        List<MiOpe> miList = reader.Read(importFileName);
258
                        List<MiOpe> miList = reader.Read(importFileName, master.Division);
257
259
258
                        if (miList != null)
260
                        if (miList != null)
259
                        {
261
                        {

Updated trunk/mi/mi.csproj Download diff

45
59
    <Compile Include="MiParseException.cs" />
59
    <Compile Include="MiParseException.cs" />
60
    <Compile Include="MiParser.cs" />
60
    <Compile Include="MiParser.cs" />
61
    <Compile Include="mi\cc\MiBendrange.cs" />
61
    <Compile Include="mi\cc\MiBendrange.cs" />
62
    <Compile Include="mi\cc\MiCc.cs" />
62
    <Compile Include="mi\cc\MiExpression.cs" />
63
    <Compile Include="mi\cc\MiExpression.cs" />
63
    <Compile Include="mi\cc\MiPan.cs" />
64
    <Compile Include="mi\cc\MiPan.cs" />
64
    <Compile Include="mi\MiChoking.cs" />
65
    <Compile Include="mi\MiChoking.cs" />

Updated trunk/mi/mi/cc/MiChorus.cs Download diff

45
5
5
6
namespace mi.mi
6
namespace mi.mi
7
{
7
{
8
    class MiChorus : MiCc
8
    class MiChorus : MiControlChange
9
    {
9
    {
10
        public string CHORUS_STR = "chorus";
10
        public string CHORUS_STR = "chorus";
11
        protected override byte getControlChangeNo()
11
        protected override byte getControlChangeNo()

Updated trunk/mi/mi/cc/MiControlChange.cs Download diff

45
5
5
6
namespace mi.mi
6
namespace mi.mi
7
{
7
{
8
    class MiCc : MiOpe
8
    abstract class MiControlChange : MiOpe
9
    {
9
    {
10
        // ControlChange関連
11
        private string CC_STR = "cc";
12
        private string NO_STR = "no";
13
        public byte No { set; get; }
14
15
        // value関連
10
        // value関連
16
        private Boolean ControlChangeParseOK = false;
11
        private Boolean ControlChangeParseOK = false;
17
        public string VALUE_STR = "value";
12
        public string VALUE_STR = "value";
...
...
23
        public string NOTELEN_STR = "note";
18
        public string NOTELEN_STR = "note";
24
        public uint Len { set; get; }
19
        public uint Len { set; get; }
25
20
26
        public MiCc()
21
        public MiControlChange()
27
        {
22
        {
28
            this.Len = 0;
23
            this.Len = 0;
29
        }
24
        }
...
...
129
            return listData;
124
            return listData;
130
        }
125
        }
131
126
132
        public override string getLine()
127
        abstract protected byte getControlChangeNo();
133
        {
134
            StringBuilder sb = new StringBuilder();
135
136
            sb.Append(base.getLine());
137
            sb.Append(CC_STR);
138
            sb.Append("\t");
139
            sb.Append(NO_STR);
140
            sb.Append("=");
141
            sb.Append(No);
142
            sb.Append("\t");
143
            sb.Append("value=");
144
            sb.Append(this.Value);
145
            sb.Append("\t");
146
            sb.Append("ch=");
147
            sb.Append(this.Channel + 1);
148
149
            return sb.ToString();
150
        }
151
152
        virtual protected byte getControlChangeNo()
153
        {
154
            return No;
155
        }
156
    }
128
    }
157
}
129
}

Updated trunk/mi/mi/cc/MiExpression.cs Download diff

45
5
5
6
namespace mi.mi.cc
6
namespace mi.mi.cc
7
{
7
{
8
    class MiExpression : MiCc
8
    class MiExpression : MiControlChange
9
    {
9
    {
10
        public string EXP_STR = "expression";
10
        public string EXP_STR = "expression";
11
        protected override byte getControlChangeNo()
11
        protected override byte getControlChangeNo()

Updated trunk/mi/mi/cc/MiModulation.cs Download diff

45
5
5
6
namespace mi.mi
6
namespace mi.mi
7
{
7
{
8
    class MiModulation : MiCc
8
    class MiModulation : MiControlChange
9
    {
9
    {
10
        public string MODULATION_STR = "modulation";
10
        public string MODULATION_STR = "modulation";
11
        protected override byte getControlChangeNo()
11
        protected override byte getControlChangeNo()

Updated trunk/mi/mi/cc/MiPan.cs Download diff

45
5
5
6
namespace mi.mi.cc
6
namespace mi.mi.cc
7
{
7
{
8
    class MiPan : MiCc
8
    class MiPan : MiControlChange
9
    {
9
    {
10
        public string PAN_STR = "pan";
10
        public string PAN_STR = "pan";
11
        protected override byte getControlChangeNo()
11
        protected override byte getControlChangeNo()

Updated trunk/mi/mi/cc/MiReverb.cs Download diff

45
5
5
6
namespace mi.mi.cc
6
namespace mi.mi.cc
7
{
7
{
8
    class MiReverb : MiCc
8
    class MiReverb : MiControlChange
9
    {
9
    {
10
10
11
        public string REVERB_STR = "reverb";
11
        public string REVERB_STR = "reverb";

Updated trunk/mi/mi/cc/MiVolume.cs Download diff

45
5
5
6
namespace mi.mi.cc
6
namespace mi.mi.cc
7
{
7
{
8
    class MiVolume : MiCc
8
    class MiVolume : MiControlChange
9
    {
9
    {
10
        public string VOLUME_STR = "volume";
10
        public string VOLUME_STR = "volume";
11
        protected override byte getControlChangeNo()
11
        protected override byte getControlChangeNo()

Updated trunk/mi/mi/MiOpe.cs Download diff

45
24
        public string CHANNEL_STR = "ch";
24
        public string CHANNEL_STR = "ch";
25
        public uint Channel { set; get; }
25
        public uint Channel { set; get; }
26
26
27
        // Len関連
28
        public uint Len { set; get; }
29
30
        public MiOpe()
31
        {
32
            this.Len = 0;
33
        }
27
        /// <summary>
34
        /// <summary>
28
        /// 
35
        /// 
29
        /// </summary>
36
        /// </summary>

Updated trunk/mi/mididata/MidiInfo.cs Download diff

45
25
        public static int[] GUITAR_G_CODE = { G[3], B[3], D[4], G[4], B[4], G[5] };
25
        public static int[] GUITAR_G_CODE = { G[3], B[3], D[4], G[4], B[4], G[5] };
26
        public static int[] GUITAR_A_CODE = { A[3], E[4], A[4], C[5]+1, E[5] };
26
        public static int[] GUITAR_A_CODE = { A[3], E[4], A[4], C[5]+1, E[5] };
27
        public static int[] GUITAR_B_CODE = { F[3]+1, B[3], F[4]+1, B[4], D[5]+1, F[5]+1 };
27
        public static int[] GUITAR_B_CODE = { F[3]+1, B[3], F[4]+1, B[4], D[5]+1, F[5]+1 };
28
        public const int DIVISION = 120;
28
        public static uint DIVISION = 120;
29
29
30
        public const byte STATUS_NOTE_ON = 0x09;
30
        public const byte STATUS_NOTE_ON = 0x09;
31
        public const byte STATUS_NOTE_OFF = 0x08;
31
        public const byte STATUS_NOTE_OFF = 0x08;
...
...
56
        public const int KEY_FLAT = -1;
56
        public const int KEY_FLAT = -1;
57
        public const int KEY_DOUBLE_FLAT = -2;
57
        public const int KEY_DOUBLE_FLAT = -2;
58
58
59
        public const int NOTE_4 = DIVISION;
59
        public static uint NOTE_4 = DIVISION;
60
        public const int NOTE_8 = NOTE_4 / 2;
60
        public static uint NOTE_8 = NOTE_4 / 2;
61
        public const int NOTE_16 = NOTE_8 / 2;
61
        public static uint NOTE_16 = NOTE_8 / 2;
62
        public const int NOTE_32 = NOTE_16 / 2;
62
        public static uint NOTE_32 = NOTE_16 / 2;
63
        public const int NOTE_2 = DIVISION * 2;
63
        public static uint NOTE_2 = DIVISION * 2;
64
        public const int NOTE_3 = NOTE_2 + NOTE_1;
64
        public static uint NOTE_3 = NOTE_2 + NOTE_1;
65
        public const int NOTE_1 = NOTE_2 * 2;
65
        public static uint NOTE_1 = NOTE_2 * 2;
66
66
67
        public const int NOTE_45 = NOTE_4 + NOTE_8;
67
        public static uint NOTE_45 = NOTE_4 + NOTE_8;
68
        public const int NOTE_85 = NOTE_8 + NOTE_16;
68
        public static uint NOTE_85 = NOTE_8 + NOTE_16;
69
        public const int NOTE_165 = NOTE_16 + NOTE_32;
69
        public static uint NOTE_165 = NOTE_16 + NOTE_32;
70
70
71
        // 連譜
71
        // 連譜
72
        public const int NOTE_166 = NOTE_4 / 6;
72
        public static uint NOTE_166 = NOTE_4 / 6;
73
        public const int NOTE_163 = NOTE_8 / 3;
73
        public static uint NOTE_163 = NOTE_8 / 3;
74
74
75
        public const int PARSE_ERROR = 0;
75
        public const int PARSE_ERROR = 0;
76
        public const int PARSE_MIDIDATA = 1;
76
        public const int PARSE_MIDIDATA = 1;

Updated trunk/mi/MidiFileReader.cs Download diff

45
18
            public byte[] data;
18
            public byte[] data;
19
        }
19
        }
20
20
21
        public List<MiOpe> Read(string fileName)
21
        public List<MiOpe> Read(string fileName, uint Division)
22
        {
22
        {
23
            try
23
            try
24
            {
24
            {
...
...
31
                int position = 0;
31
                int position = 0;
32
                short Format;
32
                short Format;
33
                short TruckNum;
33
                short TruckNum;
34
                short Division;
35
34
36
                // Get Chunk Type
35
                // Get Chunk Type
37
                byte[] Mthd = reader.ReadBytes(4);
36
                byte[] Mthd = reader.ReadBytes(4);
...
...
53
52
54
                // Get division
53
                // Get division
55
                short division = reader.ReadInt16();
54
                short division = reader.ReadInt16();
56
                Division = BigLittleConverter16(division);
55
                Division = (uint)BigLittleConverter16(division);
57
                position += 2;
56
                position += 2;
58
57
59
                // Truck毎のサイズ、データを読み取る。(解析はしない。)
58
                // Truck毎のサイズ、データを読み取る。(解析はしない。)
...
...
90
                List<MiOpe> miList = new List<MiOpe>();
89
                List<MiOpe> miList = new List<MiOpe>();
91
                // TruckDataByteArray解析。
90
                // TruckDataByteArray解析。
92
                byte channel = 1;
91
                byte channel = 1;
93
                Boolean rpnLSBOn = false;
92
94
                Boolean rpnMSBOn = false;
95
                Boolean dataLSBOn = false;
96
                Boolean dataMSBOn = false;
97
                foreach (TruckDataByteArray info in truckDataInfoList)
93
                foreach (TruckDataByteArray info in truckDataInfoList)
98
                {
94
                {
99
                    uint dataPosition = 0;
95
                    uint dataPosition = 0;
...
...
113
                        for (int i = 0; i < 4; i++)
109
                        for (int i = 0; i < 4; i++)
114
                        {
110
                        {
115
                            byte tmp = info.data[dataPosition++];
111
                            byte tmp = info.data[dataPosition++];
116
                            deltaTime = (deltaTime << 7) + (byte)(tmp & 0x7F);
112
                            //deltaTime = (deltaTime << 7) + (byte)(tmp & 0x7F);
113
                            deltaTimeBuf[i] = tmp;
117
                            if (tmp < 0x80) break;
114
                            if (tmp < 0x80) break;
118
                        }
115
                        }
119
116
120
                        totalTick += deltaTime;
117
                        totalTick += (uint)GetIntegerFromMSB(deltaTimeBuf);
121
                        //                    midiData.PrevTick = (uint)deltaTime;
118
                        //                    midiData.PrevTick = (uint)deltaTime;
122
119
123
                        uint bar = totalTick / (MidiInfo.DIVISION * 4);
120
                        uint bar = (uint)(totalTick / (Division * 4));
124
                        uint pos = totalTick % (MidiInfo.DIVISION * 4);
121
                        uint pos = (uint)(totalTick % (Division * 4));
125
122
126
                        // EventTypeを取得する
123
                        // EventTypeを取得する
127
                        prevStatus = currentStatus;
124
                        prevStatus = currentStatus;
...
...
253
                                // コントロールチェンジ
250
                                // コントロールチェンジ
254
                                else if ((currentStatus >> 4) == MidiInfo.STATUS_CONTROLCHANGE)
251
                                else if ((currentStatus >> 4) == MidiInfo.STATUS_CONTROLCHANGE)
255
                                {
252
                                {
256
                                    MiCc mi;
253
                                    MiControlChange mi;
257
                                    // チャネルボイスメッセージ
254
                                    // チャネルボイスメッセージ
258
                                    if (nextData < 120)
255
                                    if (nextData < 120)
259
                                    {
256
                                    {
257
                                        MiCc miCc = new MiCc();
258
                                        miCc.Bar = bar;
259
                                        miCc.Pos = pos;
260
                                        miCc.Channel = channel;
261
                                        miCc.No = nextData;
262
                                        miCc.Value = info.data[dataPosition++];
263
                                        miList.Add(miCc);
264
                                        /*
260
                                        switch (nextData)
265
                                        switch (nextData)
261
                                        {
266
                                        {
262
                                            case MidiInfo.CONTROL_CHANGE_CHORUS:
267
                                            case MidiInfo.CONTROL_CHANGE_CHORUS:
...
...
331
                                                dataPosition++;
336
                                                dataPosition++;
332
                                                break;
337
                                                break;
333
                                            default:
338
                                            default:
334
                                                mi = new MiCc();
339
                                                mi = new MiControlChange();
335
                                                mi.Bar = bar;
340
                                                mi.Bar = bar;
336
                                                mi.Pos = pos;
341
                                                mi.Pos = pos;
337
                                                mi.Channel = channel;
342
                                                mi.Channel = channel;
...
...
340
                                                miList.Add(mi);
345
                                                miList.Add(mi);
341
                                                break;
346
                                                break;
342
                                        }
347
                                        }
348
                                        */
343
                                    }
349
                                    }
344
                                    // チャネルモードメッセージ
350
                                    // チャネルモードメッセージ
345
                                    else
351
                                    else
...
...
526
532
527
        private int GetIntegerFromMSB(byte[] tmp)
533
        private int GetIntegerFromMSB(byte[] tmp)
528
        {
534
        {
535
            /*
529
            int data = 0;
536
            int data = 0;
530
            for (int i = 0; i < tmp.Length; i++)
537
            for (int i = 0; i < tmp.Length; i++)
531
            {
538
            {
532
                data += ((tmp[i] & 0x7F) << (7 * i));
539
                data += ((tmp[i] & 0x7F) << (7 * i));
533
            }
540
            }
534
            return data;
541
            return data;
542
            
543
            int data = 0;
544
            for (int i = tmp.Length-1;i>=0;i--)
545
            {
546
                data = (data << 7) | (tmp[i] & 0x7F);
547
            }
548
            return data;
549
            */
550
            int data = 0;
551
            for (int i = 0; i < 4; i++)
552
            {
553
                byte t = tmp[i];
554
                data <<= 7;
555
                data |= t & 0x7F;
556
                if ((t < 0x80)) break;
557
            }
558
559
            return data;
535
        }
560
        }
536
    }
561
    }
537
}
562
}

Updated trunk/mi/MidiMaster.cs Download diff

45
24
        /// </summary>
24
        /// </summary>
25
        private List<AbstractMidiData> MasterTrack;
25
        private List<AbstractMidiData> MasterTrack;
26
26
27
        public uint Division{set;get;}
28
27
        public List<AbstractMidiData> getMasterTrack()
29
        public List<AbstractMidiData> getMasterTrack()
28
        {
30
        {
29
            return MasterTrack;
31
            return MasterTrack;
...
...
40
        /// </summary>
42
        /// </summary>
41
        public MidiMaster()
43
        public MidiMaster()
42
        {
44
        {
45
            Division = MidiInfo.DIVISION;
43
            TrackData = new List<AbstractMidiData>[MidiInfo.MIDI_TRACK_NUM + 1];
46
            TrackData = new List<AbstractMidiData>[MidiInfo.MIDI_TRACK_NUM + 1];
44
47
45
            for (int i = 0; i < MidiInfo.MIDI_TRACK_NUM; i++)
48
            for (int i = 0; i < MidiInfo.MIDI_TRACK_NUM; i++)

Updated trunk/mi/MidiPlayer.cs Download diff

45
18
18
19
        private int OpenDeviceID = MIDI.MAPPAR;
19
        private int OpenDeviceID = MIDI.MAPPAR;
20
20
21
        public MidiPlayer()
21
        public MidiPlayer(uint division)
22
        {
22
        {
23
            this.Division = division;
23
            Tempo = 120;
24
            Tempo = 120;
24
            Tempo2Msec();
25
            Tempo2Msec();
25
26
...
...
116
//            Close();
117
//            Close();
117
        }
118
        }
118
119
120
        uint Division { set; get; }
119
        private void Tempo2Msec()
121
        private void Tempo2Msec()
120
        {
122
        {
121
            MsecPerTick =  (60.0 * 1000.0 / (Tempo * 120.0));
123
            MsecPerTick =  (60.0 * 1000.0 / (Tempo * this.Division));
122
        }
124
        }
123
125
124
        public void Close()
126
        public void Close()

Updated trunk/mi/MiParser.cs Download diff

45
214
                lexResultList = ExceptCommentList;
214
                lexResultList = ExceptCommentList;
215
            }
215
            }
216
216
217
218
219
            this.bar = lexResultList[0];
217
            this.bar = lexResultList[0];
220
            this.pos = lexResultList[1];
218
            this.pos = lexResultList[1];
221
219
222
//            string bar = this.bar.ToString();
223
//            string pos = this.pos.ToString();
224
225
            this.opeStr = lexResultList[2];
220
            this.opeStr = lexResultList[2];
226
            lexResultList.RemoveAt(0);
221
            lexResultList.RemoveAt(0);
227
            lexResultList.RemoveAt(0);
222
            lexResultList.RemoveAt(0);
...
...
281
            string className = "Mi" + VBStrings.Left(opeStr, 1).ToUpper() + VBStrings.Mid(opeStr, 2);
276
            string className = "Mi" + VBStrings.Left(opeStr, 1).ToUpper() + VBStrings.Mid(opeStr, 2);
282
            Type classType = Type.GetType(className);
277
            Type classType = Type.GetType(className);
283
            /*
278
            /*
284
            result = (MiOpe)AAAA(bar, pos, className);
279
            if (className == "ParsePattern")
285
            if (result == null)
286
            {
280
            {
287
                if (PatternTable.Keys.Contains(opeStr))
281
                return null;
288
                {
289
                    MiPattern patternData = (MiPattern)ParsePattern(bar, pos);
290
291
                    List<AbstractMidiData> tmpList = PatternTable[opeStr];
292
                    foreach (AbstractMidiData idata in tmpList)
293
                    {
294
                        if (idata is MidiData)
295
                        {
296
                            MidiData data = (MidiData)idata.Clone();
297
                            data.Bar += (uint)(uint.Parse(bar) - 1);
298
                            data.Channel = patternData.Channel;
299
300
                            retList.Add(data);
301
                        }
302
                    }
303
304
                    lexResultList.Clear();
305
                    return retList;
306
                }
307
                else
308
                {
309
                    throw new MiParseException();
310
                }
311
            }
282
            }
283
            else
284
            {
285
                MiOpe testMiOpe = getMiOpe(bar, pos, className);
286
                return testMiOpe;
287
            }
312
            */
288
            */
313
            
289
            
314
            string methodName = "Parse" + VBStrings.Left(opeStr,1).ToUpper() + VBStrings.Mid(opeStr,2);
290
            string methodName = "Parse" + VBStrings.Left(opeStr,1).ToUpper() + VBStrings.Mid(opeStr,2);
...
...
328
                {
304
                {
329
                    MiPattern patternData = (MiPattern)ParsePattern(bar, pos);
305
                    MiPattern patternData = (MiPattern)ParsePattern(bar, pos);
330
                    patternData.PatternName = opeStr;
306
                    patternData.PatternName = opeStr;
331
                    return patternData;
307
                    return patternData;                
332
/*                    
333
                    List<AbstractMidiData> tmpList = PatternTable[opeStr];
334
                    foreach (AbstractMidiData idata in tmpList)
335
                    {
336
                        if (idata is MidiData)
337
                        {
338
                            MidiData data = (MidiData)idata.Clone();
339
                            data.Bar += (uint)(uint.Parse(bar) - 1);
340
                            data.Channel = patternData.Channel;
341
342
                            retList.Add(data);
343
                        }
344
                    }
345
346
                    lexResultList.Clear();
347
                    return retList;
348
*/                    
349
                }
308
                }
350
                else
309
                else
351
                {
310
                {
...
...
353
//                    return null;
312
//                    return null;
354
                }
313
                }
355
            }
314
            }
356
315
            
357
            return result;
316
            return result;
358
            /*
359
            if (result == null)
360
            {
361
                throw new MiParseException();
362
//                return null;
363
            }
364
            else
365
            {
366
                retList = result.getMidiData();
367
368
                lexResultList.Clear();
369
                return retList;
370
            }
371
            */
372
        }
317
        }
373
318
374
        private void Pattern1(string bar, string pos, MiOpe result)
319
        private void Pattern1(string bar, string pos, MiOpe result)
...
...
401
            nextPos = tmpNextPos % (MidiInfo.DIVISION * 4);
346
            nextPos = tmpNextPos % (MidiInfo.DIVISION * 4);
402
        }
347
        }
403
348
404
        private Object AAAA(string bar, string pos, string className)
349
        private MiOpe getMiOpe(string bar, string pos, string className)
405
        {
350
        {
406
            Type classType = Type.GetType("mi.mi."+className);
351
            Type classType = Type.GetType("mi.mi."+className);
407
            if (classType == null)
352
            if (classType == null)
...
...
413
                    return null;
358
                    return null;
414
                }
359
                }
415
            }
360
            }
416
            object abc = classType.InvokeMember(null, BindingFlags.CreateInstance, null, null, null);
361
            MiOpe retMiOpe = (MiOpe)classType.InvokeMember(null, BindingFlags.CreateInstance, null, null, null);
362
363
            // bar
417
            Object[] barArgs = { "bar", bar };
364
            Object[] barArgs = { "bar", bar };
418
            classType.InvokeMember("Add", BindingFlags.InvokeMethod, null, abc, barArgs);
365
            classType.InvokeMember("Add", BindingFlags.InvokeMethod, null, retMiOpe, barArgs);
419
366
367
            // pos
420
            Object[] posArgs = { "pos", pos };
368
            Object[] posArgs = { "pos", pos };
421
            classType.InvokeMember("Add", BindingFlags.InvokeMethod, null, abc, posArgs);
369
            classType.InvokeMember("Add", BindingFlags.InvokeMethod, null, retMiOpe, posArgs);
422
370
423
            Object[] args = new Object[2];
371
            Object[] args = new Object[2];
424
            for (int i = 0; i < lexResultList.Count; i += 2)
372
            for (int i = 0; i < lexResultList.Count; i += 2)
425
            {
373
            {
426
                args[0] = lexResultList[i];
374
                args[0] = lexResultList[i];
427
                args[1] = lexResultList[i + 1];
375
                args[1] = lexResultList[i + 1];
428
                classType.InvokeMember("Add", BindingFlags.InvokeMethod, null, abc, args);
376
                classType.InvokeMember("Add", BindingFlags.InvokeMethod, null, retMiOpe, args);
429
            }
377
            }
430
378
431
            uint numBar = uint.Parse(bar);
379
            uint numBar = uint.Parse(bar);
...
...
434
            prevPos = numPos;
382
            prevPos = numPos;
435
383
436
            PropertyInfo tmp = classType.GetProperty("Len");
384
            PropertyInfo tmp = classType.GetProperty("Len");
385
            uint tmpLne = (uint)tmp.GetValue(retMiOpe, null);
437
386
438
            if (tmp != null)
387
            if (tmpLne != 0)
439
            {
388
            {
440
                //                uint tmpNextPos = numPos + result.Len;
441
                uint tmpNextPos = numPos;
389
                uint tmpNextPos = numPos;
442
                nextBar = numBar + tmpNextPos / (MidiInfo.DIVISION * 4);
390
                nextBar = numBar + tmpNextPos / (MidiInfo.DIVISION * 4);
443
                nextPos = tmpNextPos % (MidiInfo.DIVISION * 4);
391
                nextPos = tmpNextPos % (MidiInfo.DIVISION * 4);
444
            }
392
            }
445
393
446
            return abc;
394
            return (MiOpe)retMiOpe;
447
        }
395
        }
448
396
449
        private MiOpe ParsePattern(string bar, string pos)
397
        private MiOpe ParsePattern(string bar, string pos)