|
@ -13,7 +13,13 @@ import D4Flute from "./samples/flute_samples/D4.wav"; |
|
|
import FSharp2Flute from "./samples/flute_samples/F#2.wav"; |
|
|
import FSharp2Flute from "./samples/flute_samples/F#2.wav"; |
|
|
import FSharp3Flute from "./samples/flute_samples/F#3.wav"; |
|
|
import FSharp3Flute from "./samples/flute_samples/F#3.wav"; |
|
|
import FSharp4Flute from "./samples/flute_samples/F#4.wav"; |
|
|
import FSharp4Flute from "./samples/flute_samples/F#4.wav"; |
|
|
import violaSample from "./samples/piano.mp3"; |
|
|
|
|
|
|
|
|
import C3Piano from "./samples/piano_samples/piano_C3.wav"; |
|
|
|
|
|
import D3Piano from "./samples/piano_samples/piano_D3.wav"; |
|
|
|
|
|
import E3Piano from "./samples/piano_samples/piano_E3.wav"; |
|
|
|
|
|
import F3Piano from "./samples/piano_samples/piano_F3.wav"; |
|
|
|
|
|
import G3Piano from "./samples/piano_samples/piano_G3.wav"; |
|
|
|
|
|
import A3Piano from "./samples/piano_samples/piano_A3.wav"; |
|
|
|
|
|
import B3Piano from "./samples/piano_samples/piano_B3.wav"; |
|
|
|
|
|
|
|
|
import { getMotifByVersion } from "./MotifHandler"; |
|
|
import { getMotifByVersion } from "./MotifHandler"; |
|
|
import { generateChord } from "./ChordHelper"; |
|
|
import { generateChord } from "./ChordHelper"; |
|
@ -22,8 +28,14 @@ const drumSynth = new Tone.Sampler({ |
|
|
C3: drumSample, |
|
|
C3: drumSample, |
|
|
}).toDestination(); |
|
|
}).toDestination(); |
|
|
|
|
|
|
|
|
const violaSynth = new Tone.Sampler({ |
|
|
|
|
|
C1: violaSample, |
|
|
|
|
|
|
|
|
const pianoSynth = new Tone.Sampler({ |
|
|
|
|
|
C2: C3Piano, |
|
|
|
|
|
D2: D3Piano, |
|
|
|
|
|
E2: E3Piano, |
|
|
|
|
|
F2: F3Piano, |
|
|
|
|
|
G2: G3Piano, |
|
|
|
|
|
A2: A3Piano, |
|
|
|
|
|
B2: B3Piano, |
|
|
}).toDestination(); |
|
|
}).toDestination(); |
|
|
|
|
|
|
|
|
const fluteSynth = new Tone.Sampler({ |
|
|
const fluteSynth = new Tone.Sampler({ |
|
@ -58,16 +70,18 @@ const calculateDetailMotifVersion = function (textDensity, linkDensity) { |
|
|
return 3 * textDensity + linkDensity; |
|
|
return 3 * textDensity + linkDensity; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// C-Major Chord Progression |
|
|
|
|
|
|
|
|
// D-Major Chord Progression |
|
|
|
|
|
// Tried out all major pop song chord progressions |
|
|
|
|
|
// C-Major, D-Major, G-Major and A-Major. This sounded best... |
|
|
const tabChordProgression = [ |
|
|
const tabChordProgression = [ |
|
|
generateChord(84, "major"), |
|
|
|
|
|
generateChord(86, "minor"), |
|
|
|
|
|
generateChord(88, "minor"), |
|
|
|
|
|
generateChord(89, "major"), |
|
|
|
|
|
generateChord(91, "major"), |
|
|
|
|
|
generateChord(93, "minor"), |
|
|
|
|
|
generateChord(95, "diminished"), |
|
|
|
|
|
generateChord(96, "major"), |
|
|
|
|
|
|
|
|
generateChord(62, "major"), |
|
|
|
|
|
generateChord(64, "minor"), |
|
|
|
|
|
generateChord(66, "minor"), |
|
|
|
|
|
generateChord(67, "major"), |
|
|
|
|
|
generateChord(69, "major"), |
|
|
|
|
|
generateChord(71, "minor"), |
|
|
|
|
|
generateChord(73, "diminished"), |
|
|
|
|
|
generateChord(74, "major"), |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
var offCooldown = true; |
|
|
var offCooldown = true; |
|
@ -105,6 +119,7 @@ const calculatePlayedTabChord = function (endReached, tabIndex, tabAmount) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// Maybe also dat... |
|
|
// Maybe also dat... |
|
|
|
|
|
// Done maybe add spatiality and/or end tab jingle |
|
|
export function playTabEarconSonification(endReached, tabIndex, tabAmount) { |
|
|
export function playTabEarconSonification(endReached, tabIndex, tabAmount) { |
|
|
if (offCooldown) { |
|
|
if (offCooldown) { |
|
|
const now = Tone.now(); |
|
|
const now = Tone.now(); |
|
@ -113,7 +128,7 @@ export function playTabEarconSonification(endReached, tabIndex, tabAmount) { |
|
|
tabIndex, |
|
|
tabIndex, |
|
|
tabAmount |
|
|
tabAmount |
|
|
); |
|
|
); |
|
|
violaSynth.triggerAttackRelease( |
|
|
|
|
|
|
|
|
pianoSynth.triggerAttackRelease( |
|
|
tabChordProgression[tabChordIndex], |
|
|
tabChordProgression[tabChordIndex], |
|
|
"4n", |
|
|
"4n", |
|
|
now |
|
|
now |
|
@ -161,11 +176,10 @@ export function playTabModelSonification(pannerVal, frequencyVal, endReached) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Menu Sonification Paper. :) |
|
|
|
|
|
|
|
|
// Done maybe add spatiality... |
|
|
export function playDetailEarconSonification(textDensity, linkDensity) { |
|
|
export function playDetailEarconSonification(textDensity, linkDensity) { |
|
|
if (offCooldown) { |
|
|
if (offCooldown) { |
|
|
const synth = fluteSynth.toDestination(); |
|
|
const synth = fluteSynth.toDestination(); |
|
|
console.log(calculateDetailMotifVersion(textDensity, linkDensity)); |
|
|
|
|
|
getMotifByVersion( |
|
|
getMotifByVersion( |
|
|
calculateDetailMotifVersion(textDensity, linkDensity), |
|
|
calculateDetailMotifVersion(textDensity, linkDensity), |
|
|
synth |
|
|
synth |
|
|