Skip to content

Commit

Permalink
JSDoc styling comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ricknjacky committed Jan 26, 2021
1 parent 5f87d52 commit b9c7263
Showing 1 changed file with 85 additions and 7 deletions.
92 changes: 85 additions & 7 deletions js/widgets/temperament.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,12 @@ class TemperamentWidget {
this.showNoteInfo(e);
});
};

/**
* Triggered when the a note is pressed.
*
* @param {Object} event
* @returns {void}
*/
showNoteInfo = (event) => {
let x, y, frequency, noteDefined;
let cents, centsDiff, centsDiff1, min, index;
Expand Down Expand Up @@ -395,6 +400,13 @@ class TemperamentWidget {
}
};

/**
* Triggered when the user wants to edit frequency.
*
* @param {Object} event
* @returns {void}
*/

editFrequency = (event) => {
const i = Number(event.target.dataset.message);

Expand Down Expand Up @@ -457,6 +469,13 @@ class TemperamentWidget {
docById("noteInfo").remove();
};
};
/**
* Triggered when graph of notes UI element is stelected
* displays circular graph of all the notes present.
*
* @param {Object} event
* @returns {void}
*/

_graphOfNotes() {
this.circleIsVisible = true;
Expand Down Expand Up @@ -628,7 +647,11 @@ class TemperamentWidget {
}
}
};

/**
* Triggerred when any one of the UI edit elemnts is selected
*
* @returns {void}
*/
edit() {
this.editMode = null ;
logo.synth.setMasterVolume(0);
Expand Down Expand Up @@ -697,6 +720,12 @@ class TemperamentWidget {
};
};

/**
* Triggerred when the Equal edit option is selected,
*
* @returns {void}
*/

equalEdit() {
this.editMode = "equal";
docById("userEdit").innerHTML = "";
Expand Down Expand Up @@ -875,7 +904,11 @@ class TemperamentWidget {
};
}
});
}
}/**
* Triggerred when the Ratios edit option is selected,
*
* @returns {void}
*/

ratioEdit() {
this.editMode = "ratio";
Expand Down Expand Up @@ -1050,6 +1083,11 @@ class TemperamentWidget {
}
};
};
/**
* Triggerred when the Arbitrary edit option is selected,
*
* @returns {void}
*/

arbitraryEdit() {
this.editMode = "arbitrary";
Expand Down Expand Up @@ -1273,7 +1311,12 @@ class TemperamentWidget {
this._circleOfNotes();
};
}

/**
* Triggerred when in Arbritrary edit option
* The slider with option to slide the values of frequesncies opens.
*
* @returns {void}
*/
arbitraryEditSlider (event, angle, ratios, pitchNumber) {
const frequency = this.frequencies[0];
const frequencies = [];
Expand Down Expand Up @@ -1325,7 +1368,12 @@ class TemperamentWidget {
}
}
}

/**
* Triggerred when in Arbritrary edit option
* The slider with option to slide the values of frequesncies opens for a refreshed value.
*
* @returns {void}
*/
_refreshInnerWheel() {
docById("frequencydiv").innerHTML = docById("frequencySlider").value;
const frequency = docById("frequencySlider").value;
Expand Down Expand Up @@ -1360,7 +1408,11 @@ class TemperamentWidget {
);
this._createInnerWheel(this.tempRatios, pitchNumber);
};

/**
* Triggerred when in octave space edit option.
*
* @returns {void}
*/
octaveSpaceEdit() {
this.editMode = "octave";
docById("userEdit").innerHTML = "";
Expand Down Expand Up @@ -1423,6 +1475,11 @@ class TemperamentWidget {
this._circleOfNotes();
};
}
/**
* Checks for temperament
*
* @returns {void}
*/

checkTemperament(ratios) {
const intervals = [];
Expand Down Expand Up @@ -1457,7 +1514,11 @@ class TemperamentWidget {
temperamentCell.innerHTML = this.inTemperament;
}
}

/**
* Triggerred when Save button is pressed. New action blocks are generated.
*
* @returns {void}
*/
_save() {
let notesMatch = false;
// let index = [];
Expand Down Expand Up @@ -1772,6 +1833,12 @@ class TemperamentWidget {
logo.blocks.palettes.updatePalettes("pitch");
}
}
/**
* Triggerred when play button is pressed on a single note in table
*Notes are displayed in sequence and can be played one after another
*
* @returns {void}
*/

playNote(pitchNumber) {
logo.resetSynth(0);
Expand All @@ -1796,6 +1863,12 @@ class TemperamentWidget {
null
);
}
/**
* Triggerred when play button is pressed
*All Notes are played in sequence from the start.
*
* @returns {void}
*/

playAll() {
let p = 0;
Expand Down Expand Up @@ -2008,6 +2081,11 @@ class TemperamentWidget {
__playLoop(0);
}
}
/**
* Initialises the temperament widget
*
* @returns {void}
*/

init() {

Expand Down

0 comments on commit b9c7263

Please sign in to comment.