@@ -211,7 +211,10 @@ export class SongEditor {
211211 private readonly _pulseWidthSlider : Slider = new Slider ( input ( { style : "margin: 0;" , type : "range" , min : "0" , max : Config . pulseWidthRange - 1 , value : "0" , step : "1" } ) , this . _doc , ( oldValue : number , newValue : number ) => new ChangePulseWidth ( this . _doc , oldValue , newValue ) ) ;
212212 private readonly _pulseWidthRow : HTMLDivElement = div ( { class : "selectRow" } , span ( { class : "tip" , onclick : ( ) => this . _openPrompt ( "pulseWidth" ) } , "Pulse Width:" ) , this . _pulseWidthSlider . input ) ;
213213 private readonly _pitchShiftSlider : Slider = new Slider ( input ( { style : "margin: 0;" , type : "range" , min : "0" , max : Config . pitchShiftRange - 1 , value : "0" , step : "1" } ) , this . _doc , ( oldValue : number , newValue : number ) => new ChangePitchShift ( this . _doc , oldValue , newValue ) ) ;
214- private readonly _pitchShiftRow : HTMLDivElement = div ( { class : "selectRow" } , span ( { class : "tip" , onclick : ( ) => this . _openPrompt ( "pitchShift" ) } , "Pitch Shift:" ) , this . _pitchShiftSlider . input ) ;
214+ private readonly _pitchShiftTonicMarkers : HTMLDivElement [ ] = [ div ( { class : "pitchShiftMarker" , style : { color : ColorConfig . tonic } } ) , div ( { class : "pitchShiftMarker" , style : { color : ColorConfig . tonic , left : "50%" } } ) , div ( { class : "pitchShiftMarker" , style : { color : ColorConfig . tonic , left : "100%" } } ) ] ;
215+ private readonly _pitchShiftFifthMarkers : HTMLDivElement [ ] = [ div ( { class : "pitchShiftMarker" , style : { color : ColorConfig . fifthNote , left : ( 100 * 7 / 24 ) + "%" } } ) , div ( { class : "pitchShiftMarker" , style : { color : ColorConfig . fifthNote , left : ( 100 * 19 / 24 ) + "%" } } ) ] ;
216+ private readonly _pitchShiftMarkerContainer : HTMLDivElement = div ( { style : "display: flex; position: relative;" } , this . _pitchShiftSlider . input , div ( { class : "pitchShiftMarkerContainer" } , this . _pitchShiftTonicMarkers , this . _pitchShiftFifthMarkers ) ) ;
217+ private readonly _pitchShiftRow : HTMLDivElement = div ( { class : "selectRow" } , span ( { class : "tip" , onclick : ( ) => this . _openPrompt ( "pitchShift" ) } , "Pitch Shift:" ) , this . _pitchShiftMarkerContainer ) ;
215218 private readonly _detuneSlider : Slider = new Slider ( input ( { style : "margin: 0;" , type : "range" , min : "0" , max : Config . detuneMax , value : "0" , step : "1" } ) , this . _doc , ( oldValue : number , newValue : number ) => new ChangeDetune ( this . _doc , oldValue , newValue ) ) ;
216219 private readonly _detuneRow : HTMLDivElement = div ( { class : "selectRow" } , span ( { class : "tip" , onclick : ( ) => this . _openPrompt ( "detune" ) } , "Detune:" ) , this . _detuneSlider . input ) ;
217220 private readonly _distortionSlider : Slider = new Slider ( input ( { style : "margin: 0;" , type : "range" , min : "0" , max : Config . distortionRange - 1 , value : "0" , step : "1" } ) , this . _doc , ( oldValue : number , newValue : number ) => new ChangeDistortion ( this . _doc , oldValue , newValue ) ) ;
@@ -762,6 +765,9 @@ export class SongEditor {
762765 this . _pitchShiftRow . style . display = "" ;
763766 this . _pitchShiftSlider . updateValue ( instrument . pitchShift ) ;
764767 this . _pitchShiftSlider . input . title = ( instrument . pitchShift - Config . pitchShiftCenter ) + " semitone(s)" ;
768+ for ( const marker of this . _pitchShiftFifthMarkers ) {
769+ marker . style . display = this . _doc . showFifth ? "" : "none" ;
770+ }
765771 } else {
766772 this . _pitchShiftRow . style . display = "none" ;
767773 }
0 commit comments