@@ -1960,17 +1960,17 @@ void CPatternEditor::DrawRegisters(CDC *pDC)
1960
1960
DrawVolBar ();
1961
1961
1962
1962
// 3db per step
1963
- const double vol = envelope_enable ? 1 : (std::pow (10.0 , (((Volume + 1.0 ) * 3.0 ) / 20.0 )) / 251.18864315095801110850320677993 );
1963
+ double vol = envelope_enable ? 1 : (std::pow (10.0 , (((Volume + 1.0 ) * 3.0 ) / 20.0 )) / 251.18864315095801110850320677993 );
1964
1964
1965
- const BYTE vol_scaled = OETF_gamma_vol (Volume );
1965
+ const BYTE vol_scaled = OETF_gamma_vol (vol );
1966
1966
1967
1967
const double note = NoteFromFreq (Freq);
1968
1968
const double note_envelope = NoteFromFreq (EnvelopeFreq);
1969
1969
const double note_noise = ((108.0 / double (0x1F )) * double (0x1F - NoisePeriod)) - 12.0 ;
1970
1970
const int note_conv = note >= 0 ? int (note + 0.5 ) : int (note - 0.5 );
1971
1971
1972
1972
1973
- if (note_conv >= -12 && note_conv <= 96 && (vol_scaled || envelope_enable)) // // //
1973
+ if (note_conv >= -12 && note_conv <= 96 && (Volume || envelope_enable)) // // //
1974
1974
if (noise_enable || envelope_enable)
1975
1975
DrawVolNote (PrecisePitch ? note : note_conv, vol_scaled, // !! !!
1976
1976
CTINT_S5B_T[0 ], CTINT_S5B_T[1 ], CTINT_S5B_T[2 ]);
@@ -1987,6 +1987,24 @@ void CPatternEditor::DrawRegisters(CDC *pDC)
1987
1987
++vis_line;
1988
1988
};
1989
1989
1990
+ // Draw envelope and noise pitch
1991
+ const auto DrawVolFuncVRC7 = [&](double Freq, int Volume) {
1992
+ DrawVolBar ();
1993
+
1994
+ // 3db per step
1995
+ const double vol = std::pow (10.0 , (((Volume + 1.0 ) * 3.0 ) / 20.0 )) / 251.18864315095801110850320677993 ;
1996
+
1997
+ const BYTE vol_scaled = OETF_gamma_vol (vol);
1998
+
1999
+ const double note = NoteFromFreq (Freq);
2000
+ const int note_conv = note >= 0 ? int (note + 0.5 ) : int (note - 0.5 );
2001
+
2002
+
2003
+ if (note_conv >= -12 && note_conv <= 96 && vol_scaled) // // //
2004
+ DrawVolNote (PrecisePitch ? note : note_conv, vol_scaled);
2005
+ ++vis_line;
2006
+ };
2007
+
1990
2008
const auto DrawTextFunc = [&] (int xOffsNoDPI, CString text) {
1991
2009
pDC->SetTextColor (BORDER_COLOR);
1992
2010
pDC->SetTextAlign (TA_NOUPDATECP);
@@ -2282,7 +2300,7 @@ void CPatternEditor::DrawRegisters(CDC *pDC)
2282
2300
text.Format (_T (" %s, vol = %02i, patch = $%01X" ), GetPitchTextFunc (3 , period, freq), vol, reg[2 ] >> 4 );
2283
2301
DrawTextFunc (180 , text);
2284
2302
2285
- DrawVolFunc (freq, ( double ) vol/( double ) 0x0F );
2303
+ DrawVolFuncVRC7 (freq, vol);
2286
2304
}
2287
2305
}
2288
2306
0 commit comments