MIDITrail をピカピカにする。鍵盤方向自動切替・多ポート・歌詞対応等
Revision | af7bd5cff0f1650d554e7a3a76fb59df01af975a (tree) |
---|---|
Time | 2018-04-11 12:33:00 |
Author | yoshy <yoshy@user...> |
Commiter | yoshy |
[UPGRADE] original 1.2.3
@@ -1,5 +1,5 @@ | ||
1 | 1 | |
2 | -Copyright (c) 2010-2016, WADA Masashi <yknk@users.osdn.me> | |
2 | +Copyright (c) 2010-2017, WADA Masashi <yknk@users.osdn.me> | |
3 | 3 | All rights reserved. |
4 | 4 | |
5 | 5 | Redistribution and use in source and binary forms, with or without |
@@ -4,7 +4,7 @@ | ||
4 | 4 | // |
5 | 5 | // MIDITrail バージョン定義 |
6 | 6 | // |
7 | -// Copyright (C) 2014-2016 WADA Masashi. All Rights Reserved. | |
7 | +// Copyright (C) 2014-2017 WADA Masashi. All Rights Reserved. | |
8 | 8 | // |
9 | 9 | //****************************************************************************** |
10 | 10 |
@@ -16,10 +16,10 @@ | ||
16 | 16 | //****************************************************************************** |
17 | 17 | |
18 | 18 | //バージョン文字列 |
19 | -#define MIDITRAIL_VERSION_STRING_X86 _T("Version 1.2.2 (32bit)") | |
20 | -#define MIDITRAIL_VERSION_STRING_X64 _T("Version 1.2.2 (64bit)") | |
19 | +#define MIDITRAIL_VERSION_STRING_X86 _T("Version 1.2.3 (32bit)") | |
20 | +#define MIDITRAIL_VERSION_STRING_X64 _T("Version 1.2.3 (64bit)") | |
21 | 21 | |
22 | 22 | //コピーライト |
23 | -#define MIDITRAIL_COPYRIGHT _T("Copyright (C) 2010-2016 WADA Masashi"); | |
23 | +#define MIDITRAIL_COPYRIGHT _T("Copyright (C) 2010-2017 WADA Masashi"); | |
24 | 24 | |
25 | 25 |
@@ -4,7 +4,7 @@ | ||
4 | 4 | // |
5 | 5 | // ノートボックス描画クラス |
6 | 6 | // |
7 | -// Copyright (C) 2010-2012 WADA Masashi. All Rights Reserved. | |
7 | +// Copyright (C) 2010-2017 WADA Masashi. All Rights Reserved. | |
8 | 8 | // |
9 | 9 | //****************************************************************************** |
10 | 10 |
@@ -447,15 +447,11 @@ int MTNoteBox::_UpdateVertexOfActiveNotes( | ||
447 | 447 | ); |
448 | 448 | if (result != 0) goto EXIT; |
449 | 449 | |
450 | - //発音中ノートがピッチベンドで移動する場合 | |
451 | 450 | //発音終了までオリジナルのノートを非表示にする |
452 | 451 | if (!(m_pNoteStatus[i].isHide)) { |
453 | - if ((m_pNotePitchBend->GetValue(note.portNo, note.chNo) != 0) | |
454 | - && (m_pNotePitchBend->GetSensitivity(note.portNo, note.chNo) != 0)) { | |
455 | - result = _HideNoteBox(m_pNoteStatus[i].index); | |
456 | - if (result != 0) goto EXIT; | |
457 | - m_pNoteStatus[i].isHide = true; | |
458 | - } | |
452 | + result = _HideNoteBox(m_pNoteStatus[i].index); | |
453 | + if (result != 0) goto EXIT; | |
454 | + m_pNoteStatus[i].isHide = true; | |
459 | 455 | } |
460 | 456 | |
461 | 457 | activeNoteNum++; |
@@ -553,30 +549,62 @@ int MTNoteBox::_CreateVertexOfNote( | ||
553 | 549 | // |
554 | 550 | |
555 | 551 | //ノートボックス頂点座標取得 |
556 | - m_NoteDesign.GetNoteBoxVirtexPos( | |
557 | - note.startTime, | |
558 | - note.portNo, | |
559 | - note.chNo, | |
560 | - note.noteNo, | |
561 | - &vectorStartLU, | |
562 | - &vectorStartRU, | |
563 | - &vectorStartLD, | |
564 | - &vectorStartRD, | |
565 | - pitchBendValue, | |
566 | - pitchBendSensitivity | |
567 | - ); | |
568 | - m_NoteDesign.GetNoteBoxVirtexPos( | |
569 | - note.endTime, | |
570 | - note.portNo, | |
571 | - note.chNo, | |
572 | - note.noteNo, | |
573 | - &vectorEndLU, | |
574 | - &vectorEndRU, | |
575 | - &vectorEndLD, | |
576 | - &vectorEndRD, | |
577 | - pitchBendValue, | |
578 | - pitchBendSensitivity | |
579 | - ); | |
552 | + if (elapsedTime == 0xFFFFFFFF) { | |
553 | + //通常ノートの場合 | |
554 | + m_NoteDesign.GetNoteBoxVirtexPos( | |
555 | + note.startTime, | |
556 | + note.portNo, | |
557 | + note.chNo, | |
558 | + note.noteNo, | |
559 | + &vectorStartLU, | |
560 | + &vectorStartRU, | |
561 | + &vectorStartLD, | |
562 | + &vectorStartRD, | |
563 | + pitchBendValue, | |
564 | + pitchBendSensitivity | |
565 | + ); | |
566 | + m_NoteDesign.GetNoteBoxVirtexPos( | |
567 | + note.endTime, | |
568 | + note.portNo, | |
569 | + note.chNo, | |
570 | + note.noteNo, | |
571 | + &vectorEndLU, | |
572 | + &vectorEndRU, | |
573 | + &vectorEndLD, | |
574 | + &vectorEndRD, | |
575 | + pitchBendValue, | |
576 | + pitchBendSensitivity | |
577 | + ); | |
578 | + } | |
579 | + else { | |
580 | + //発音中ノートの場合:経過時間でサイズが変化する | |
581 | + m_NoteDesign.GetActiveNoteBoxVirtexPos( | |
582 | + note.startTime, | |
583 | + note.portNo, | |
584 | + note.chNo, | |
585 | + note.noteNo, | |
586 | + &vectorStartLU, | |
587 | + &vectorStartRU, | |
588 | + &vectorStartLD, | |
589 | + &vectorStartRD, | |
590 | + pitchBendValue, | |
591 | + pitchBendSensitivity, | |
592 | + elapsedTime | |
593 | + ); | |
594 | + m_NoteDesign.GetActiveNoteBoxVirtexPos( | |
595 | + note.endTime, | |
596 | + note.portNo, | |
597 | + note.chNo, | |
598 | + note.noteNo, | |
599 | + &vectorEndLU, | |
600 | + &vectorEndRU, | |
601 | + &vectorEndLD, | |
602 | + &vectorEndRD, | |
603 | + pitchBendValue, | |
604 | + pitchBendSensitivity, | |
605 | + elapsedTime | |
606 | + ); | |
607 | + } | |
580 | 608 | |
581 | 609 | //頂点座標・・・法線が異なるので頂点を8個に集約できない |
582 | 610 | //上の面 |
@@ -4,7 +4,7 @@ | ||
4 | 4 | // |
5 | 5 | // ノートデザインクラス |
6 | 6 | // |
7 | -// Copyright (C) 2010-2013 WADA Masashi. All Rights Reserved. | |
7 | +// Copyright (C) 2010-2017 WADA Masashi. All Rights Reserved. | |
8 | 8 | // |
9 | 9 | //****************************************************************************** |
10 | 10 |
@@ -213,6 +213,42 @@ void MTNoteDesign::GetNoteBoxVirtexPos( | ||
213 | 213 | } |
214 | 214 | |
215 | 215 | //****************************************************************************** |
216 | +// 発音中ノートボックス頂点座標取得 | |
217 | +//****************************************************************************** | |
218 | +void MTNoteDesign::GetActiveNoteBoxVirtexPos( | |
219 | + unsigned long curTickTime, | |
220 | + unsigned char portNo, | |
221 | + unsigned char chNo, | |
222 | + unsigned char noteNo, | |
223 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
224 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
225 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
226 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
227 | + short pitchBendValue, //省略可:ピッチベンド | |
228 | + unsigned char pitchBendSensitivity, //省略可:ピッチベンド感度 | |
229 | + unsigned long elapsedTime //省略可:経過時間(ミリ秒) | |
230 | + ) | |
231 | +{ | |
232 | + D3DXVECTOR3 center; | |
233 | + float bh, bw = 0.0f; | |
234 | + float curSizeRatio = 1.0f; | |
235 | + | |
236 | + center = GetNoteBoxCenterPosX(curTickTime, portNo, chNo, noteNo, pitchBendValue, pitchBendSensitivity); | |
237 | + | |
238 | + if (elapsedTime < (unsigned long)m_ActiveNoteDuration) { | |
239 | + curSizeRatio = 1.0f + (m_ActiveNoteBoxSizeRatio - 1.0f) * (1.0f - (float)elapsedTime / (float)m_ActiveNoteDuration); | |
240 | + } | |
241 | + | |
242 | + bh = GetNoteBoxHeight() * curSizeRatio; | |
243 | + bw = GetNoteBoxWidht() * curSizeRatio; | |
244 | + | |
245 | + *pVector0 = D3DXVECTOR3(center.x, center.y+(bh/2.0f), center.z+(bw/2.0f)); | |
246 | + *pVector1 = D3DXVECTOR3(center.x, center.y+(bh/2.0f), center.z-(bw/2.0f)); | |
247 | + *pVector2 = D3DXVECTOR3(center.x, center.y-(bh/2.0f), center.z+(bw/2.0f)); | |
248 | + *pVector3 = D3DXVECTOR3(center.x, center.y-(bh/2.0f), center.z-(bw/2.0f)); | |
249 | +} | |
250 | + | |
251 | +//****************************************************************************** | |
216 | 252 | // ライブモニタ用ノートボックス頂点座標取得 |
217 | 253 | //****************************************************************************** |
218 | 254 | void MTNoteDesign::GetNoteBoxVirtexPosLive( |
@@ -608,6 +644,7 @@ void MTNoteDesign::_Clear(void) | ||
608 | 644 | |
609 | 645 | m_ActiveNoteDuration = 400; |
610 | 646 | m_ActiveNoteWhiteRate = 1.0f; |
647 | + m_ActiveNoteBoxSizeRatio = 1.0f; | |
611 | 648 | m_RippleDuration = 1600; |
612 | 649 | } |
613 | 650 |
@@ -717,6 +754,10 @@ int MTNoteDesign::_LoadConfFile( | ||
717 | 754 | if (result != 0) goto EXIT; |
718 | 755 | m_ActiveNoteEmissive = DXColorUtil::MakeColorFromHexRGBA(hexColor); |
719 | 756 | |
757 | + //発音中ノート情報:ボックスサイズ比率 | |
758 | + result = confFile.GetFloat(_T("SizeRatio"), &m_ActiveNoteBoxSizeRatio, 1.4f); | |
759 | + if (result != 0) goto EXIT; | |
760 | + | |
720 | 761 | //---------------------------------- |
721 | 762 | //波紋情報 |
722 | 763 | //---------------------------------- |
@@ -4,7 +4,7 @@ | ||
4 | 4 | // |
5 | 5 | // ノートデザインクラス |
6 | 6 | // |
7 | -// Copyright (C) 2010-2013 WADA Masashi. All Rights Reserved. | |
7 | +// Copyright (C) 2010-2017 WADA Masashi. All Rights Reserved. | |
8 | 8 | // |
9 | 9 | //****************************************************************************** |
10 | 10 |
@@ -91,6 +91,21 @@ public: | ||
91 | 91 | unsigned char pitchBendSensitivity = 0 //省略可:ピッチベンド感度 |
92 | 92 | ); |
93 | 93 | |
94 | + //発音中ノートボックス頂点座標取得 | |
95 | + void GetActiveNoteBoxVirtexPos( | |
96 | + unsigned long curTickTime, | |
97 | + unsigned char portNo, | |
98 | + unsigned char chNo, | |
99 | + unsigned char noteNo, | |
100 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
101 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
102 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
103 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
104 | + short pitchBendValue = 0, //省略可:ピッチベンド | |
105 | + unsigned char pitchBendSensitivity = 0, //省略可:ピッチベンド感度 | |
106 | + unsigned long elapsedTime = 0 //省略可:経過時間(ミリ秒) | |
107 | + ); | |
108 | + | |
94 | 109 | //ライブモニタ用ノートボックス頂点座標取得 |
95 | 110 | void GetNoteBoxVirtexPosLive( |
96 | 111 | unsigned long elapsedTime, //経過時間(ミリ秒) |
@@ -201,6 +216,7 @@ private: | ||
201 | 216 | |
202 | 217 | int m_ActiveNoteDuration; |
203 | 218 | float m_ActiveNoteWhiteRate; |
219 | + float m_ActiveNoteBoxSizeRatio; | |
204 | 220 | |
205 | 221 | int m_RippleDuration; |
206 | 222 |
@@ -4,7 +4,7 @@ | ||
4 | 4 | // |
5 | 5 | // ノート波紋描画クラス |
6 | 6 | // |
7 | -// Copyright (C) 2010-2012 WADA Masashi. All Rights Reserved. | |
7 | +// Copyright (C) 2010-2017 WADA Masashi. All Rights Reserved. | |
8 | 8 | // |
9 | 9 | //****************************************************************************** |
10 | 10 |
@@ -456,7 +456,7 @@ int MTNoteRipple::_SetVertexPosition( | ||
456 | 456 | |
457 | 457 | //法線 |
458 | 458 | for (i = 0; i < 6; i++) { |
459 | - pVertex[i].n = D3DXVECTOR3(-1.0f, 0.0f, 0.0f); | |
459 | + pVertex[i].n = D3DXVECTOR3(0.0f, 0.0f, -1.0f); | |
460 | 460 | } |
461 | 461 | |
462 | 462 | //透明度を徐々に落とす |
@@ -1,8 +1,8 @@ | ||
1 | 1 | ****************************************************************************** |
2 | 2 | |
3 | - MIDITrail source code Ver.1.2.2 for Windows | |
3 | + MIDITrail source code Ver.1.2.3 for Windows | |
4 | 4 | |
5 | - Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved. | |
5 | + Copyright (C) 2010-2017 WADA Masashi. All Rights Reserved. | |
6 | 6 | |
7 | 7 | Web : https://osdn.jp/projects/miditrail/ |
8 | 8 | Mail: yknk@users.osdn.me |
@@ -1,8 +1,8 @@ | ||
1 | 1 | ****************************************************************************** |
2 | 2 | |
3 | - MIDITrail ソースコード Ver.1.2.2 for Windows | |
3 | + MIDITrail ソースコード Ver.1.2.3 for Windows | |
4 | 4 | |
5 | - Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved. | |
5 | + Copyright (C) 2010-2017 WADA Masashi. All Rights Reserved. | |
6 | 6 | |
7 | 7 | Web : https://osdn.jp/projects/miditrail/ |
8 | 8 | Mail: yknk@users.osdn.me |