From 932f2200e32c785d15630ed9103ce86c200136d0 Mon Sep 17 00:00:00 2001 From: suroh Date: Sat, 18 Nov 2023 13:48:00 +0100 Subject: [PATCH] updated unpublished music interface --- public/data/music_sound_unpublished.json | 431 ++++++++++++++++++++++- scripts/files2json.js | 33 +- src/api/Router.js | 2 +- src/components/ModularPlayer.js | 15 +- 4 files changed, 465 insertions(+), 16 deletions(-) diff --git a/public/data/music_sound_unpublished.json b/public/data/music_sound_unpublished.json index fe51488..51029b0 100644 --- a/public/data/music_sound_unpublished.json +++ b/public/data/music_sound_unpublished.json @@ -1 +1,430 @@ -[] +[ + { + "title": "Meredith Monk performing Epitaph by Donald Ashwander", + "details": "1980", + "parent_dir": "music_sound_unpublished", + "media": "1. Meredith Monk performing Epitaph by Donald Ashwander, 1980", + "order": "1", + "album": true, + "tracks": [ + { + "title": "1.Epitaph Meredith Monk sings the music of Donald Ashwander 1980", + "media": "1.Epitaph_Meredith Monk sings the music of Donald Ashwander_1980.mp3" + } + ] + }, + { + "title": "Meredith Monk performing The Locust by Donald Ashwander", + "details": "1980", + "parent_dir": "music_sound_unpublished", + "media": "2. Meredith Monk performing The Locust by Donald Ashwander, 1980", + "order": "2", + "album": true, + "tracks": [ + { + "title": "1.The Locust Meredith Monk sings the music of Donald Ashwander 1980", + "media": "1.The Locust_Meredith Monk sings the music of Donald Ashwander_1980.mp3" + } + ] + }, + { + "title": "Meredith Monk performing Aria by John Cage", + "details": "introduced by John Cage, Catskill Festival, New York, 1985", + "parent_dir": "music_sound_unpublished", + "media": "3. Meredith Monk performing Aria by John Cage, introduced by John Cage, Catskill Festival, New York, 1985", + "order": "3", + "album": true, + "tracks": [ + { + "title": "1.Meredith Monk performing Aria by John Cage", + "media": "1.Meredith Monk performing Aria by John Cage.mp3" + } + ] + }, + { + "title": "Meredith Monk in Concert", + "details": "Willisau Jazz Festival, Switzerland, 1987", + "parent_dir": "music_sound_unpublished", + "media": "4. Meredith Monk in Concert, Willisau Jazz Festival, Switzerland, 1987", + "order": "4", + "album": true, + "tracks": [ + { + "title": "01 Announcer MM speaks Porch 1", + "media": "01 Announcer_MM speaks_Porch_1.mp3" + }, + { + "title": "02 Mesa", + "media": "02 Mesa.mp3" + }, + { + "title": "03 Jade (Old Woman's Song)", + "media": "03 Jade (Old Woman's Song).mp3" + }, + { + "title": "04 Wa-lie-oh", + "media": "04 Wa-lie-oh.mp3" + }, + { + "title": "05 Insect", + "media": "05 Insect.mp3" + }, + { + "title": "06 Descending", + "media": "06 Descending.mp3" + }, + { + "title": "07 Silo (Drone)", + "media": "07 Silo (Drone).mp3" + }, + { + "title": "08 Breath Song", + "media": "08 Breath Song.mp3" + }, + { + "title": "09 Bird Code", + "media": "09 Bird Code.mp3" + }, + { + "title": "10 Lullaby #4", + "media": "10 Lullaby #4.mp3" + }, + { + "title": "11 Prairie Ghost", + "media": "11 Prairie Ghost.mp3" + }, + { + "title": "12 Prairie Ghost", + "media": "12 Prairie Ghost.mp3" + }, + { + "title": "13 Jew's Harp", + "media": "13 Jew's Harp.mp3" + }, + { + "title": "14 Scared Song", + "media": "14 Scared Song.mp3" + }, + { + "title": "15 Travelling", + "media": "15 Travelling.mp3" + }, + { + "title": "16 I Don't Know", + "media": "16 I Don't Know.mp3" + }, + { + "title": "17 I Don't Know cont-", + "media": "17 I Don't Know cont-.mp3" + }, + { + "title": "18 Window in 7's Double Fiesta", + "media": "18 Window in 7's_Double Fiesta.mp3" + }, + { + "title": "19 Double Fiesta cont", + "media": "19 Double Fiesta cont.mp3" + }, + { + "title": "20 Do You Be", + "media": "20 Do You Be.mp3" + }, + { + "title": "21 Ellis Island", + "media": "21 Ellis Island.mp3" + }, + { + "title": "22 The Tale", + "media": "22 The Tale.mp3" + } + ] + }, + { + "title": "Double Fiesta", + "details": "recorded by Meredith Monk, Edmund Niemann and Nurit Tilles, Take 3 for ECM Records, 1987", + "parent_dir": "music_sound_unpublished", + "media": "5. Double Fiesta, recorded by Meredith Monk, Edmund Niemann and Nurit Tilles, Take 3 for ECM Records, 1987", + "order": "5", + "album": true, + "tracks": [ + { + "title": "1. Double Fiesta, Take 3 ECM takes, 1987", + "media": "1. Double Fiesta, Take 3_ECM takes, 1987.mp3" + } + ] + }, + { + "title": "Double Fiesta", + "details": "recorded by Meredith Monk, Edmund Niemann and Nurit Tilles, Take 5 for ECM Records,1987", + "parent_dir": "music_sound_unpublished", + "media": "6. Double Fiesta, recorded by Meredith Monk, Edmund Niemann and Nurit Tilles, Take 5 for ECM Records,1987", + "order": "6", + "album": true, + "tracks": [ + { + "title": "1. Double Fiesta- Take 5 ECM takes, 1987", + "media": "1. Double Fiesta- Take 5_ECM takes, 1987.mp3" + } + ] + }, + { + "title": "Meredith Monk and Bobby McFerrin", + "details": "Duet Behavior, Brooklyn Academy of Music (BAM), New York, 1987", + "parent_dir": "music_sound_unpublished", + "media": "7. Meredith Monk and Bobby McFerrin, Duet Behavior, Brooklyn Academy of Music (BAM), New York, 1987", + "order": "7", + "album": true, + "tracks": [ + { + "title": "1. Dependent Song by Meredith Monk BAM 1987 2023 edit", + "media": "1. Dependent Song_by Meredith Monk_BAM 1987_2023 edit.mp3" + }, + { + "title": "2. Cat by Meredith Monk and Bobby McFerrin BAM", + "media": "2. Cat by Meredith Monk and Bobby McFerrin BAM.mp3" + }, + { + "title": "3. Sea Song by Meredith Monk and Bobby McFerrin BAM 1987", + "media": "3. Sea Song by Meredith Monk and Bobby McFerrin BAM 1987.mp3" + } + ] + }, + { + "title": "Cat", + "details": "recorded by Meredith Monk, 1988", + "parent_dir": "music_sound_unpublished", + "media": "8. Cat, recorded by Meredith Monk, 1988", + "order": "8", + "album": true, + "tracks": [ + { + "title": "1. Cat, 1988", + "media": "1. Cat, 1988.mp3" + } + ] + }, + { + "title": "Come and Go (excerpt from Book of Days)", + "details": "performed by Meredith Monk & Vocal Ensemble, Organised by David Byrne, 1989", + "parent_dir": "music_sound_unpublished", + "media": "9. Come and Go (excerpt from Book of Days), performed by Meredith Monk & Vocal Ensemble, Organised by David Byrne, 1989", + "order": "9", + "album": true, + "tracks": [ + { + "title": "1.Come and Go (Excerpt from Book of Days)", + "media": "1.Come and Go (Excerpt from Book of Days).mp3" + } + ] + }, + { + "title": "Meredith Monk in Concert", + "details": "Porch, Light Songs and Madwoman's Vision, Other Minds Festival, San Francisco, 1993", + "parent_dir": "music_sound_unpublished", + "media": "10. Meredith Monk in Concert, Porch, Light Songs and Madwoman's Vision, Other Minds Festival, San Francisco, 1993", + "order": "10", + "album": true, + "tracks": [ + { + "title": "1. Light Songs, Madwoman's Vision", + "media": "1. Light Songs, Madwoman's Vision.mp3" + } + ] + }, + { + "title": "Disappearance I from Volcano Songs", + "details": "recorded by Meredith Monk, 1994", + "parent_dir": "music_sound_unpublished", + "media": "11. Disappearance I from Volcano Songs, recorded by Meredith Monk, 1994", + "order": "11", + "album": true, + "tracks": [ + { + "title": "1. Disappearance 1 from Volcano Songs 1994", + "media": "1. Disappearance 1 from Volcano Songs 1994.mp3" + } + ] + }, + { + "title": "Disappearance II from Volcano Songs", + "details": "recorded by Meredith Monk, 1994", + "parent_dir": "music_sound_unpublished", + "media": "12. Disappearance II from Volcano Songs, recorded by Meredith Monk, 1994", + "order": "12", + "album": true, + "tracks": [ + { + "title": "1. Disappearance 2 from Volcano Songs 1994", + "media": "1. Disappearance 2 from Volcano Songs_1994.mp3" + } + ] + }, + { + "title": "Steppe Music (world premiere)", + "details": "performed by Nurit Tilles, San Francisco, 1997", + "parent_dir": "music_sound_unpublished", + "media": "13. Steppe Music (world premiere), performed by Nurit Tilles, San Francisco, 1997", + "order": "13", + "album": true, + "tracks": [ + { + "title": "1. Steppe Music premiere Nurit Tilles in San Francisco, 1997", + "media": "1. Steppe Music premiere_Nurit Tilles in San Francisco, 1997.mp3" + } + ] + }, + { + "title": "Name Songs (3 Tracy Birthday Songs)", + "details": "recorded by Meredith Monk, 1998", + "parent_dir": "music_sound_unpublished", + "media": "14. Name Songs (3 Tracy Birthday Songs), recorded by Meredith Monk, 1998", + "order": "14", + "album": true, + "tracks": [ + { + "title": "1. Birthday Variations for Tracy 1998", + "media": "1. Birthday Variations for Tracy_1998.mp3" + } + ] + }, + { + "title": "Boys", + "details": "written by Rick Moody, music by Meredith Monk, read by Julia Slavin, WNYC radio show, 1999", + "parent_dir": "music_sound_unpublished", + "media": "15. Boys, written by Rick Moody, music by Meredith Monk, read by Julia Slavin, WNYC radio show, 1999", + "order": "15", + "album": true, + "tracks": [ + { + "title": "1. Boys- WNYC show 1999 OR JUST MUSIC ", + "media": "1. Boys- WNYC show__1999_OR JUST MUSIC_.mp3" + } + ] + }, + { + "title": "Ancestor Shout", + "details": "performed by Meredith Monk and David Behrman, Roulette, NYC, 2001", + "parent_dir": "music_sound_unpublished", + "media": "16. Ancestor Shout, performed by Meredith Monk and David Behrman, Roulette, NYC, 2001", + "order": "16", + "album": true, + "tracks": [ + { + "title": "1.Ancestor Shout Meredith Monk and David Behrman ", + "media": "1.Ancestor Shout_Meredith Monk and David Behrman_.mp3" + } + ] + }, + { + "title": "Little Breath Motor", + "details": "performed by Meredith Monk and David Behrman, Roulette, NYC, 2001", + "parent_dir": "music_sound_unpublished", + "media": "17. Little Breath Motor, performed by Meredith Monk and David Behrman, Roulette, NYC, 2001", + "order": "17", + "album": true, + "tracks": [ + { + "title": "1. Little Breath Motor Meredith Monk and David Behrman ", + "media": "1. Little Breath Motor_Meredith Monk and David Behrman_.mp3" + } + ] + }, + { + "title": "Realm Variations", + "details": "performed by Meredith Monk & Vocal Ensemble and San Francisco Symphony, 2012", + "parent_dir": "music_sound_unpublished", + "media": "18. Realm Variations, performed by Meredith Monk & Vocal Ensemble and San Francisco Symphony, 2012", + "order": "18", + "album": true, + "tracks": [ + { + "title": "1. Realm Variations-San Francisco Symphony and Meredith Monk", + "media": "1. Realm Variations-San Francisco Symphony and Meredith Monk.mp3" + } + ] + }, + { + "title": "WEAVE for Two Voices", + "details": "Chamber Orchestra and Chorus, rehearsal with Theo Bleckmann, Katie Geissinger, St.Louis Symphony and Chorus, 2015", + "parent_dir": "music_sound_unpublished", + "media": "19. WEAVE for Two Voices, Chamber Orchestra and Chorus, rehearsal with Theo Bleckmann, Katie Geissinger, St.Louis Symphony and Chorus, 2015", + "order": "19", + "album": true, + "tracks": [ + { + "title": "1. Weave", + "media": "1. Weave.mp3" + } + ] + }, + { + "title": "Backlight", + "details": "performed by Ensemble ACJW, 2015", + "parent_dir": "music_sound_unpublished", + "media": "20. Backlight, performed by Ensemble ACJW, 2015", + "order": "20", + "album": true, + "tracks": [ + { + "title": "1.Backlight", + "media": "1.Backlight.mp3" + } + ] + }, + { + "title": "Name Song (Wedding Song for Will and Lindsey)", + "details": "recorded by Meredith Monk, 2020", + "parent_dir": "music_sound_unpublished", + "media": "21. Name Song (Wedding Song for Will and Lindsey), recorded by Meredith Monk, 2020", + "order": "21", + "album": true, + "tracks": [ + { + "title": "1.Wedding Song for Will and Lindsey-final mix 2020 1", + "media": "1.Wedding Song for Will and Lindsey-final mix_2020_1.mp3" + } + ] + }, + { + "title": "Name Song (Declan Birthday Song)", + "details": "recorded by Meredith Monk, 2020", + "parent_dir": "music_sound_unpublished", + "media": "22. Name Song (Declan Birthday Song), recorded by Meredith Monk, 2020", + "order": "22", + "album": true, + "tracks": [ + { + "title": "1.Declan Birthday Song 2020", + "media": "1.Declan Birthday Song_2020.mp3" + } + ] + }, + { + "title": "Name Song (Isla Birthday Song)", + "details": "recorded by Meredith Monk, 2020", + "parent_dir": "music_sound_unpublished", + "media": "23. Name Song (Isla Birthday Song), recorded by Meredith Monk, 2020", + "order": "23", + "album": true, + "tracks": [ + { + "title": "1. Isla Birthday Song October 2016 1", + "media": "1. Isla Birthday Song_October 2016_1.mp3" + } + ] + }, + { + "title": "Simple Sorrow", + "details": "Meredith Monk, 2020", + "parent_dir": "music_sound_unpublished", + "media": "24. Simple Sorrow, Meredith Monk, 2020", + "order": "24", + "album": true, + "tracks": [ + { + "title": "1.Simple Sorrow, Meredith Monk", + "media": "1.Simple Sorrow, Meredith Monk.mp3" + } + ] + } +] \ No newline at end of file diff --git a/scripts/files2json.js b/scripts/files2json.js index 2dd1c51..f211519 100644 --- a/scripts/files2json.js +++ b/scripts/files2json.js @@ -59,7 +59,7 @@ async function main() { let dryRun = false let formatted = null let waveform = false - let update = [] + let order = false if (process.argv.length < 3 || process.argv.includes('-h')) { console.log(` @@ -78,6 +78,7 @@ Other flags --formatted : Directory or file name, will format on the the undersore : "title_details". This takes the arguments, parent, recurse or both. Defaults to both. --gen-waveform : [may break if recursing] If going through audio files can generate waveform images for the file. + --order : Take number & number + "." as order of array `) return } @@ -125,7 +126,9 @@ Other flags case '--gen-waveform': waveform = true break - + case '--order': + order = true + break default: break } @@ -169,10 +172,17 @@ Other flags // setup structure const _r = { - ...genMetadata(m, formatted == 'parent' || formatted == 'both'), + ...genMetadata(m, formatted == 'parent' || formatted == 'both', order), parent_dir, media: m, - image: '' + image: '', + order: 0 + } + + if (order) { + const idx = m.match(/\d+/)[0] || 0 + _r.order = idx + _r.title = _r.title.replace(/^\d+\W*_*/, '') } // if we are scanning for images only, remove the 'image' property @@ -200,7 +210,7 @@ Other flags // generate the metadata for each file files = files.filter(f => f.match(/\.[^/.]+$/)) files = files.map(f => { - const { title, details } = genMetadata(f, formatted == 'recurse' || formatted == 'both') + const { title, details } = genMetadata(f, formatted == 'recurse' || formatted == 'both', false) return { title, details, media: f } }) @@ -224,6 +234,11 @@ Other flags return _r })) + if (order) { + obj.sort((a, b) => { + return a.order - b.order + }) + } // turn the obj variable into JSON const json = JSON.stringify(obj, null, 2) @@ -248,17 +263,19 @@ Other flags function genMetadata(dir, formatted) { let title, details + // if formatted flag set if (formatted) { // split the incoming name from the map on the '_' // and set the first element to title, and the second to details - let [ t, d ] = dir.split('_') + let [ t, _, d ] = dir.split(/(,|_)(.+)/s) // assign to return object title = t - details = d ? d.replace(/\.+(mp\d|m\dv)$/i, '') : '' + details = d ? d.replace(/\.+(mp\d|m\dv)$/i, '').trim() : '' } else { // else just set title to filename without extensions - title = dir.replace(/\.[^/.]+$/, '').replace(/_/g, ' ') + const name = dir.replace(/\.\S{3,4}$/, '') + title = name.replace(/_/g, ' ') } return { title, details } diff --git a/src/api/Router.js b/src/api/Router.js index b0ebd1f..b008279 100644 --- a/src/api/Router.js +++ b/src/api/Router.js @@ -74,7 +74,7 @@ export default new Router({ short: 'Unpublished', icon: 'headphones', group: 'Music & Sound', - disabled: true, + disabled: false, plugins: [ lazy(() => import('../views/audio.js')) ], diff --git a/src/components/ModularPlayer.js b/src/components/ModularPlayer.js index 050f884..0e72d36 100644 --- a/src/components/ModularPlayer.js +++ b/src/components/ModularPlayer.js @@ -183,9 +183,9 @@ class ModularPlayer extends LitElement { ${this.details.tracks ? html`
- + />` : ''}

${this.details.title}

@@ -336,9 +336,6 @@ class ModularPlayer extends LitElement { max-width: 25ch; } - .tracklist + header { - } - .tracklist { --tracklist-padding: calc(var(--padding) * 2); display: flex; @@ -352,7 +349,8 @@ class ModularPlayer extends LitElement { margin-block-end: 0.75em; padding-block-start: 0.75em; border-block-start: thin solid var(--green-400); - display: flex; + display: grid; + grid-template-columns: auto 1fr; gap: 0.5em; align-items: end; color: black; @@ -360,10 +358,15 @@ class ModularPlayer extends LitElement { & img { height: 4em; aspect-ratio: 1 / 1; + grid-columns: 1 / span 1; } & > h2 { line-height: 1; + grid-columns: 2 / span 1; + } + + & img + h2 { max-width: 15ch; } }