MIDITrail をピカピカにする。鍵盤方向自動切替・多ポート・歌詞対応等
Revision | 91f1bf052fc6dbd7f24f89fb94b73ed0e1ae55af (tree) |
---|---|
Time | 2018-04-11 18:42:06 |
Author | yoshy <yoshy@user...> |
Commiter | yoshy |
[UPDATE] 1.2.3をマージ
# Conflicts:
# MIDITrail/MIDITrailVersion.h
@@ -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 |
@@ -309,9 +309,9 @@ END | ||
309 | 309 | |
310 | 310 | STRINGTABLE |
311 | 311 | BEGIN |
312 | -// >>> modify 20161223 yossiepon begin | |
313 | - IDS_APP_TITLE "MIDITrail 1.2.2 mod. yossiepon_20161223" | |
314 | -// <<< modify 20161223 yossiepon end | |
312 | +// >>> modify 20180404 yossiepon begin | |
313 | + IDS_APP_TITLE "MIDITrail 1.2.3 mod. yossiepon_20180404" | |
314 | +// <<< modify 20180404 yossiepon end | |
315 | 315 | IDC_MIDITRAIL "MIDITRAIL" |
316 | 316 | END |
317 | 317 |
@@ -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("1.2.2 (x86), mod. yossiepon_20161223") | |
20 | -#define MIDITRAIL_VERSION_STRING_X64 _T("1.2.2 (x64), mod. yossiepon_20161223") | |
19 | +#define MIDITRAIL_VERSION_STRING_X86 _T("1.2.3 (x86), mod. yossiepon_20180404") | |
20 | +#define MIDITRAIL_VERSION_STRING_X64 _T("1.2.3 (x64), mod. yossiepon_20180404") | |
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++; |
@@ -557,30 +553,62 @@ int MTNoteBox::_CreateVertexOfNote( | ||
557 | 553 | // |
558 | 554 | |
559 | 555 | //ノートボックス頂点座標取得 |
560 | - m_NoteDesign.GetNoteBoxVirtexPos( | |
561 | - note.startTime, | |
562 | - note.portNo, | |
563 | - note.chNo, | |
564 | - note.noteNo, | |
565 | - &vectorStartLU, | |
566 | - &vectorStartRU, | |
567 | - &vectorStartLD, | |
568 | - &vectorStartRD, | |
569 | - pitchBendValue, | |
570 | - pitchBendSensitivity | |
571 | - ); | |
572 | - m_NoteDesign.GetNoteBoxVirtexPos( | |
573 | - note.endTime, | |
574 | - note.portNo, | |
575 | - note.chNo, | |
576 | - note.noteNo, | |
577 | - &vectorEndLU, | |
578 | - &vectorEndRU, | |
579 | - &vectorEndLD, | |
580 | - &vectorEndRD, | |
581 | - pitchBendValue, | |
582 | - pitchBendSensitivity | |
583 | - ); | |
556 | + if (elapsedTime == 0xFFFFFFFF) { | |
557 | + //通常ノートの場合 | |
558 | + m_NoteDesign.GetNoteBoxVirtexPos( | |
559 | + note.startTime, | |
560 | + note.portNo, | |
561 | + note.chNo, | |
562 | + note.noteNo, | |
563 | + &vectorStartLU, | |
564 | + &vectorStartRU, | |
565 | + &vectorStartLD, | |
566 | + &vectorStartRD, | |
567 | + pitchBendValue, | |
568 | + pitchBendSensitivity | |
569 | + ); | |
570 | + m_NoteDesign.GetNoteBoxVirtexPos( | |
571 | + note.endTime, | |
572 | + note.portNo, | |
573 | + note.chNo, | |
574 | + note.noteNo, | |
575 | + &vectorEndLU, | |
576 | + &vectorEndRU, | |
577 | + &vectorEndLD, | |
578 | + &vectorEndRD, | |
579 | + pitchBendValue, | |
580 | + pitchBendSensitivity | |
581 | + ); | |
582 | + } | |
583 | + else { | |
584 | + //発音中ノートの場合:経過時間でサイズが変化する | |
585 | + m_NoteDesign.GetActiveNoteBoxVirtexPos( | |
586 | + note.startTime, | |
587 | + note.portNo, | |
588 | + note.chNo, | |
589 | + note.noteNo, | |
590 | + &vectorStartLU, | |
591 | + &vectorStartRU, | |
592 | + &vectorStartLD, | |
593 | + &vectorStartRD, | |
594 | + pitchBendValue, | |
595 | + pitchBendSensitivity, | |
596 | + elapsedTime | |
597 | + ); | |
598 | + m_NoteDesign.GetActiveNoteBoxVirtexPos( | |
599 | + note.endTime, | |
600 | + note.portNo, | |
601 | + note.chNo, | |
602 | + note.noteNo, | |
603 | + &vectorEndLU, | |
604 | + &vectorEndRU, | |
605 | + &vectorEndLD, | |
606 | + &vectorEndRD, | |
607 | + pitchBendValue, | |
608 | + pitchBendSensitivity, | |
609 | + elapsedTime | |
610 | + ); | |
611 | + } | |
584 | 612 | |
585 | 613 | //頂点座標・・・法線が異なるので頂点を8個に集約できない |
586 | 614 | //上の面 |
@@ -360,7 +360,7 @@ int MTNoteBoxMod::_UpdateVertexOfActiveNotes( | ||
360 | 360 | &(pVertex[NOTE_VERTEX_NUM * activeNoteNum]),//頂点バッファ書き込み位置 |
361 | 361 | NOTE_VERTEX_NUM * activeNoteNum, //頂点バッファインデックスオフセット |
362 | 362 | &(pIndex[NOTE_INDEX_NUM * activeNoteNum]), //インデックスバッファ書き込み位置 |
363 | - m_pNoteStatusMod[i].keyDownRate, //ノート状態 | |
363 | + m_pNoteStatusMod[i].keyDownRate, //キー押し下げ率 | |
364 | 364 | true //ピッチベンド適用 |
365 | 365 | ); |
366 | 366 | if (result != 0) goto EXIT; |
@@ -415,20 +415,161 @@ int MTNoteBoxMod::_CreateVertexOfNote( | ||
415 | 415 | bool isEnablePitchBend |
416 | 416 | ) |
417 | 417 | { |
418 | + int result = 0; | |
418 | 419 | unsigned long i; |
420 | + D3DXVECTOR3 vectorStartLU; | |
421 | + D3DXVECTOR3 vectorStartRU; | |
422 | + D3DXVECTOR3 vectorStartLD; | |
423 | + D3DXVECTOR3 vectorStartRD; | |
424 | + D3DXVECTOR3 vectorEndLU; | |
425 | + D3DXVECTOR3 vectorEndRU; | |
426 | + D3DXVECTOR3 vectorEndLD; | |
427 | + D3DXVECTOR3 vectorEndRD; | |
419 | 428 | D3DXCOLOR color; |
429 | + short pitchBendValue = 0; | |
430 | + unsigned char pitchBendSensitivity = SM_DEFAULT_PITCHBEND_SENSITIVITY; | |
431 | + | |
432 | + if (isEnablePitchBend) { | |
433 | + pitchBendValue = m_pNotePitchBend->GetValue(note.portNo, note.chNo); | |
434 | + pitchBendSensitivity = m_pNotePitchBend->GetSensitivity(note.portNo, note.chNo); | |
435 | + } | |
436 | + | |
437 | + // + 1+----+3 + | |
438 | + // /| / 上 / /| y x | |
439 | + // + | 0+----+2 + |右 |/ | |
440 | + // 左| + 7+----+5 | + z--+0 | |
441 | + // |/ / 下 / |/ | |
442 | + // + 6+----+4 + ← 4 が原点(0,0,0) | |
443 | + // | |
420 | 444 | |
421 | - // 基底クラスの頂点生成処理の呼び出し | |
422 | - MTNoteBox::_CreateVertexOfNote(note, pVertex, vertexOffset, pIndex, -1, isEnablePitchBend); | |
445 | + //ノートボックス頂点座標取得 | |
446 | + if (keyDownRate == 0.0f) { | |
447 | + //通常ノートの場合 | |
448 | + m_NoteDesignMod.GetNoteBoxVirtexPos( | |
449 | + note.startTime, | |
450 | + note.portNo, | |
451 | + note.chNo, | |
452 | + note.noteNo, | |
453 | + &vectorStartLU, | |
454 | + &vectorStartRU, | |
455 | + &vectorStartLD, | |
456 | + &vectorStartRD, | |
457 | + pitchBendValue, | |
458 | + pitchBendSensitivity | |
459 | + ); | |
460 | + m_NoteDesignMod.GetNoteBoxVirtexPos( | |
461 | + note.endTime, | |
462 | + note.portNo, | |
463 | + note.chNo, | |
464 | + note.noteNo, | |
465 | + &vectorEndLU, | |
466 | + &vectorEndRU, | |
467 | + &vectorEndLD, | |
468 | + &vectorEndRD, | |
469 | + pitchBendValue, | |
470 | + pitchBendSensitivity | |
471 | + ); | |
472 | + } | |
473 | + else { | |
474 | + //発音中ノートの場合:キー押し下げ率でサイズが変化する | |
475 | + m_NoteDesignMod.GetActiveNoteBoxVirtexPos( | |
476 | + note.startTime, | |
477 | + note.portNo, | |
478 | + note.chNo, | |
479 | + note.noteNo, | |
480 | + &vectorStartLU, | |
481 | + &vectorStartRU, | |
482 | + &vectorStartLD, | |
483 | + &vectorStartRD, | |
484 | + pitchBendValue, | |
485 | + pitchBendSensitivity, | |
486 | + keyDownRate | |
487 | + ); | |
488 | + m_NoteDesignMod.GetActiveNoteBoxVirtexPos( | |
489 | + note.endTime, | |
490 | + note.portNo, | |
491 | + note.chNo, | |
492 | + note.noteNo, | |
493 | + &vectorEndLU, | |
494 | + &vectorEndRU, | |
495 | + &vectorEndLD, | |
496 | + &vectorEndRD, | |
497 | + pitchBendValue, | |
498 | + pitchBendSensitivity, | |
499 | + keyDownRate | |
500 | + ); | |
501 | + } | |
423 | 502 | |
424 | - //基底クラスの設定色を上書きする | |
503 | + //頂点座標・・・法線が異なるので頂点を8個に集約できない | |
504 | + //上の面 | |
505 | + pVertex[0].p = vectorStartLU; | |
506 | + pVertex[1].p = vectorEndLU; | |
507 | + pVertex[2].p = vectorStartRU; | |
508 | + pVertex[3].p = vectorEndRU; | |
509 | + //下の面 | |
510 | + pVertex[4].p = vectorStartRD; | |
511 | + pVertex[5].p = vectorEndRD; | |
512 | + pVertex[6].p = vectorStartLD; | |
513 | + pVertex[7].p = vectorEndLD; | |
514 | + //右の面 | |
515 | + pVertex[8].p = pVertex[2].p; | |
516 | + pVertex[9].p = pVertex[3].p; | |
517 | + pVertex[10].p = pVertex[4].p; | |
518 | + pVertex[11].p = pVertex[5].p; | |
519 | + //左の面 | |
520 | + pVertex[12].p = pVertex[6].p; | |
521 | + pVertex[13].p = pVertex[7].p; | |
522 | + pVertex[14].p = pVertex[0].p; | |
523 | + pVertex[15].p = pVertex[1].p; | |
524 | + //前の面 | |
525 | + pVertex[16].p = pVertex[0].p; | |
526 | + pVertex[17].p = pVertex[2].p; | |
527 | + pVertex[18].p = pVertex[6].p; | |
528 | + pVertex[19].p = pVertex[4].p; | |
529 | + //後の面 | |
530 | + pVertex[20].p = pVertex[3].p; | |
531 | + pVertex[21].p = pVertex[1].p; | |
532 | + pVertex[22].p = pVertex[5].p; | |
533 | + pVertex[23].p = pVertex[7].p; | |
534 | + | |
535 | + //法線 | |
536 | + //上の面 | |
537 | + pVertex[0].n = D3DXVECTOR3( 0.0f, 1.0f, 0.0f); | |
538 | + pVertex[1].n = D3DXVECTOR3( 0.0f, 1.0f, 0.0f); | |
539 | + pVertex[2].n = D3DXVECTOR3( 0.0f, 1.0f, 0.0f); | |
540 | + pVertex[3].n = D3DXVECTOR3( 0.0f, 1.0f, 0.0f); | |
541 | + //下の面 | |
542 | + pVertex[4].n = D3DXVECTOR3( 0.0f,-1.0f, 0.0f); | |
543 | + pVertex[5].n = D3DXVECTOR3( 0.0f,-1.0f, 0.0f); | |
544 | + pVertex[6].n = D3DXVECTOR3( 0.0f,-1.0f, 0.0f); | |
545 | + pVertex[7].n = D3DXVECTOR3( 0.0f,-1.0f, 0.0f); | |
546 | + //右の面 | |
547 | + pVertex[8].n = D3DXVECTOR3( 0.0f, 0.0f,-1.0f); | |
548 | + pVertex[9].n = D3DXVECTOR3( 0.0f, 0.0f,-1.0f); | |
549 | + pVertex[10].n = D3DXVECTOR3( 0.0f, 0.0f,-1.0f); | |
550 | + pVertex[11].n = D3DXVECTOR3( 0.0f, 0.0f,-1.0f); | |
551 | + //左の面 | |
552 | + pVertex[12].n = D3DXVECTOR3( 0.0f, 0.0f, 1.0f); | |
553 | + pVertex[13].n = D3DXVECTOR3( 0.0f, 0.0f, 1.0f); | |
554 | + pVertex[14].n = D3DXVECTOR3( 0.0f, 0.0f, 1.0f); | |
555 | + pVertex[15].n = D3DXVECTOR3( 0.0f, 0.0f, 1.0f); | |
556 | + //前の面 | |
557 | + pVertex[16].n = D3DXVECTOR3(-1.0f, 0.0f, 0.0f); | |
558 | + pVertex[17].n = D3DXVECTOR3(-1.0f, 0.0f, 0.0f); | |
559 | + pVertex[18].n = D3DXVECTOR3(-1.0f, 0.0f, 0.0f); | |
560 | + pVertex[19].n = D3DXVECTOR3(-1.0f, 0.0f, 0.0f); | |
561 | + //後の面 | |
562 | + pVertex[20].n = D3DXVECTOR3( 1.0f, 0.0f, 0.0f); | |
563 | + pVertex[21].n = D3DXVECTOR3( 1.0f, 0.0f, 0.0f); | |
564 | + pVertex[22].n = D3DXVECTOR3( 1.0f, 0.0f, 0.0f); | |
565 | + pVertex[23].n = D3DXVECTOR3( 1.0f, 0.0f, 0.0f); | |
425 | 566 | |
426 | 567 | //各頂点のディフューズ色 |
427 | 568 | if (keyDownRate == 0.0f) { |
428 | - color = m_NoteDesign.GetNoteBoxColor(note.portNo, note.chNo, note.noteNo); | |
569 | + color = m_NoteDesignMod.GetNoteBoxColor(note.portNo, note.chNo, note.noteNo); | |
429 | 570 | } |
430 | 571 | else { |
431 | - //発音中は発音開始からの経過時間によって色が変化する | |
572 | + //発音中はキー押し下げ率によって色が変化する | |
432 | 573 | color = m_NoteDesignMod.GetActiveNoteBoxColor(note.portNo, note.chNo, note.noteNo, keyDownRate); |
433 | 574 | } |
434 | 575 |
@@ -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 |
@@ -93,6 +93,21 @@ public: | ||
93 | 93 | unsigned char pitchBendSensitivity = 0 //省略可:ピッチベンド感度 |
94 | 94 | ); |
95 | 95 | |
96 | + //発音中ノートボックス頂点座標取得 | |
97 | + void GetActiveNoteBoxVirtexPos( | |
98 | + unsigned long curTickTime, | |
99 | + unsigned char portNo, | |
100 | + unsigned char chNo, | |
101 | + unsigned char noteNo, | |
102 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
103 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
104 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
105 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
106 | + short pitchBendValue = 0, //省略可:ピッチベンド | |
107 | + unsigned char pitchBendSensitivity = 0, //省略可:ピッチベンド感度 | |
108 | + unsigned long elapsedTime = 0 //省略可:経過時間(ミリ秒) | |
109 | + ); | |
110 | + | |
96 | 111 | //ライブモニタ用ノートボックス頂点座標取得 |
97 | 112 | void GetNoteBoxVirtexPosLive( |
98 | 113 | unsigned long elapsedTime, //経過時間(ミリ秒) |
@@ -146,9 +161,7 @@ public: | ||
146 | 161 | |
147 | 162 | //ポート原点座標取得 |
148 | 163 | float GetPortOriginY(unsigned char portNo); |
149 | -// >>> modify 20120728 yossiepon begin | |
150 | - virtual float GetPortOriginZ(unsigned char portNo); | |
151 | -// <<< modify 20120728 yossiepon end | |
164 | + float GetPortOriginZ(unsigned char portNo); | |
152 | 165 | |
153 | 166 | //世界座標配置移動ベクトル取得 |
154 | 167 | D3DXVECTOR3 GetWorldMoveVector(); |
@@ -229,6 +242,7 @@ protected: | ||
229 | 242 | // <<< modify 20161224 yossiepon end |
230 | 243 | |
231 | 244 | float m_ActiveNoteWhiteRate; |
245 | + float m_ActiveNoteBoxSizeRatio; | |
232 | 246 | |
233 | 247 | // >>> modify access level 20161224 yossiepon begin |
234 | 248 | private: |
@@ -116,15 +116,16 @@ float MTNoteDesignMod::GetRippleAlpha( | ||
116 | 116 | // 減衰係数取得 |
117 | 117 | //****************************************************************************** |
118 | 118 | float MTNoteDesignMod::GetDecayCoefficient( |
119 | - float rate //サイズ比率 | |
119 | + float rate, //サイズ比率 | |
120 | + float saturation //飽和レベル | |
120 | 121 | ) |
121 | 122 | { |
122 | 123 | float coeff = 1.0f; |
123 | 124 | |
124 | 125 | if(rate < 0.5f) { |
125 | - coeff = (pow(2.0f, (0.5f - rate) * 8.0f) + 14.0f) / 20.0f; | |
126 | + coeff = (pow(2.0f, (0.5f - rate) * 8.0f) + 14.0f) / saturation; | |
126 | 127 | } else { |
127 | - coeff = (16.0f - pow(2.0f, (rate - 0.5f) * 8.0f)) / 20.0f; | |
128 | + coeff = (16.0f - pow(2.0f, (rate - 0.5f) * 8.0f)) / saturation; | |
128 | 129 | } |
129 | 130 | |
130 | 131 | coeff = coeff > 1.0f ? 1.0f : coeff; |
@@ -133,35 +134,39 @@ float MTNoteDesignMod::GetDecayCoefficient( | ||
133 | 134 | } |
134 | 135 | |
135 | 136 | //****************************************************************************** |
136 | -// ポート原点Z座標取得 | |
137 | +// 発音中ノートボックス頂点座標取得 | |
137 | 138 | //****************************************************************************** |
138 | -float MTNoteDesignMod::GetPortOriginZ( | |
139 | - unsigned char portNo | |
139 | +void MTNoteDesignMod::GetActiveNoteBoxVirtexPos( | |
140 | + unsigned long curTickTime, | |
141 | + unsigned char portNo, | |
142 | + unsigned char chNo, | |
143 | + unsigned char noteNo, | |
144 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
145 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
146 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
147 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
148 | + short pitchBendValue, //省略可:ピッチベンド | |
149 | + unsigned char pitchBendSensitivity, //省略可:ピッチベンド感度 | |
150 | + float rate //省略可:サイズ比率 | |
140 | 151 | ) |
141 | 152 | { |
142 | - float portIndex = 0.0f; | |
143 | - float portWidth = 0.0f; | |
144 | - | |
145 | - // +y | |
146 | - // | | |
147 | - // portC portB portA | |
148 | - // +-------+-------+-------+Note#127 | |
149 | - // | | | | | | |
150 | - // | | | | | | |
151 | - // | | | | | | |
152 | - // +z<---|-------@---0---@-------@--------->-z | |
153 | - // | | | | | | |
154 | - // | | | | | @:OriginZ(for portA,B,C) | |
155 | - // | | | | | | |
156 | - // +-------+-------+-------+Note#0 | |
157 | - // Ch. 16 0 16 | 0 16 0 | |
158 | - // | | |
159 | - // -y | |
160 | - | |
161 | - portIndex = (float)(m_PortIndex[portNo]); | |
162 | - portWidth = GetChStep() * 15.0f; | |
163 | - | |
164 | - return ((portWidth * portIndex) - (portWidth * m_PortList.GetSize() / 2.0f)); | |
153 | + D3DXVECTOR3 center; | |
154 | + float bh, bw = 0.0f; | |
155 | + float curSizeRatio = 1.0f; | |
156 | + | |
157 | + center = GetNoteBoxCenterPosX(curTickTime, portNo, chNo, noteNo, pitchBendValue, pitchBendSensitivity); | |
158 | + | |
159 | + if (rate > 0.0f) { | |
160 | + curSizeRatio = 1.0f + (m_ActiveNoteBoxSizeRatio - 1.0f) * GetDecayCoefficient(rate, 30.0f); | |
161 | + } | |
162 | + | |
163 | + bh = GetNoteBoxHeight() * curSizeRatio; | |
164 | + bw = GetNoteBoxWidht() * curSizeRatio; | |
165 | + | |
166 | + *pVector0 = D3DXVECTOR3(center.x, center.y+(bh/2.0f), center.z+(bw/2.0f)); | |
167 | + *pVector1 = D3DXVECTOR3(center.x, center.y+(bh/2.0f), center.z-(bw/2.0f)); | |
168 | + *pVector2 = D3DXVECTOR3(center.x, center.y-(bh/2.0f), center.z+(bw/2.0f)); | |
169 | + *pVector3 = D3DXVECTOR3(center.x, center.y-(bh/2.0f), center.z-(bw/2.0f)); | |
165 | 170 | } |
166 | 171 | |
167 | 172 | //****************************************************************************** |
@@ -174,15 +179,7 @@ D3DXCOLOR MTNoteDesignMod::GetActiveNoteBoxColor( | ||
174 | 179 | float rate |
175 | 180 | ) |
176 | 181 | { |
177 | - float alpha = 1.0f; | |
178 | - | |
179 | - if(rate < 0.5f) { | |
180 | - alpha = (pow(2.0f, (0.5f - rate) * 8.0f) + 14.0f) / 20.0f; | |
181 | - } else { | |
182 | - alpha = (16.0f - pow(2.0f, (rate - 0.5f) * 8.0f)) / 20.0f; | |
183 | - } | |
184 | - | |
185 | - alpha = alpha > 1.0f ? 1.0f : alpha; | |
182 | + float alpha = GetDecayCoefficient(rate, 30.0f); | |
186 | 183 | |
187 | 184 | D3DXCOLOR color; |
188 | 185 | float r,g,b,a = 0.0f; |
@@ -37,10 +37,25 @@ public: | ||
37 | 37 | float GetRippleHeight(float rate); |
38 | 38 | float GetRippleWidth(float rate); |
39 | 39 | float GetRippleAlpha(float rate); |
40 | - float GetDecayCoefficient(float rate); | |
40 | + float GetDecayCoefficient( | |
41 | + float rate, //サイズ比率 | |
42 | + float saturation = 20.0f //飽和レベル | |
43 | + ); | |
41 | 44 | |
42 | - //ポート原点座標取得 | |
43 | - virtual float GetPortOriginZ(unsigned char portNo); | |
45 | + //発音中ノートボックス頂点座標取得 | |
46 | + void GetActiveNoteBoxVirtexPos( | |
47 | + unsigned long curTickTime, | |
48 | + unsigned char portNo, | |
49 | + unsigned char chNo, | |
50 | + unsigned char noteNo, | |
51 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
52 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
53 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
54 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
55 | + short pitchBendValue = 0, //省略可:ピッチベンド | |
56 | + unsigned char pitchBendSensitivity = 0, //省略可:ピッチベンド感度 | |
57 | + float rate = 0.0f //省略可:サイズ比率 | |
58 | + ); | |
44 | 59 | |
45 | 60 | //発音中ノートボックスカラー取得 |
46 | 61 | D3DXCOLOR GetActiveNoteBoxColor( |
@@ -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 |
@@ -460,7 +460,7 @@ int MTNoteRipple::_SetVertexPosition( | ||
460 | 460 | |
461 | 461 | //法線 |
462 | 462 | for (i = 0; i < 6; i++) { |
463 | - pVertex[i].n = D3DXVECTOR3(-1.0f, 0.0f, 0.0f); | |
463 | + pVertex[i].n = D3DXVECTOR3(0.0f, 0.0f, -1.0f); | |
464 | 464 | } |
465 | 465 | |
466 | 466 | //透明度を徐々に落とす |
@@ -558,7 +558,7 @@ int MTNoteRippleMod::_SetVertexPosition( | ||
558 | 558 | |
559 | 559 | //法線 |
560 | 560 | for (i = 0; i < 6; i++) { |
561 | - pVertex[i].n = D3DXVECTOR3(-1.0f, 0.0f, 0.0f); | |
561 | + pVertex[i].n = D3DXVECTOR3(0.0f, 0.0f, -1.0f); | |
562 | 562 | } |
563 | 563 | |
564 | 564 | //透明度を徐々に落とす |
@@ -58,6 +58,7 @@ BackGroundRGB=000000 | ||
58 | 58 | Duration=400 |
59 | 59 | WhiteRate=0.9 |
60 | 60 | EmissiveRGBA=1A1A1A1A |
61 | +SizeRatio=1.4 | |
61 | 62 | |
62 | 63 | [Ripple] |
63 | 64 | ;Duration=1600 |
@@ -58,6 +58,7 @@ BackGroundRGB=000000 | ||
58 | 58 | Duration=400 |
59 | 59 | WhiteRate=0.9 |
60 | 60 | EmissiveRGBA=1A1A1A1A |
61 | +SizeRatio=1.4 | |
61 | 62 | |
62 | 63 | [Ripple] |
63 | 64 | ;Duration=1600 |
@@ -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 |
@@ -0,0 +1,53 @@ | ||
1 | +ピカピカMIDITrail 鍵盤方向自動切替・多ポート・歌詞対応等 | |
2 | + | |
3 | +MIDITrail 1.2.3 mod. yossiepon_20180404 | |
4 | +mail: yoshy@users.sourceforge.jp | |
5 | + | |
6 | +改造点 20180404: | |
7 | +・1.2.3をマージ | |
8 | + | |
9 | +改造点 20170528: | |
10 | +・シーケンス中のテキスト取得時にRTRIMをかけるように修正 | |
11 | +・タイトルがない場合にファイル名を表示するように修正 | |
12 | + | |
13 | +改造点 20161223: | |
14 | +・1.2.2をベースに再マージ | |
15 | + | |
16 | +改造点 20140920: | |
17 | +・1.2.1bをベースに再マージ(とりあえず動く程度) | |
18 | +・x64版のバイナリを追加 | |
19 | + | |
20 | +改造点 20121229: | |
21 | +・PianoRoll3D: 逆方向にライトを追加しました | |
22 | + | |
23 | +改造点 20120728-30: | |
24 | +・改造箇所をなるべく別ソースに出すように作り直した | |
25 | +・[FIX] 鍵盤を進行方向から見た際に描画がおかしい問題を修正 | |
26 | +・[FIX] PianoRollRainが使えない不具合を修正 | |
27 | +・[NEW] ピアノロールの高低の向きに、鍵盤の向きを追従させるようにした | |
28 | + →高音部が左・下にある場合は進行方向、右・上にある場合は逆方向を向きます | |
29 | +・[NEW] PianoRoll3Dで多ポートMIDIの場合にポート毎に鍵盤を表示するようにした | |
30 | +・[NEW] Lyricsメタイベント(歌詞)が含まれる場合、表示するようにした | |
31 | + →ホイール回転に追従しないため、ピアノロールは縦向きにする必要があります | |
32 | +・[NEW] ファイルの追加読み込み機能を追加(メニューのFile>Add) | |
33 | + →主にポート・チャンネル単位での追加読み込みを想定しているため、次の機能と併用します | |
34 | + →ファイル名に「portX」が含まれる場合、Xをポート番号とみなす(a-Z:大小同一視) | |
35 | + →ファイル名に「chXX」が含まれる場合、XXをチャンネル番号とみなす(00-99:二桁必須) | |
36 | + ※エラーチェックがありませんので、ご注意ください | |
37 | + ※ファイル名の例:nit_of_nit_2pin_ch01.mid | |
38 | + ※ファイル名の例:真っ黒フランドール・S 修正版_17_Other 1b_portB_ch01.mid | |
39 | + | |
40 | +改造点 20120320-23: | |
41 | +・ピアノロールの高低を逆にし、鍵盤の向きを進行方向に変更 | |
42 | +・鍵盤を半透明にした際に他のオブジェクトが透けて見えるように修正 | |
43 | + ※描画順を変更したため、鍵盤を反対から見た際に不具合有り | |
44 | + (波紋のαが適用されない、TimeIndicatorをまたぐと鍵盤が見えない等) | |
45 | +・波紋が輝くように描画方法を変更(DSTにBLEND_ONEで3回上書きしてます) | |
46 | +・波紋・発音色の減衰描画を、実時間ではなくシーケンサの演奏時間を使うように修正 | |
47 | +・波紋・発音色の減衰率を、リニアではなく指数関数的に行なうように修正 | |
48 | +・波紋・発音色の減衰時間を、固定長ではなく発音長を考慮するように修正 | |
49 | + | |
50 | +改造点 20120318: | |
51 | +・2D/3D ビューの鍵盤を動くようにした | |
52 | +・時間をミリ秒表示に修正 | |
53 | +・ウィンドウ背景のブラシを黒固定に変更(背景が時々真っ白になるので) |