MIDITrail をピカピカにする。鍵盤方向自動切替・多ポート・歌詞対応等
Revision | 73b5ce38d4c26e86f409a094ac8672b59b4c7460 (tree) |
---|---|
Zeit | 2023-08-06 14:38:45 |
Autor | yoshy <yoshy@user...> |
Commiter | yoshy |
[WORKING] PianoRollRingシーンのリップルオブジェクトをMod化
@@ -197,6 +197,8 @@ | ||
197 | 197 | <ResourceCompile Include="MIDITrail.rc" /> |
198 | 198 | </ItemGroup> |
199 | 199 | <ItemGroup> |
200 | + <ClCompile Include="MTNoteDesignRingMod.cpp" /> | |
201 | + <ClCompile Include="MTNoteRippleRingMod.cpp" /> | |
200 | 202 | <ClCompile Include="MTGridRingMod.cpp" /> |
201 | 203 | <ClCompile Include="MTScenePianoRollRingMod.cpp" /> |
202 | 204 | <ClCompile Include="MTTimeIndicatorMod.cpp" /> |
@@ -287,6 +289,8 @@ | ||
287 | 289 | </ClCompile> |
288 | 290 | </ItemGroup> |
289 | 291 | <ItemGroup> |
292 | + <ClInclude Include="MTNoteDesignRingMod.h" /> | |
293 | + <ClInclude Include="MTNoteRippleRingMod.h" /> | |
290 | 294 | <ClInclude Include="MTGridRingMod.h" /> |
291 | 295 | <ClInclude Include="MTScenePianoRollRingMod.h" /> |
292 | 296 | <ClInclude Include="MTTimeIndicatorMod.h" /> |
@@ -299,6 +299,12 @@ | ||
299 | 299 | <ClCompile Include="MTTimeIndicatorRingMod.cpp"> |
300 | 300 | <Filter>Sources\SceneObject</Filter> |
301 | 301 | </ClCompile> |
302 | + <ClCompile Include="MTNoteRippleRingMod.cpp"> | |
303 | + <Filter>Sources\SceneObject</Filter> | |
304 | + </ClCompile> | |
305 | + <ClCompile Include="MTNoteDesignRingMod.cpp"> | |
306 | + <Filter>Sources\SceneObject</Filter> | |
307 | + </ClCompile> | |
302 | 308 | </ItemGroup> |
303 | 309 | <ItemGroup> |
304 | 310 | <ClInclude Include="MIDITrailApp.h"> |
@@ -562,5 +568,11 @@ | ||
562 | 568 | <ClInclude Include="MTTimeIndicatorRingMod.h"> |
563 | 569 | <Filter>Sources\SceneObject</Filter> |
564 | 570 | </ClInclude> |
571 | + <ClInclude Include="MTNoteRippleRingMod.h"> | |
572 | + <Filter>Sources\SceneObject</Filter> | |
573 | + </ClInclude> | |
574 | + <ClInclude Include="MTNoteDesignRingMod.h"> | |
575 | + <Filter>Sources\SceneObject</Filter> | |
576 | + </ClInclude> | |
565 | 577 | </ItemGroup> |
566 | 578 | </Project> |
\ No newline at end of file |
@@ -45,7 +45,7 @@ public: | ||
45 | 45 | ); |
46 | 46 | |
47 | 47 | //発音中ノートボックス頂点座標取得 |
48 | - void GetActiveNoteBoxVirtexPos( | |
48 | + virtual void GetActiveNoteBoxVirtexPos( | |
49 | 49 | unsigned long curTickTime, |
50 | 50 | unsigned char portNo, |
51 | 51 | unsigned char chNo, |
@@ -385,6 +385,12 @@ int MTNoteDesignRing::_LoadConfFile( | ||
385 | 385 | int result = 0; |
386 | 386 | MTConfFile confFile; |
387 | 387 | |
388 | +// >>> modify 20191224 yossiepon begin | |
389 | + //基底クラスの読み込み処理を呼び出す | |
390 | + result = MTNoteDesign::_LoadConfFile(pSceneName); | |
391 | + if (result != 0) goto EXIT; | |
392 | +// <<< modify 20191224 yossiepon end | |
393 | + | |
388 | 394 | //設定ファイル読み込み |
389 | 395 | result = MTNoteDesign::_LoadConfFile(pSceneName); |
390 | 396 | if (result != 0) goto EXIT; |
@@ -102,7 +102,9 @@ public: | ||
102 | 102 | //世界座標配置移動ベクトル取得 |
103 | 103 | virtual D3DXVECTOR3 GetWorldMoveVector(); |
104 | 104 | |
105 | -private: | |
105 | +// >>> modify access level to proteced 20191224 yossiepon begin | |
106 | +protected: | |
107 | +// <<< modify access level to proteced 20191224 yossiepon end | |
106 | 108 | |
107 | 109 | bool m_isLiveMode; |
108 | 110 | float m_NoteAngleStep; |
@@ -0,0 +1,221 @@ | ||
1 | +//****************************************************************************** | |
2 | +// | |
3 | +// MIDITrail / MTNoteDesignRingMod | |
4 | +// | |
5 | +// ノートデザインリングModクラス | |
6 | +// | |
7 | +// Copyright (C) 2019 WADA Masashi. All Rights Reserved. | |
8 | +// | |
9 | +//****************************************************************************** | |
10 | + | |
11 | +#include "StdAfx.h" | |
12 | +#include "MTNoteDesignRingMod.h" | |
13 | +#include "DXH.h" | |
14 | + | |
15 | + | |
16 | +//****************************************************************************** | |
17 | +// コンストラクタ | |
18 | +//****************************************************************************** | |
19 | +MTNoteDesignRingMod::MTNoteDesignRingMod(void) | |
20 | +{ | |
21 | +} | |
22 | + | |
23 | +//****************************************************************************** | |
24 | +// デストラクタ | |
25 | +//****************************************************************************** | |
26 | +MTNoteDesignRingMod::~MTNoteDesignRingMod(void) | |
27 | +{ | |
28 | +} | |
29 | + | |
30 | +//****************************************************************************** | |
31 | +// 初期化 | |
32 | +//****************************************************************************** | |
33 | +int MTNoteDesignRingMod::Initialize( | |
34 | + const TCHAR* pSceneName, | |
35 | + SMSeqData* pSeqData | |
36 | +) | |
37 | +{ | |
38 | + int result = 0; | |
39 | + | |
40 | + result = MTNoteDesignRing::Initialize(pSceneName, pSeqData); | |
41 | + if (result != 0) goto EXIT; | |
42 | + | |
43 | + result = MTNoteDesignMod::Initialize(pSceneName, pSeqData); | |
44 | + if (result != 0) goto EXIT; | |
45 | + | |
46 | +EXIT:; | |
47 | + return result; | |
48 | +} | |
49 | + | |
50 | +//****************************************************************************** | |
51 | +// ノートボックス中心座標取得 | |
52 | +//****************************************************************************** | |
53 | +D3DXVECTOR3 MTNoteDesignRingMod::GetNoteBoxCenterPosX( | |
54 | + unsigned long curTickTime, | |
55 | + unsigned char portNo, | |
56 | + unsigned char chNo, | |
57 | + unsigned char noteNo, | |
58 | + short pitchBendValue, //省略可:ピッチベンド | |
59 | + unsigned char pitchBendSensitivity //省略可:ピッチベンド感度 | |
60 | +) | |
61 | +{ | |
62 | + return MTNoteDesignRing::GetNoteBoxCenterPosX(curTickTime, portNo, chNo, noteNo, pitchBendValue, pitchBendSensitivity); | |
63 | +} | |
64 | + | |
65 | +//****************************************************************************** | |
66 | +// ノートボックス頂点座標取得 | |
67 | +//****************************************************************************** | |
68 | +void MTNoteDesignRingMod::GetNoteBoxVirtexPos( | |
69 | + unsigned long curTickTime, | |
70 | + unsigned char portNo, | |
71 | + unsigned char chNo, | |
72 | + unsigned char noteNo, | |
73 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
74 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
75 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
76 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
77 | + short pitchBendValue, //省略可:ピッチベンド | |
78 | + unsigned char pitchBendSensitivity //省略可:ピッチベンド感度 | |
79 | + | |
80 | +) | |
81 | +{ | |
82 | + MTNoteDesignRing::GetNoteBoxVirtexPos( | |
83 | + curTickTime, portNo, chNo, noteNo, pVector0, pVector1, pVector2, pVector3, pitchBendValue, pitchBendSensitivity); | |
84 | +} | |
85 | + | |
86 | +//****************************************************************************** | |
87 | +// 発音中ノートボックス頂点座標取得 | |
88 | +//****************************************************************************** | |
89 | +void MTNoteDesignRingMod::GetActiveNoteBoxVirtexPos( | |
90 | + unsigned long curTickTime, | |
91 | + unsigned char portNo, | |
92 | + unsigned char chNo, | |
93 | + unsigned char noteNo, | |
94 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
95 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
96 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
97 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
98 | + short pitchBendValue, //省略可:ピッチベンド | |
99 | + unsigned char pitchBendSensitivity, //省略可:ピッチベンド感度 | |
100 | + unsigned long elapsedTime //省略可:経過時間(ミリ秒) | |
101 | +) | |
102 | +{ | |
103 | + MTNoteDesignRing::GetActiveNoteBoxVirtexPos( | |
104 | + curTickTime, portNo, chNo, noteNo, pVector0, pVector1, pVector2, pVector3, pitchBendValue, pitchBendSensitivity, elapsedTime); | |
105 | +} | |
106 | + | |
107 | +//****************************************************************************** | |
108 | +// 発音中ノートボックス頂点座標取得 | |
109 | +//****************************************************************************** | |
110 | +void MTNoteDesignRingMod::GetActiveNoteBoxVirtexPos( | |
111 | + unsigned long curTickTime, | |
112 | + unsigned char portNo, | |
113 | + unsigned char chNo, | |
114 | + unsigned char noteNo, | |
115 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
116 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
117 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
118 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
119 | + short pitchBendValue, //省略可:ピッチベンド | |
120 | + unsigned char pitchBendSensitivity, //省略可:ピッチベンド感度 | |
121 | + float rate //省略可:サイズ比率 | |
122 | +) | |
123 | +{ | |
124 | + D3DXVECTOR3 basePos0; | |
125 | + D3DXVECTOR3 basePos1; | |
126 | + D3DXVECTOR3 basePos2; | |
127 | + float angle0 = 0.0f; | |
128 | + float angle1 = 0.0f; | |
129 | + float angle2 = 0.0f; | |
130 | + float curSizeRatio = 1.0f; | |
131 | + | |
132 | + if (rate > 0.0f) { | |
133 | + curSizeRatio = 1.0f + (MTNoteDesignMod::m_ActiveNoteBoxSizeRatio - 1.0f) * GetDecayCoefficient(rate, 30.0f); | |
134 | + } | |
135 | + | |
136 | + //ノート基準座標 | |
137 | + basePos0 = _GetNoteBasePos(curTickTime, portNo, chNo); | |
138 | + basePos1 = basePos0; | |
139 | + basePos1.y -= MTNoteDesignMod::GetNoteBoxWidth() * curSizeRatio / 2.0f; | |
140 | + basePos2 = basePos0; | |
141 | + basePos2.y += MTNoteDesignMod::GetNoteBoxWidth() * curSizeRatio / 2.0f; | |
142 | + | |
143 | + //ノート番号で角度を決定 | |
144 | + angle0 = _GetNoteAngle(noteNo, pitchBendValue, pitchBendSensitivity); | |
145 | + angle1 = angle0 - (m_NoteAngleStep * curSizeRatio / 2.0f); | |
146 | + angle2 = angle0 + (m_NoteAngleStep * curSizeRatio / 2.0f); | |
147 | + | |
148 | + *pVector0 = DXH::RotateYZ(0.0f, 0.0f, basePos2, angle1); | |
149 | + *pVector1 = DXH::RotateYZ(0.0f, 0.0f, basePos2, angle2); | |
150 | + *pVector2 = DXH::RotateYZ(0.0f, 0.0f, basePos1, angle1); | |
151 | + *pVector3 = DXH::RotateYZ(0.0f, 0.0f, basePos1, angle2); | |
152 | +} | |
153 | + | |
154 | +//****************************************************************************** | |
155 | +// ライブモニタ用ノートボックス頂点座標取得 | |
156 | +//****************************************************************************** | |
157 | +void MTNoteDesignRingMod::GetNoteBoxVirtexPosLive( | |
158 | + unsigned long elapsedTime, | |
159 | + unsigned char portNo, | |
160 | + unsigned char chNo, | |
161 | + unsigned char noteNo, | |
162 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
163 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
164 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
165 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
166 | + short pitchBendValue, //省略可:ピッチベンド | |
167 | + unsigned char pitchBendSensitivity //省略可:ピッチベンド感度 | |
168 | +) | |
169 | +{ | |
170 | + MTNoteDesignRing::GetNoteBoxVirtexPosLive( | |
171 | + elapsedTime, portNo, chNo, noteNo, pVector0, pVector1, pVector2, pVector3, pitchBendValue, pitchBendSensitivity); | |
172 | +} | |
173 | + | |
174 | +//****************************************************************************** | |
175 | +// ポート原点Y座標取得 | |
176 | +//****************************************************************************** | |
177 | +float MTNoteDesignRingMod::GetPortOriginY( | |
178 | + unsigned char portNo | |
179 | +) | |
180 | +{ | |
181 | + return MTNoteDesignRing::GetPortOriginY(portNo); | |
182 | +} | |
183 | + | |
184 | +//****************************************************************************** | |
185 | +// ポート原点Z座標取得 | |
186 | +//****************************************************************************** | |
187 | +float MTNoteDesignRingMod::GetPortOriginZ( | |
188 | + unsigned char portNo | |
189 | +) | |
190 | +{ | |
191 | + return MTNoteDesignRing::GetPortOriginZ(portNo); | |
192 | +} | |
193 | + | |
194 | +//****************************************************************************** | |
195 | +// 世界座標配置移動ベクトル取得 | |
196 | +//****************************************************************************** | |
197 | +D3DXVECTOR3 MTNoteDesignRingMod::GetWorldMoveVector() | |
198 | +{ | |
199 | + return MTNoteDesignRing::GetWorldMoveVector(); | |
200 | +} | |
201 | + | |
202 | +//****************************************************************************** | |
203 | +// 設定ファイル読み込み | |
204 | +//****************************************************************************** | |
205 | +int MTNoteDesignRingMod::_LoadConfFile( | |
206 | + const TCHAR* pSceneName | |
207 | +) | |
208 | +{ | |
209 | + int result = 0; | |
210 | + | |
211 | + result = MTNoteDesignRing::_LoadConfFile(pSceneName); | |
212 | + if (result != 0) goto EXIT; | |
213 | + | |
214 | + result = MTNoteDesignMod::_LoadConfFile(pSceneName); | |
215 | + if (result != 0) goto EXIT; | |
216 | + | |
217 | +EXIT:; | |
218 | + return result; | |
219 | +} | |
220 | + | |
221 | + |
@@ -0,0 +1,112 @@ | ||
1 | +//****************************************************************************** | |
2 | +// | |
3 | +// MIDITrail / MTNoteDesignRingMod | |
4 | +// | |
5 | +// ノートデザインリングModクラス | |
6 | +// | |
7 | +// Copyright (C) 2019 Yossiepon Oniichan. All Rights Reserved. | |
8 | +// | |
9 | +//****************************************************************************** | |
10 | + | |
11 | +#pragma once | |
12 | + | |
13 | +#include "MTNoteDesignMod.h" | |
14 | +#include "MTNoteDesignRing.h" | |
15 | + | |
16 | +using namespace SMIDILib; | |
17 | + | |
18 | + | |
19 | +//****************************************************************************** | |
20 | +// ノートデザインリングModクラス | |
21 | +//****************************************************************************** | |
22 | +class MTNoteDesignRingMod : public MTNoteDesignMod, public MTNoteDesignRing | |
23 | +{ | |
24 | +public: | |
25 | + | |
26 | + //コンストラクタ/デストラクタ | |
27 | + MTNoteDesignRingMod(void); | |
28 | + virtual ~MTNoteDesignRingMod(void); | |
29 | + | |
30 | + virtual int Initialize(const TCHAR* pSceneName, SMSeqData* pSeqData); | |
31 | + | |
32 | + //ノートボックス中心座標取得 | |
33 | + virtual D3DXVECTOR3 GetNoteBoxCenterPosX( | |
34 | + unsigned long curTickTime, | |
35 | + unsigned char portNo, | |
36 | + unsigned char chNo, | |
37 | + unsigned char noteNo, | |
38 | + short pitchBendValue = 0, //省略可:ピッチベンド | |
39 | + unsigned char pitchBendSensitivity = 0 //省略可:ピッチベンド感度 | |
40 | + ); | |
41 | + | |
42 | + //ノートボックス頂点座標取得 | |
43 | + virtual void GetNoteBoxVirtexPos( | |
44 | + unsigned long curTickTime, | |
45 | + unsigned char portNo, | |
46 | + unsigned char chNo, | |
47 | + unsigned char noteNo, | |
48 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
49 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
50 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
51 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
52 | + short pitchBendValue = 0, //省略可:ピッチベンド | |
53 | + unsigned char pitchBendSensitivity = 0 //省略可:ピッチベンド感度 | |
54 | + ); | |
55 | + | |
56 | + //発音中ノートボックス頂点座標取得 | |
57 | + virtual void GetActiveNoteBoxVirtexPos( | |
58 | + unsigned long curTickTime, | |
59 | + unsigned char portNo, | |
60 | + unsigned char chNo, | |
61 | + unsigned char noteNo, | |
62 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
63 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
64 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
65 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
66 | + short pitchBendValue = 0, //省略可:ピッチベンド | |
67 | + unsigned char pitchBendSensitivity = 0, //省略可:ピッチベンド感度 | |
68 | + unsigned long elapsedTime = 0 //省略可:経過時間(ミリ秒) | |
69 | + ); | |
70 | + | |
71 | + //発音中ノートボックス頂点座標取得 | |
72 | + virtual void GetActiveNoteBoxVirtexPos( | |
73 | + unsigned long curTickTime, | |
74 | + unsigned char portNo, | |
75 | + unsigned char chNo, | |
76 | + unsigned char noteNo, | |
77 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
78 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
79 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
80 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
81 | + short pitchBendValue = 0, //省略可:ピッチベンド | |
82 | + unsigned char pitchBendSensitivity = 0, //省略可:ピッチベンド感度 | |
83 | + float rate = 0.0f //省略可:サイズ比率 | |
84 | + ); | |
85 | + | |
86 | + //ライブモニタ用ノートボックス頂点座標取得 | |
87 | + virtual void GetNoteBoxVirtexPosLive( | |
88 | + unsigned long elapsedTime, //経過時間(ミリ秒) | |
89 | + unsigned char portNo, | |
90 | + unsigned char chNo, | |
91 | + unsigned char noteNo, | |
92 | + D3DXVECTOR3* pVector0, //YZ平面+X軸方向を見て左上 | |
93 | + D3DXVECTOR3* pVector1, //YZ平面+X軸方向を見て右上 | |
94 | + D3DXVECTOR3* pVector2, //YZ平面+X軸方向を見て左下 | |
95 | + D3DXVECTOR3* pVector3, //YZ平面+X軸方向を見て右下 | |
96 | + short pitchBendValue = 0, //省略可:ピッチベンド | |
97 | + unsigned char pitchBendSensitivity = 0 //省略可:ピッチベンド感度 | |
98 | + ); | |
99 | + | |
100 | + //ポート原点座標取得 | |
101 | + virtual float GetPortOriginY(unsigned char portNo); | |
102 | + virtual float GetPortOriginZ(unsigned char portNo); | |
103 | + | |
104 | + //世界座標配置移動ベクトル取得 | |
105 | + virtual D3DXVECTOR3 GetWorldMoveVector(); | |
106 | + | |
107 | +private: | |
108 | + | |
109 | + virtual int _LoadConfFile(const TCHAR* pSceneName); | |
110 | +}; | |
111 | + | |
112 | + |
@@ -21,6 +21,7 @@ using namespace YNBaseLib; | ||
21 | 21 | //****************************************************************************** |
22 | 22 | MTNoteRippleMod::MTNoteRippleMod(void) : MTNoteRipple() |
23 | 23 | { |
24 | + m_pNoteDesignMod = NULL; | |
24 | 25 | m_PlayTimeMSec = 0; |
25 | 26 | m_CurNoteIndex = 0; |
26 | 27 | m_pNoteStatusMod = NULL; |
@@ -48,14 +49,10 @@ int MTNoteRippleMod::Create( | ||
48 | 49 | int result = 0; |
49 | 50 | SMTrack track; |
50 | 51 | |
51 | - Release(); | |
52 | - | |
53 | - //// 基底クラスの生成処理を呼び出す | |
54 | - //result = MTNoteRipple::Create(pD3DDevice, pSceneName, pSeqData, pNotePitchBend); | |
55 | - //if (result != 0) goto EXIT; | |
52 | + //解放およびノートデザインModオブジェクト生成は基底クラスからオーバライド経由で行う | |
56 | 53 | |
57 | - //ノートデザインModオブジェクト初期化 | |
58 | - result = m_NoteDesignMod.Initialize(pSceneName, pSeqData); | |
54 | + // 基底クラスの生成処理を呼び出す | |
55 | + result = MTNoteRipple::Create(pD3DDevice, pSceneName, pSeqData, pNotePitchBend); | |
59 | 56 | if (result != 0) goto EXIT; |
60 | 57 | |
61 | 58 | //トラック取得 |
@@ -66,9 +63,26 @@ int MTNoteRippleMod::Create( | ||
66 | 63 | result = track.GetNoteListWithRealTime(&m_NoteListRT, pSeqData->GetTimeDivision()); |
67 | 64 | if (result != 0) goto EXIT; |
68 | 65 | |
69 | - // 基底クラスの生成処理を呼び出す | |
70 | - result = MTNoteRipple::Create(pD3DDevice, pSceneName, pSeqData, pNotePitchBend); | |
71 | - if (result != 0) goto EXIT; | |
66 | +EXIT:; | |
67 | + return result; | |
68 | +} | |
69 | + | |
70 | +//****************************************************************************** | |
71 | +// ノートデザイン生成 | |
72 | +//****************************************************************************** | |
73 | +int MTNoteRippleMod::_CreateNoteDesign() | |
74 | +{ | |
75 | + int result = 0; | |
76 | + | |
77 | + try { | |
78 | + //ノートデザインModオブジェクト生成 | |
79 | + m_pNoteDesignMod = new MTNoteDesignMod(); | |
80 | + m_pNoteDesign = m_pNoteDesignMod; | |
81 | + } | |
82 | + catch (std::bad_alloc) { | |
83 | + result = YN_SET_ERR("Could not allocate memory.", 0, 0); | |
84 | + goto EXIT; | |
85 | + } | |
72 | 86 | |
73 | 87 | EXIT:; |
74 | 88 | return result; |
@@ -112,8 +126,8 @@ int MTNoteRippleMod::_UpdateStatusOfRipple( | ||
112 | 126 | SMNote note; |
113 | 127 | |
114 | 128 | //波紋ディケイ・リリース時間(msec) |
115 | - unsigned long decayDuration = m_NoteDesignMod.GetRippleDecayDuration(); | |
116 | - unsigned long releaseDuration = m_NoteDesignMod.GetRippleReleaseDuration(); | |
129 | + unsigned long decayDuration = m_pNoteDesignMod->GetRippleDecayDuration(); | |
130 | + unsigned long releaseDuration = m_pNoteDesignMod->GetRippleReleaseDuration(); | |
117 | 131 | |
118 | 132 | //ノート情報を更新する |
119 | 133 | for (i = 0; i < MTNOTERIPPLE_MAX_RIPPLE_NUM; i++) { |
@@ -320,7 +334,7 @@ int MTNoteRippleMod::_UpdateVertexOfRipple( | ||
320 | 334 | ZeroMemory(m_KeyDownRate, sizeof(float) * MTNOTERIPPLE_MAX_PORT_NUM * SM_MAX_CH_NUM * SM_MAX_NOTE_NUM); |
321 | 335 | |
322 | 336 | // 波紋上書き回数 |
323 | - unsigned long overwriteTimes = m_NoteDesignMod.GetRippleOverwriteTimes(); | |
337 | + unsigned long overwriteTimes = m_pNoteDesignMod->GetRippleOverwriteTimes(); | |
324 | 338 | |
325 | 339 | //発音中ノートの波紋について頂点を更新 |
326 | 340 | for (i = 0; i < MTNOTERIPPLE_MAX_RIPPLE_NUM; i++) { |
@@ -392,8 +406,8 @@ int MTNoteRippleMod::Draw( | ||
392 | 406 | pD3DDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); |
393 | 407 | |
394 | 408 | //レンダリングステート設定:ブレンド指定値 |
395 | - pD3DDevice->SetRenderState(D3DRS_SRCBLEND, m_NoteDesignMod.GetRippleSrcBlend()); | |
396 | - pD3DDevice->SetRenderState(D3DRS_DESTBLEND, m_NoteDesignMod.GetRippleDestBlend()); | |
409 | + pD3DDevice->SetRenderState(D3DRS_SRCBLEND, m_pNoteDesignMod->GetRippleSrcBlend()); | |
410 | + pD3DDevice->SetRenderState(D3DRS_DESTBLEND, m_pNoteDesignMod->GetRippleDestBlend()); | |
397 | 411 | |
398 | 412 | //プリミティブ描画 |
399 | 413 | if (m_ActiveNoteNum > 0) { |
@@ -415,10 +429,12 @@ EXIT:; | ||
415 | 429 | //****************************************************************************** |
416 | 430 | void MTNoteRippleMod::Release() |
417 | 431 | { |
418 | - if(m_pNoteStatusMod != NULL) { | |
419 | - delete [] m_pNoteStatusMod; | |
420 | - m_pNoteStatusMod = NULL; | |
421 | - } | |
432 | + delete m_pNoteDesignMod; | |
433 | + m_pNoteDesignMod = NULL; | |
434 | + m_pNoteDesign = NULL; | |
435 | + | |
436 | + delete [] m_pNoteStatusMod; | |
437 | + m_pNoteStatusMod = NULL; | |
422 | 438 | |
423 | 439 | MTNoteRipple::Release(); |
424 | 440 | } |
@@ -463,7 +479,7 @@ int MTNoteRippleMod::_CreateVertex( | ||
463 | 479 | MTNOTERIPPLE_VERTEX* pVertex = NULL; |
464 | 480 | |
465 | 481 | // 波紋上書き回数 |
466 | - unsigned long overwriteTimes = m_NoteDesignMod.GetRippleOverwriteTimes(); | |
482 | + unsigned long overwriteTimes = m_pNoteDesignMod->GetRippleOverwriteTimes(); | |
467 | 483 | |
468 | 484 | //プリミティブ初期化 |
469 | 485 | result = m_Primitive.Initialize( |
@@ -526,11 +542,11 @@ int MTNoteRippleMod::_SetVertexPosition( | ||
526 | 542 | ); |
527 | 543 | |
528 | 544 | //波紋サイズ |
529 | - rh = m_NoteDesignMod.GetRippleHeight(pNoteStatus->keyDownRate); | |
530 | - rw = m_NoteDesignMod.GetRippleWidth(pNoteStatus->keyDownRate); | |
545 | + rh = m_pNoteDesignMod->GetRippleHeight(pNoteStatus->keyDownRate); | |
546 | + rw = m_pNoteDesignMod->GetRippleWidth(pNoteStatus->keyDownRate); | |
531 | 547 | |
532 | 548 | //波紋描画間隔 |
533 | - spacing = m_NoteDesignMod.GetRippleSpacing(); | |
549 | + spacing = m_pNoteDesignMod->GetRippleSpacing(); | |
534 | 550 | |
535 | 551 | //描画終了確認 |
536 | 552 | if ((rh <= 0.0f) || (rw <= 0.0f)) { |
@@ -562,7 +578,7 @@ int MTNoteRippleMod::_SetVertexPosition( | ||
562 | 578 | } |
563 | 579 | |
564 | 580 | //透明度を徐々に落とす |
565 | - alpha = m_NoteDesignMod.GetRippleAlpha(pNoteStatus->keyDownRate); | |
581 | + alpha = m_pNoteDesignMod->GetRippleAlpha(pNoteStatus->keyDownRate); | |
566 | 582 | |
567 | 583 | //各頂点のディフューズ色 |
568 | 584 | for (i = 0; i < 6; i++) { |
@@ -78,10 +78,12 @@ private: | ||
78 | 78 | float keyDownRate; |
79 | 79 | }; |
80 | 80 | |
81 | -private: | |
81 | +protected: | |
82 | 82 | |
83 | 83 | //ノートデザイン |
84 | - MTNoteDesignMod m_NoteDesignMod; | |
84 | + MTNoteDesignMod *m_pNoteDesignMod; | |
85 | + | |
86 | +private: | |
85 | 87 | |
86 | 88 | //ノートリスト |
87 | 89 | SMNoteList m_NoteListRT; |
@@ -94,6 +96,8 @@ private: | ||
94 | 96 | //ノート発音状態情報 |
95 | 97 | NoteStatusMod* m_pNoteStatusMod; |
96 | 98 | |
99 | + virtual int _CreateNoteDesign(); | |
100 | + | |
97 | 101 | int _SetVertexPosition( |
98 | 102 | MTNOTERIPPLE_VERTEX* pVertex, |
99 | 103 | SMNote note, |
@@ -0,0 +1,54 @@ | ||
1 | +//****************************************************************************** | |
2 | +// | |
3 | +// MIDITrail / MTNoteRippleRingMod | |
4 | +// | |
5 | +// ノート波紋リング描画Modクラス | |
6 | +// | |
7 | +// Copyright (C) 2019 Yossiepon Oniichan. All Rights Reserved. | |
8 | +// | |
9 | +//****************************************************************************** | |
10 | + | |
11 | +#include "StdAfx.h" | |
12 | +#include "YNBaseLib.h" | |
13 | +#include "MTNoteDesignRingMod.h" | |
14 | +#include "MTNoteRippleRingMod.h" | |
15 | + | |
16 | +using namespace YNBaseLib; | |
17 | + | |
18 | + | |
19 | +//****************************************************************************** | |
20 | +// コンストラクタ | |
21 | +//****************************************************************************** | |
22 | +MTNoteRippleRingMod::MTNoteRippleRingMod(void) | |
23 | +{ | |
24 | +} | |
25 | + | |
26 | +//****************************************************************************** | |
27 | +// デストラクタ | |
28 | +//****************************************************************************** | |
29 | +MTNoteRippleRingMod::~MTNoteRippleRingMod(void) | |
30 | +{ | |
31 | +} | |
32 | + | |
33 | +//****************************************************************************** | |
34 | +// ノートデザイン生成 | |
35 | +//****************************************************************************** | |
36 | +int MTNoteRippleRingMod::_CreateNoteDesign() | |
37 | +{ | |
38 | + int result = 0; | |
39 | + | |
40 | + try { | |
41 | + //ノートデザインModオブジェクト生成 | |
42 | + m_pNoteDesignMod = new MTNoteDesignRingMod(); | |
43 | + m_pNoteDesign = m_pNoteDesignMod; | |
44 | + } | |
45 | + catch (std::bad_alloc) { | |
46 | + result = YN_SET_ERR("Could not allocate memory.", 0, 0); | |
47 | + goto EXIT; | |
48 | + } | |
49 | + | |
50 | +EXIT:; | |
51 | + return result; | |
52 | +} | |
53 | + | |
54 | + |
@@ -0,0 +1,33 @@ | ||
1 | +//****************************************************************************** | |
2 | +// | |
3 | +// MIDITrail / MTNoteRippleRingMod | |
4 | +// | |
5 | +// ノート波紋リング描画Modクラス | |
6 | +// | |
7 | +// Copyright (C) 2019 Yossiepon Oniichan. All Rights Reserved. | |
8 | +// | |
9 | +//****************************************************************************** | |
10 | + | |
11 | +#pragma once | |
12 | + | |
13 | +#include "MTNoteRippleMod.h" | |
14 | + | |
15 | + | |
16 | +//****************************************************************************** | |
17 | +// リング用ノート波紋描画Modクラス | |
18 | +//****************************************************************************** | |
19 | +class MTNoteRippleRingMod : public MTNoteRippleMod | |
20 | +{ | |
21 | +public: | |
22 | + | |
23 | + //コンストラクタ/デストラクタ | |
24 | + MTNoteRippleRingMod(void); | |
25 | + virtual ~MTNoteRippleRingMod(void); | |
26 | + | |
27 | +private: | |
28 | + | |
29 | + virtual int _CreateNoteDesign(); | |
30 | + | |
31 | +}; | |
32 | + | |
33 | + |
@@ -101,9 +101,7 @@ public: | ||
101 | 101 | void MoveToStaticViewpoint(unsigned long viewpointNo); |
102 | 102 | |
103 | 103 | //視点リセット |
104 | - // >>> modify 20191222 yossiepon begin | |
105 | 104 | void ResetViewpoint(); |
106 | - // <<< modify 20191222 yossiepon end | |
107 | 105 | |
108 | 106 | //エフェクト設定 |
109 | 107 | // >>> modify 20191222 yossiepon begin |
@@ -213,9 +213,10 @@ int MTScenePianoRollRingMod::OnRecvSequencerMsg( | ||
213 | 213 | } |
214 | 214 | //演奏チックタイム通知 |
215 | 215 | else if (parser.GetMsg() == SMMsgParser::MsgPlayTime) { |
216 | - m_Dashboard.SetPlayTimeSec(parser.GetPlayTimeSec()); | |
216 | + m_Dashboard.SetPlayTimeMSec(parser.GetPlayTimeMSec()); | |
217 | 217 | m_FirstPersonCam.SetCurTickTime(parser.GetPlayTickTime()); |
218 | 218 | m_TimeIndicatorMod.SetCurTickTime(parser.GetPlayTickTime()); |
219 | + m_NoteRippleMod.SetPlayTimeMSec(parser.GetPlayTimeMSec()); | |
219 | 220 | m_NoteRippleMod.SetCurTickTime(parser.GetPlayTickTime()); |
220 | 221 | m_PictBoard.SetCurTickTime(parser.GetPlayTickTime()); |
221 | 222 | m_NoteBox.SetCurTickTime(parser.GetPlayTickTime()); |
@@ -234,12 +235,12 @@ int MTScenePianoRollRingMod::OnRecvSequencerMsg( | ||
234 | 235 | } |
235 | 236 | //ノートOFF通知 |
236 | 237 | else if (parser.GetMsg() == SMMsgParser::MsgNoteOff) { |
237 | - m_NoteRippleMod.SetNoteOff(parser.GetPortNo(), parser.GetChNo(), parser.GetNoteNo()); | |
238 | + //m_NoteRippleMod.SetNoteOff(parser.GetPortNo(), parser.GetChNo(), parser.GetNoteNo()); | |
238 | 239 | } |
239 | 240 | //ノートON通知 |
240 | 241 | else if (parser.GetMsg() == SMMsgParser::MsgNoteOn) { |
241 | 242 | m_Dashboard.SetNoteOn(); |
242 | - m_NoteRippleMod.SetNoteOn(parser.GetPortNo(), parser.GetChNo(), parser.GetNoteNo(), parser.GetVelocity()); | |
243 | + //m_NoteRippleMod.SetNoteOn(parser.GetPortNo(), parser.GetChNo(), parser.GetNoteNo(), parser.GetVelocity()); | |
243 | 244 | } |
244 | 245 | //ピッチベンド通知 |
245 | 246 | else if (parser.GetMsg() == SMMsgParser::MsgPitchBend) { |
@@ -304,4 +305,3 @@ void MTScenePianoRollRingMod::SetEffect( | ||
304 | 305 | |
305 | 306 | return; |
306 | 307 | } |
307 | - |
@@ -10,6 +10,7 @@ | ||
10 | 10 | |
11 | 11 | #pragma once |
12 | 12 | |
13 | +#include "MTNoteRippleRingMod.h" | |
13 | 14 | #include "MTGridRingMod.h" |
14 | 15 | #include "MTTimeIndicatorRingMod.h" |
15 | 16 | #include "MTScenePianoRollRing.h" |
@@ -59,7 +60,7 @@ public: | ||
59 | 60 | protected: |
60 | 61 | |
61 | 62 | //描画オブジェクト |
62 | - MTNoteRippleRing m_NoteRippleMod; | |
63 | + MTNoteRippleRingMod m_NoteRippleMod; | |
63 | 64 | MTGridRingMod m_GridRingMod; |
64 | 65 | MTTimeIndicatorRingMod m_TimeIndicatorMod; |
65 | 66 |
@@ -62,14 +62,23 @@ EmissiveRGBA=1A1A1A1A | ||
62 | 62 | SizeRatio=1.4 |
63 | 63 | |
64 | 64 | [Ripple] |
65 | -Duration=1600 | |
65 | +;Duration=1600 | |
66 | +DecayDuration=100 | |
67 | +ReleaseDuration=250 | |
68 | +;-- D3dBlendType : ZERO=1, ONE=2, SRCALPHA=5, INVSRCALPHA=6, DESTALPHA=7, INVDESTALPHA=8 | |
69 | +SrcBlend=5 | |
70 | +DestBlend=2 | |
71 | +OverwriteTimes=3 | |
72 | +;-- e.g.) BlackBG : Src/Dest/Overwrite = 5/2/3, PictureBG : Src/Dest/Overwrite = 5/2/1 | |
73 | +Spacing=0.002 | |
66 | 74 | |
67 | 75 | [Stars] |
68 | 76 | NumberOfStars=2000 |
69 | 77 | |
70 | 78 | [Bitmap] |
71 | 79 | Board=data\Board.png |
72 | -Ripple=data\Ripple.png | |
80 | +Ripple=data\Ripple2.png | |
81 | +;Keyboard=data\Keyboard.png | |
73 | 82 | |
74 | 83 | #[Mesh] |
75 | 84 | #XFile=mesh\model.x |
@@ -95,3 +104,33 @@ Theta=90.0 | ||
95 | 104 | ManualRollAngle=0.0 |
96 | 105 | AutoRollVelocity=0.0 |
97 | 106 | |
107 | +;[PianoKeyboard] | |
108 | +;KeyDownDuration=40 | |
109 | +;KeyUpDuration=40 | |
110 | +;KeyboardStepY=0.34 | |
111 | +;KeyboardStepZ=1.5 | |
112 | +;KeyboardMaxDispNum=16 | |
113 | +;WhiteKeyColor=FFFFFFDD | |
114 | +;BlackKeyColor=FFFFFFDD | |
115 | +;ActiveKeyColorType=STANDARD | |
116 | +;;ActiveKeyColor=FF0000FF | |
117 | +;Ch-01-ActiveKeyColor=E61A1AEE | |
118 | +;Ch-02-ActiveKeyColor=1FFF01EE | |
119 | +;Ch-03-ActiveKeyColor=013DFFEE | |
120 | +;Ch-04-ActiveKeyColor=FF6101EE | |
121 | +;Ch-05-ActiveKeyColor=01FF43EE | |
122 | +;Ch-06-ActiveKeyColor=2501FFEE | |
123 | +;Ch-07-ActiveKeyColor=FFC001EE | |
124 | +;Ch-08-ActiveKeyColor=01FFA2EE | |
125 | +;Ch-09-ActiveKeyColor=7F01FFEE | |
126 | +;Ch-10-ActiveKeyColor=DEFF01EE | |
127 | +;Ch-11-ActiveKeyColor=01FCFFEE | |
128 | +;Ch-12-ActiveKeyColor=DE01FFEE | |
129 | +;Ch-13-ActiveKeyColor=7FFF01EE | |
130 | +;Ch-14-ActiveKeyColor=019DFFEE | |
131 | +;Ch-15-ActiveKeyColor=FF01C0EE | |
132 | +;Ch-16-ActiveKeyColor=FF0161EE | |
133 | +;ActiveKeyColorDuration=400 | |
134 | +;ActiveKeyColorTailRate=0.5 | |
135 | +;KeyDispRangeStart=0 | |
136 | +;KeyDispRangeEnd=127 |