Deploy site [CI SKIP]
This commit is contained in:
parent
d49206f214
commit
d3d92999ce
4 changed files with 1 additions and 67 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en"><head>
|
<html lang="en"><head>
|
||||||
<script src="site_libs/tone/tone.js"></script>
|
|
||||||
<script src="site_libs/clipboard/clipboard.min.js"></script>
|
<script src="site_libs/clipboard/clipboard.min.js"></script>
|
||||||
<script src="site_libs/quarto-html/tabby.min.js"></script>
|
<script src="site_libs/quarto-html/tabby.min.js"></script>
|
||||||
<script src="site_libs/quarto-html/popper.min.js"></script>
|
<script src="site_libs/quarto-html/popper.min.js"></script>
|
||||||
|
|
@ -5932,7 +5931,6 @@
|
||||||
<script src="site_libs/revealjs/plugin/pdf-export/pdfexport.js"></script>
|
<script src="site_libs/revealjs/plugin/pdf-export/pdfexport.js"></script>
|
||||||
<script src="site_libs/revealjs/plugin/reveal-menu/menu.js"></script>
|
<script src="site_libs/revealjs/plugin/reveal-menu/menu.js"></script>
|
||||||
<script src="site_libs/revealjs/plugin/reveal-menu/quarto-menu.js"></script>
|
<script src="site_libs/revealjs/plugin/reveal-menu/quarto-menu.js"></script>
|
||||||
<script src="site_libs/revealjs/plugin/quarto-tone/tone.js"></script>
|
|
||||||
<script src="site_libs/revealjs/plugin/quarto-support/support.js"></script>
|
<script src="site_libs/revealjs/plugin/quarto-support/support.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6125,7 +6123,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
// reveal.js plugins
|
// reveal.js plugins
|
||||||
plugins: [QuartoLineHighlight, PdfExport, RevealMenu, QuartoTone, QuartoSupport,
|
plugins: [QuartoLineHighlight, PdfExport, RevealMenu, QuartoSupport,
|
||||||
|
|
||||||
RevealMath,
|
RevealMath,
|
||||||
RevealNotes,
|
RevealNotes,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
# adapted from https://github.com/gadenbuie/xaringanExtra/blob/master/docs/slide-tone/libs/slide-tone/slide-tone.js
|
|
||||||
name: QuartoTone
|
|
||||||
script: tone.js
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
window.QuartoTone = function () {
|
|
||||||
return {
|
|
||||||
id: "quarto-tone",
|
|
||||||
init: function (deck) {
|
|
||||||
function slideToneScale(i) {
|
|
||||||
// https://www.intmath.com/trigonometric-graphs/music.php
|
|
||||||
const note = 15 - (deck.getTotalSlides() - i);
|
|
||||||
return 440 * 2 ** (note / 12);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sliding tones between C3 and C5 with equal steps between tones
|
|
||||||
* but not aligned to musical scale
|
|
||||||
*/
|
|
||||||
function slideToneBounded(i, lower = 261.63, upper = 1046.5) {
|
|
||||||
const step = (upper - lower) / deck.getTotalSlides();
|
|
||||||
return lower + step * i;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Choose slide tone scale automatically based on number of slides.
|
|
||||||
* If there are <= 32 slides, use musical scale.
|
|
||||||
*/
|
|
||||||
function slideToneAuto(toneIdx) {
|
|
||||||
return deck.getTotalSlides() > 32
|
|
||||||
? slideToneBounded(toneIdx)
|
|
||||||
: slideToneScale(toneIdx);
|
|
||||||
}
|
|
||||||
|
|
||||||
const synth = new Tone.Synth({
|
|
||||||
oscillator: {
|
|
||||||
type: "sine",
|
|
||||||
},
|
|
||||||
envelope: {
|
|
||||||
attack: 0.001,
|
|
||||||
decay: 0.2,
|
|
||||||
sustain: 0.2,
|
|
||||||
release: 1,
|
|
||||||
},
|
|
||||||
}).toMaster();
|
|
||||||
|
|
||||||
const playTone = () => {
|
|
||||||
synth.triggerAttackRelease(
|
|
||||||
slideToneAuto(deck.getSlidePastCount()),
|
|
||||||
"8n"
|
|
||||||
);
|
|
||||||
};
|
|
||||||
deck.on("slidechanged", playTone);
|
|
||||||
deck.on("fragmentshown", playTone);
|
|
||||||
deck.on("fragmenthidden", playTone);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue