Skip to content

Commit 1bae99c

Browse files
committed
New source for MP3 files.
1 parent 93cdc4b commit 1bae99c

File tree

4 files changed

+37
-38
lines changed

4 files changed

+37
-38
lines changed

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ google_analytics: "UA-96036055-1"
4949

5050
# data (PDFs, MP3s, etc)
5151
tasso_data_url: "https://josquin.stanford.edu/cgi-bin/tasso"
52+
tasso_data_url_new: "https://data.tassomusic.org"
5253

5354
url: "https://www.tassomusic.org"
5455

scripts/scripts-common.js

+21-28
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ const RightArrowKey = 39; // maybe also 29 & 57376
172172

173173
//////////////////////////////
174174
//
175-
// InitializeWorklistFlat -- Create a flattened list of works. Two
176-
// (global) objects will be created from the WORKLIST object:
177-
// (1) WORKLISTrecent -- an array which is a list of works
178-
// reverse-sorted by date added. Also stored in
175+
// InitializeWorklistFlat -- Create a flattened list of works. Two
176+
// (global) objects will be created from the WORKLIST object:
177+
// (1) WORKLISTrecent -- an array which is a list of works
178+
// reverse-sorted by date added. Also stored in
179179
// sessionStorage.WORKLISTrecent.
180180
// (2) WORKLISTjrpid -- an object which contains works indexed by
181181
// JRP ID. Also stored in sessionStorage.WORKLISTjrpid.
@@ -228,7 +228,7 @@ function byReverseAddDate(a, b) {
228228
if (!date2) { date2 = b.ad; }
229229
if (!date1) { date1 = 0; }
230230
if (!date2) { date2 = 0; }
231-
if (date1 > date2) { return -1; }
231+
if (date1 > date2) { return -1; }
232232
if (date1 < date2) { return +1; }
233233
if (a.id < b.id) { return -1; }
234234
if (a.id > b.id) { return +1; }
@@ -250,7 +250,7 @@ function GetDataFile(jrpid, prefix, action) {
250250
if (typeof sessionStorage[variable] != 'undefined') {
251251
return sessionStorage[variable];
252252
}
253-
253+
254254
InitializeWorklistFlat();
255255

256256
// Get the first section's incipit if a multi-section work:
@@ -288,7 +288,7 @@ function GetDataFileAsync(jrpid, prefix, action, callback) {
288288
if (typeof sessionStorage[variable] != 'undefined') {
289289
return sessionStorage[variable];
290290
}
291-
291+
292292
InitializeWorklistFlat();
293293

294294
// Get the first section's incipit if a multi-section work:
@@ -324,7 +324,7 @@ function GetDataFileAsync(jrpid, prefix, action, callback) {
324324
// XMLHttpRequest object:
325325
// https://www.w3.org/TR/2007/WD-XMLHttpRequest-20070618
326326
// https://xhr.spec.whatwg.org
327-
//
327+
//
328328
// See:
329329
// https://codingforums.com/ajax-design/123705-make-script-wait-until-request-comes-back.html
330330
//
@@ -425,14 +425,14 @@ function GetComposerOptions() {
425425

426426
//////////////////////////////
427427
//
428-
// GetGenreOptions -- Return an option list of genres.
429-
// This is used to fill in the Composer/Repertory section list
428+
// GetGenreOptions -- Return an option list of genres.
429+
// This is used to fill in the Composer/Repertory section list
430430
// in forms on various webpages. If there is an input repe
431431
// Mass, Motet, or Song.
432432
//
433433

434434
function GetGenreOptions(repertory) {
435-
if ((typeof repertory === 'undefined') ||
435+
if ((typeof repertory === 'undefined') ||
436436
(repertory == null) || (repertory == '')) {
437437
// Avoiding displaying the genre list without a repertory.
438438
// This is because analyses mostly need to be limited to a single repertory
@@ -488,8 +488,8 @@ function GetGenreOptions(repertory) {
488488

489489
//////////////////////////////
490490
//
491-
// GetGenreBrowseOptions -- Return an option list of genres.
492-
// This is used to fill in the Composer/Repertory section list
491+
// GetGenreBrowseOptions -- Return an option list of genres.
492+
// This is used to fill in the Composer/Repertory section list
493493
// in forms on various webpages. If there is an input repe
494494
// Mass, Motet, or Song.
495495
//
@@ -540,8 +540,8 @@ function GetGenreBrowseOptions() {
540540
// GetWorkOptions -- Return an option list of works (for a specific
541541
// repertory and genre. The repertory is required, the genre
542542
// is optional (show all works regardless of genre in that case).
543-
// This is used to fill in the Work section list in forms on
544-
// various webpages.
543+
// This is used to fill in the Work section list in forms on
544+
// various webpages.
545545
//
546546

547547
function GetWorkOptions(repertory, genre) {
@@ -683,7 +683,6 @@ function PlayAudioFile(jrpid, element, starttime) {
683683
TurnOffAllNotes();
684684
}
685685

686-
687686
var audiobutton;
688687
if (jrpid != AUDIOjrpid) {
689688
if (!!AUDIOid) {
@@ -703,13 +702,7 @@ function PlayAudioFile(jrpid, element, starttime) {
703702
AUDIOid = element.id;
704703
var source = '';
705704
// Can't have seekable dynamic content in audio element:
706-
//source += '<source src="/data?a=mp3&id=' + jrpid + '" ';
707-
if (window.location.href.match(/tasso/i)) {
708-
source += '<source src="https://josquin.stanford.edu/audio/mp3/' + jrpid + '.mp3" ';
709-
} else {
710-
source += '<source src="https://josquin.stanford.edu/audio/mp3/' + jrpid + '.mp3" ';
711-
}
712-
source += 'type="audio/mpeg"/>\n';
705+
source += `<source src="{{site.tasso_data_url_new}}/${jrpid}.mp3" type="audio/mpeg"/>\n`;
713706
AUDIO.innerHTML = source;
714707

715708
AUDIOjrpid = jrpid;
@@ -901,7 +894,7 @@ function ClearWorklistCache() {
901894

902895
//////////////////////////////
903896
//
904-
// audioStoppedAction --
897+
// audioStoppedAction --
905898
//
906899

907900
function audioStoppedAction(event) {
@@ -967,7 +960,7 @@ function GetRimeTitle(rimenum, rimelist) {
967960

968961
//////////////////////////////
969962
//
970-
// GetAllSettingEntry --
963+
// GetAllSettingEntry --
971964
//
972965

973966
function GetAllSettingEntry(catalognum, worklist) {
@@ -998,7 +991,7 @@ function GetAllSettingEntry(catalognum, worklist) {
998991

999992
//////////////////////////////
1000993
//
1001-
// GetAllSettingEntryList --
994+
// GetAllSettingEntryList --
1002995
//
1003996

1004997
function GetAllSettingEntryList(catalognum, worklist) {
@@ -1033,7 +1026,7 @@ function GetAllSettingEntryList(catalognum, worklist) {
10331026

10341027
//////////////////////////////
10351028
//
1036-
// GetRimeVerseEntry --
1029+
// GetRimeVerseEntry --
10371030
//
10381031

10391032

@@ -1405,7 +1398,7 @@ function ExternalLinksToNewTab() {
14051398
///////////////////////////////////////////////////////////////////////////
14061399
//
14071400
// TASSODATA PROCESSING FUNCTIONS
1408-
//
1401+
//
14091402

14101403
//////////////////////////////
14111404
//

work/scripts-local.html

+11-6
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@
173173
}
174174

175175
let request = new XMLHttpRequest();
176-
request.open("GET", "{{site.tasso_data_url}}?a=timemap&f=" + id);
176+
// let url = `{{site.tasso_data_url}}?a=timemap&f=${id}`;
177+
let url = `{{site.tasso_data_url_new}}/${id}-timemap.json`;
178+
request.open("GET", url);
177179
request.addEventListener("load", function() {
178180
TIMEMAP[id] = JSON.parse(this.responseText);
179181
interpolateIntegers(id);
@@ -1505,7 +1507,8 @@
15051507
}
15061508

15071509
let action = "humdrum";
1508-
let url = "{{site.tasso_data_url}}/?a=" + action + "&id=" + id
1510+
// let url = "{{site.tasso_data_url}}/?a=" + action + "&id=" + id
1511+
let url = `{{site.tasso_data_url_new}}/${id}.krn`;
15091512
let request = new XMLHttpRequest();
15101513
request.open('GET', url);
15111514
request.addEventListener("load", function() {
@@ -1609,8 +1612,9 @@
16091612
return;
16101613
}
16111614

1612-
let action = "prange-svg";
1613-
let url = "{{site.tasso_data_url}}/?a=" + action + "&id=" + id
1615+
// let action = "prange-svg";
1616+
// let url = "{{site.tasso_data_url}}/?a=" + action + "&id=" + id
1617+
let url = `{{site.tasso_data_url_new}}/${id}-prange-attack.svg`;
16141618
let request = new XMLHttpRequest();
16151619
request.open('GET', url);
16161620
request.addEventListener("load", function() {
@@ -1977,8 +1981,9 @@
19771981
keysigcell.innerHTML = keysig;
19781982
timecell.innerHTML = metsig;
19791983
} else {
1980-
let action = "humdrum";
1981-
let url = "{{site.tasso_data_url}}/?a=" + action + "&id=" + id;
1984+
// let action = "humdrum";
1985+
// let url = "{{site.tasso_data_url}}/?a=" + action + "&id=" + id;
1986+
let url = `{{site.tasso_data_url_new}}/${id}.krn`;
19821987
let request = new XMLHttpRequest();
19831988
request.open('GET', url);
19841989
request.addEventListener("load", function() {

work/templates.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,15 @@ <h2>{{{formatComposer COMPOSER}}}<br>{{{formatTitle TITLE CATALOGNUM}}}</h2>
330330
</tr>
331331

332332
<tr>
333-
<td><ul><li> <a class="icon-midi" target="_blank" href="{%endraw%}{{site.tasso_data_url}}{%raw%}?a=midi&f={{CATALOGNUM}}">MIDI</a></li></ul></td>
333+
<td><ul><li> <a class="icon-midi" target="_blank" href="{%endraw%}{{site.tasso_data_url_new}}{%raw%}/{{CATALOGNUM}}.mid">MIDI</a></li></ul></td>
334334
<td><ul><li> <nobr><a class="icon-list" target="_blank" href="{{SCOREDATA.EDITURL}}">Humdrum <small>(on Github)</small></a></nobr></li></ul></td>
335-
<td><ul><li> <a class="icon-list" href="{%endraw%}{{site.tasso_data_url}}{%raw%}?a=musedata&f={{CATALOGNUM}}">Musedata</a></li></ul></td>
335+
<td><ul><li> <a class="icon-list" href="{%endraw%}{{site.tasso_data_url_new}}{%raw%}/{{CATALOGNUM}}.mds">MuseData</a></li></ul></td>
336336
</tr>
337337

338338
<tr>
339-
<td><ul><li> <a class="icon-file-list" target="_blank" href="{%endraw%}{{site.tasso_data_url}}{%raw%}?a=mp3&f={{CATALOGNUM}}">MP3</a></li></ul></td>
339+
<td><ul><li> <a class="icon-file-list" target="_blank" href="{%endraw%}{{site.tasso_data_url_new}}{%raw%}/{{CATALOGNUM}}.mp3">MP3</a></li></ul></td>
340340
<td><ul><li> <a class="icon-list" target="_blank" href="https://verovio.humdrum.org/?file={{SCOREDATA.DATAURL}}">Humdrum <small>(in VHV)</small></a></li></ul></td>
341-
<td colspan="2"><ul><li> <a class="icon-list" href="{%endraw%}{{site.tasso_data_url}}{%raw%}?a=musicxml&f={{CATALOGNUM}}">MusicXML</a> <small>(for Finale/<a target="_blank" href="https://www.musescore.org">MuseScore</a>/Sibelius)</li></ul></td>
341+
<td colspan="2"><ul><li> <a class="icon-list" href="{%endraw%}{{site.tasso_data_url_new}}{%raw%}/{{CATALOGNUM}}.musicxml">MusicXML</a> <small>(for <a target="_blank" href="https://www.musescore.org">MuseScore</a>/Dorico/Finale/Sibelius)</li></ul></td>
342342
</tr>
343343

344344
</table>

0 commit comments

Comments
 (0)