@@ -113,21 +113,6 @@ let sliderIdLookups = {
113113function createWidgets ( ) {
114114 let settings = getDefaultSettings ( ) ;
115115
116- const sections = document . getElementsByClassName ( 'section' ) ;
117- for ( const section of sections ) {
118- if ( section . id === "input-section" ) {
119- settings . renderStages . push ( renderOriginal ) ;
120- } else if ( section . id === "delta-sigma-section" ) {
121- settings . renderStages . push ( renderDeltaSigma ) ;
122- } else if ( section . id === "filter-section" ) {
123- settings . renderStages . push ( applyAntialiasingFilter ) ;
124- } else if ( section . id === "samplerate-section" ) {
125- settings . renderStages . push ( downsampleWithQuantization )
126- } else if ( section . id === "reconstructed-section" ) {
127- settings . renderStages . push ( antiImagingFilter ) ;
128- }
129- }
130-
131116 const collapseButtons = document . getElementsByClassName ( "collapse-button" ) ;
132117 for ( const button of collapseButtons ) {
133118 button . textContent = "_" ;
@@ -168,7 +153,6 @@ function createWidgets() {
168153 if ( id in sliderIdLookups ) {
169154 const sketch = p => {
170155 p . sliderObject = new sliderIdLookups [ id ] ( ) ;
171-
172156 p . setup = function ( ) {
173157 let canvas = p . createCanvas ( 500 , 50 ) ;
174158 p . textAlign ( p . CENTER ) ;
@@ -182,6 +166,23 @@ function createWidgets() {
182166 }
183167 }
184168
169+ const sections = document . getElementsByClassName ( 'section' ) ;
170+ for ( const section of sections ) {
171+ if ( section . id === "input-section" ) {
172+ settings . renderStages . push ( renderOriginal ) ;
173+ } else if ( section . id === "delta-sigma-section" ) {
174+ settings . renderStages . push ( renderDeltaSigma ) ;
175+
176+ } else if ( section . id === "filter-section" ) {
177+ settings . renderStages . push ( applyAntialiasingFilter ) ;
178+ } else if ( section . id === "samplerate-section" ) {
179+ settings . renderStages . push ( downsampleWithQuantization )
180+ } else if ( section . id === "reconstructed-section" ) {
181+ settings . renderStages . push ( antiImagingFilter ) ;
182+ }
183+ }
184+
185+
185186 const playButtons = document . getElementsByClassName ( 'play-button' ) ;
186187
187188 function buttonPlayFunction ( buffer ) {
0 commit comments