Skip to content

Instantly share code, notes, and snippets.

@themorgantown
Created July 17, 2017 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save themorgantown/6d06915b01c701c4b71a7c9bd02f8259 to your computer and use it in GitHub Desktop.
Save themorgantown/6d06915b01c701c4b71a7c9bd02f8259 to your computer and use it in GitHub Desktop.
//elements
hypeDocument.getElementById('score2').style.display = 'none';
hypeDocument.getElementById('cnote').style.display = 'none';
hypeDocument.getElementById('dnote').style.display = 'none';
hypeDocument.getElementById('bnote').style.display = 'none';
hypeDocument.getElementById('video2').play();
// This establishes the T1 variable as an integer.
var T1 = 0;
var T2 = 0;
var T3 = 0;
var T4 = 0;
var T5 = 0;
var T6 = 0;
var T7 = 0;
var T8 = 0;
var T9 = 0;
var T10 = 0;
var T11 = 0;
var T12 = 0;
var noteSets = [
{position:0, duration: 1, notes: [{pitch:53, step:3}]},
{position:1, duration: 1, notes: [{pitch:55, step:4}]},
];
var noteSetsB = [
{position:0, duration: 1, notes: [{pitch:57, step:5}]},
{position:1, duration: 1, notes: [{pitch:55, step:4}]},
];
var noteSetsC = [
{position:0, duration: 1, notes: [{pitch:53, step:3}]},
{position:1, duration: 1, notes: [{pitch:57, step:5}]},
];
var noteSetsD = [
{position:0, duration: 1, notes: [{pitch:52, step:2}]},
{position:1, duration: 1, notes: [{pitch:55, step:4}]},
];
// Listen to the 'timeupdate' value:
hypeDocument.getElementById('video2').addEventListener('timeupdate', function() {
var currentTime = hypeDocument.getElementById('video2').currentTime;
// If the current time is greater than 10, run the RedRobin timeline.
if (currentTime >= 71 && T1 == 0) {
//pause the video
hypeDocument.getElementById('video2').pause();
//fade in score
hypeDocument.getElementById('score2').style.display = 'block';
//paste noteSets
window.scoreView.pasteNoteSets(noteSets, 0, 0, 0);
window.scoreView.playFromMeasure(0);
window.scoreView.addEventListener('playbackStop', function(event) {
hypeDocument.getElementById('video2').play();
});
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 5.
T1 = T1 + 1;
}
if (currentTime >= 79.5 && T2 == 0) {
//pause the video
hypeDocument.getElementById('video2').pause();
//fade in score
hypeDocument.getElementById('score2').style.display = 'block';
//paste noteSetsB
window.scoreView.pasteNoteSets(noteSetsB, 0, 0, 0);
window.scoreView.playFromMeasure(0);
window.scoreView.addEventListener('playbackStop', function(event) {
hypeDocument.getElementById('video2').play();
});
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 5.
T2 = T2 + 1;
}
//start 3Ways
if (currentTime >= 36 && T3 == 0) {
hypeDocument.startTimelineNamed('3ways');
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 10.
T3 = T3 + 1;
}
//show C
if (currentTime >= 46 && T4 == 0) {
hypeDocument.getElementById('cnote').style.display = 'block';
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 10.
T4 = T4 + 1;
}
//show D
if (currentTime >= 47 && T5 == 0) {
hypeDocument.getElementById('dnote').style.display = 'block';
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 10.
T5 = T5 + 1;
}
//show B
if (currentTime >= 49.5 && T6 == 0) {
hypeDocument.getElementById('bnote').style.display = 'block';
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 10.
T6 = T6 + 1;
}
//hide notes
if (currentTime >= 51 && T7 == 0) {
hypeDocument.getElementById('cnote').style.display = 'none';
hypeDocument.getElementById('dnote').style.display = 'none';
hypeDocument.getElementById('bnote').style.display = 'none';
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 10.
T7 = T7 + 1;
}
//start intro
if (currentTime >= 9 && T8 == 0) {
hypeDocument.startTimelineNamed('intro');
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 10.
T8 = T8 + 1;
}
//start intro
if (currentTime >= 81 && T9 == 0) {
hypeDocument.goToTimeInTimelineNamed(30.0, '3ways');
hypeDocument.continueTimelineNamed('3ways');
hypeDocument.getElementById('score2').style.display = 'none';
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 10.
T9 = T9 + 1;
}
//jump to STEP assessment
if (currentTime >= 93.5 && T12 == 0) {
hypeDocument.showSceneNamed('3', hypeDocument.kSceneTransitionCrossfade, 1.1);
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 10.
T12 = T12 + 1;
}
// paste skip spaces
if (currentTime >= 117 && T10 == 0) {
//pause the video
hypeDocument.getElementById('video2').pause();
//fade in score
hypeDocument.getElementById('score2').style.display = 'block';
//paste noteSets
window.scoreView.pasteNoteSets(noteSetsC, 0, 0, 0);
window.scoreView.playFromMeasure(0);
window.scoreView.addEventListener('playbackStop', function(event) {
hypeDocument.getElementById('video2').play();
});
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 5.
T10 = T10 + 1;
}
// paste skip lines
if (currentTime >= 128 && T11 == 0) {
//pause the video
hypeDocument.getElementById('video2').pause();
//fade in score
hypeDocument.getElementById('score2').style.display = 'block';
//paste noteSets
window.scoreView.pasteNoteSets(noteSetsD, 0, 0, 0);
window.scoreView.playFromMeasure(0);
window.scoreView.addEventListener('playbackStop', function(event) {
hypeDocument.getElementById('video2').play();
});
// This ensures that the 'startTimelineNamed' action only occurs once, not at every point beyond time = 5.
T11 = T11 + 1;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment