in charts/shared/sonic.js [727:779]
async function blah() {
// uncomment to make testing synth / audio context faster
// await self.beep(440)
let lowestY = self.domainY[0]
let highestY = self.domainY[1]
if ("invertY" in self.settings) {
if (self.settings.invertY) {
lowestY = self.domainY[1]
highestY = self.domainY[0]
}
}
let lowestX = self.domainX[0]
let highestX = self.domainX[1]
let lowestXStr = lowestX
let highestXStr = highestX
if (self.settings.xFormat.date) {
lowestXStr = xvarFormatSpeech(self.domainX[0], self.timeSettings.suggestedFormat)
highestXStr = xvarFormatSpeech(self.domainX[1], self.timeSettings.suggestedFormat)
}
let lowestYStr = lowestY
let highestYStr = highestY
if (typeof lowestY == 'number') {
lowestYStr = numberFormatSpeech(lowestY)
highestYStr = numberFormatSpeech(highestY)
}
self.furniturePlaying = true
const text1 = await self.speaker(`The lowest value on the chart is ${lowestYStr}, and it sounds like `)
self.animateCircle(self.lowestVal[self.xVar],self.lowestVal.value, self.lowestVal.key)
const beep1 = await self.beep(self.scale(lowestY))
await timer(1200);
const text2 = await self.speaker(`The highest value on the chart is ${highestYStr}, and it sounds like `)
self.animateCircle(self.highestVal[self.xVar],self.highestVal.value, self.highestVal.key)
const beep2 = await self.beep(self.scale(highestY))
await timer(1200);
if (self.audioRendering == "discrete" || self.audioRendering == "continuous") {
const text3 = await self.speaker(`Each note is a ${self.interval}, and the chart goes from ${lowestXStr} to ${highestXStr}`)
}
self.furniturePlaying = false
resolve({ status : "success"})
}