From a7fdbf635b4b785be8aff99c5f7db11017a27b81 Mon Sep 17 00:00:00 2001 From: Liam Pond Date: Mon, 9 Sep 2024 12:59:50 -0400 Subject: [PATCH 1/5] Added `treble_voice` argument to raise playback pitch by an octave --- .env.sample | 17 ----------------- .../manuscript-detail/folio/ChantRecordView.js | 8 +++++++- 2 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 .env.sample diff --git a/.env.sample b/.env.sample deleted file mode 100644 index b44b0125..00000000 --- a/.env.sample +++ /dev/null @@ -1,17 +0,0 @@ -APP_VERSION=3.2-0.12.1 -COMPOSE_PROJECT_NAME=cantus - -#When DEVELOPMENT is False, Django's DEBUG setting -#is False and app is served by gunicorn -DEVELOPMENT=False -#DJANGO_SECRET_KEY=**PROVIDE SECRET KEY HERE** - -#Postgres authentication variables -POSTGRES_DB=cantus_db -POSTGRES_USER=cantus_admin -#POSTGRES_PASSWORD=**PROVIDE PASSWORD HERE** - -#RabbitMQ authentication variables -RABBIT_VHOST=cantus_ultimus -RABBIT_USER=cantus_admin -#RABBIT_PASSWORD=**PROVIDE PASSWORD HERE** diff --git a/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js b/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js index fbe89e34..0e4b5524 100644 --- a/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js +++ b/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js @@ -99,7 +99,7 @@ function handleFlats (inputStr){ /////////////////////////////////////////////////////////////////////////////////// //Plays the volpiano notes using MIDI.js -function volpiano2midi(input_arr, note_dur) { +function volpiano2midi(input_arr, note_dur, treble_voice = false) { //construct dictionary with pitch values var pitch_dict = {}; @@ -127,6 +127,11 @@ function volpiano2midi(input_arr, note_dur) { pitch_dict['t'] = 46; // make-shift Bb3 pitch_dict['u'] = 58; // make-shift Bb4 pitch_dict['v'] = 50; // make-shift Bb5 + if (treble_voice) { + for (var key in pitch_dict) { + pitch_dict[key] += 12; + } + } // create array of volpiano characters representing barlines // for purposes of midi playback, these are treated as rests @@ -262,6 +267,7 @@ export default Marionette.ItemView.extend({ var volArr = parse_volpiano(this.ui.volpianoSyllables); this.ui.btnPlay.html("Playing..."); this.ui.btnPlay.attr("disabled", true); + // Add a button in the ui that sets treble_voice = true in volpiano2midi when clicked volpiano2midi(volArr, .6); }, stop: function(){ From b3e37eae3c080f4207ea19cf2b4d6f8da5dbbad4 Mon Sep 17 00:00:00 2001 From: Liam Pond Date: Fri, 13 Sep 2024 09:35:21 -0400 Subject: [PATCH 2/5] Added button --- .../app/manuscript-detail/folio/ChantRecordView.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js b/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js index 0e4b5524..4070e883 100644 --- a/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js +++ b/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js @@ -257,22 +257,27 @@ export default Marionette.ItemView.extend({ ui : { volpianoSyllables: ".volpiano-syllable", btnPlay: ".btnPlay", - btnStop: ".btnStop" + btnStop: ".btnStop", + btnTreble: ".btnTreble" }, events: { "click .btnPlay": "submit", - "click .btnStop": "stop" + "click .btnStop": "stop", + "click .btnTreble": "toggleTreble" }, submit: function mainPlay() { var volArr = parse_volpiano(this.ui.volpianoSyllables); this.ui.btnPlay.html("Playing..."); this.ui.btnPlay.attr("disabled", true); - // Add a button in the ui that sets treble_voice = true in volpiano2midi when clicked - volpiano2midi(volArr, .6); + volpiano2midi(volArr, .6), this.treble_voice; }, stop: function(){ audioStopReset(MIDI); }, + toggleTreble: function(){ + this.treble_voice = !this.treble_voice; + this.ui.btnTreble.html(this.treble_voice ? "Treble On" : "Treble Off"); + }, stopChantAudio: function(){ if (MIDI.getContext().state === "running"){ audioStopReset(MIDI); From 111d27726d37404e7d5928178278ce3cd2990517 Mon Sep 17 00:00:00 2001 From: Liam Pond Date: Fri, 13 Sep 2024 10:05:10 -0400 Subject: [PATCH 3/5] Added treble to html template --- .../public/js/app/manuscript-detail/folio/ChantRecordView.js | 2 +- .../js/app/manuscript-detail/folio/chant-record.template.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js b/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js index 4070e883..db818c4f 100644 --- a/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js +++ b/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/ChantRecordView.js @@ -269,7 +269,7 @@ export default Marionette.ItemView.extend({ var volArr = parse_volpiano(this.ui.volpianoSyllables); this.ui.btnPlay.html("Playing..."); this.ui.btnPlay.attr("disabled", true); - volpiano2midi(volArr, .6), this.treble_voice; + volpiano2midi(volArr, .6, this.treble_voice); }, stop: function(){ audioStopReset(MIDI); diff --git a/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/chant-record.template.html b/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/chant-record.template.html index f8d169a1..be232633 100644 --- a/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/chant-record.template.html +++ b/nginx/public/node/frontend/public/js/app/manuscript-detail/folio/chant-record.template.html @@ -48,4 +48,5 @@
Full Text

+ <% } %> From 381c0d94a8e3816722550e65c0a57db58977a576 Mon Sep 17 00:00:00 2001 From: Liam Pond Date: Fri, 13 Sep 2024 10:55:39 -0400 Subject: [PATCH 4/5] Added .env.sample back --- .env.sample | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .env.sample diff --git a/.env.sample b/.env.sample new file mode 100644 index 00000000..609a8c52 --- /dev/null +++ b/.env.sample @@ -0,0 +1,18 @@ +APP_VERSION=3.2-0.12.1 +COMPOSE_PROJECT_NAME=cantus + +#When DEVELOPMENT is False, Django's DEBUG setting +#is False and app is served by gunicorn +DEVELOPMENT=False +#DJANGO_SECRET_KEY=**PROVIDE SECRET KEY HERE** + +#Postgres authentication variables +POSTGRES_DB=cantus_db +POSTGRES_USER=cantus_admin +#POSTGRES_PASSWORD=**PROVIDE PASSWORD HERE** + +#RabbitMQ authentication variables +RABBIT_VHOST=cantus_ultimus +RABBIT_USER=cantus_admin +#RABBIT_PASSWORD=**PROVIDE PASSWORD HERE** + From 5ac27c40343b4f27fef571d6523843a58e33670e Mon Sep 17 00:00:00 2001 From: Liam Pond Date: Fri, 13 Sep 2024 11:24:24 -0400 Subject: [PATCH 5/5] Removed extra empty line in .env.sample --- .env.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/.env.sample b/.env.sample index 609a8c52..b44b0125 100644 --- a/.env.sample +++ b/.env.sample @@ -15,4 +15,3 @@ POSTGRES_USER=cantus_admin RABBIT_VHOST=cantus_ultimus RABBIT_USER=cantus_admin #RABBIT_PASSWORD=**PROVIDE PASSWORD HERE** -