sul-cidr / josquin-ribbon

http://ribbon.stanford.edu/
BSD 3-Clause "New" or "Revised" License
12 stars 0 forks source link

Audio playback of score #205

Open craigsapp opened 5 years ago

craigsapp commented 5 years ago

Ideally the ribbon plot would be able to play an audio file of the score.

Here is an example ribbon plot page: https://ribbon.humdrum.org/?id=Jos3005

Screen Shot 2019-10-23 at 3 54 19 PM

The predecessor to such a plot is available from the "pianoroll" links on the work pages, such as: https://josquin.stanford.edu/work/?id=Jos3005

Screen Shot 2019-10-23 at 4 33 20 PM

This takes you to the page:

https://josquin.stanford.edu/proll/?id=Jos3005

Screen Shot 2019-10-23 at 4 33 46 PM

Try pressing the play button at the top of the page (or press the space bar).

You can also scroll left/right on the page, and click on a note to start playback at the given note.

Here is the source code for the webpage: https://github.com/josquin-research-project/jrp-website/tree/master/proll (this webpage also uses the proll.cpp program, generating an SVG image of the piano roll for use on the page): https://github.com/craigsapp/humextra/blob/master/cli/proll.cpp The same program is used to generate the JSON version of the Humdrum score: https://josquin.stanford.edu/cgi-bin/jrp?a=proll-json&f=Jos3005

Note that the notes in the JSON data contain a start time and a duration in seconds:

{
    "pitch"     :   {"name":"D4", "b7":29, "b12":62},
    "starttime" :   [20],
    "starttimesec"  :   2.85714,
    "duration"  :   [4],
    "durationsec"   :   0.571429,
    "metpos"    :   [5]
}

The audio file is: https://josquin.stanford.edu/audio/mp3/Jos3005.mp3 This file should in theory have the exact same timings for notes as in the JSON version of the score. This MP3 was created from the source Humdrum file, converted into a MIDI file and the converted to MP3 via timidity++. There should be one MP3 for each score file in the JRP at https://josquin.stanford.edu/audio/mp3, with the filename being the JRP catalog number (without any title information like the Humdrum files does on Github).