Browse Source

Organize files

Unify asset paths.
master
TheoryOfNekomata 8 months ago
parent
commit
47eb97971a
6 changed files with 27 additions and 5 deletions
  1. +0
    -0
      public/scores/haydn-piano-sonata-6-slice00.musicxml
  2. +0
    -0
      public/scores/haydn-piano-sonata-6-slice01.musicxml
  3. +17
    -0
      src/components/Score/index.tsx
  4. +6
    -1
      src/pages/ch20-trills.mdx
  5. +3
    -3
      src/pages/scores/[asset].svg.ts
  6. +1
    -1
      tailwind.config.mjs

src/assets/haydn-piano-sonata-6-slice00.musicxml → public/scores/haydn-piano-sonata-6-slice00.musicxml View File


src/assets/haydn-piano-sonata-6-slice01.musicxml → public/scores/haydn-piano-sonata-6-slice01.musicxml View File


+ 17
- 0
src/components/Score/index.tsx View File

@@ -0,0 +1,17 @@
import * as React from 'react';

export interface ScoreProps {
id: string;
alt: string;
}

export const Score: React.FC<ScoreProps> = ({
id,
alt,
}) => {
return (
<a href={`scores/${id}.musicxml`}>
<img src={`scores/${id}.svg`} alt={alt} />
</a>
)
};

+ 6
- 1
src/pages/ch20-trills.mdx View File

@@ -3,10 +3,15 @@ title: Trills
layout: ../layouts/Layout.astro
---

import {Score} from '../components/Score';

I have attended the session where I was supposed to demonstrate the trills I had been working for the past few days. I
started with the third movement of Haydn Piano Sonata No. 6:

<img src="/api/assets/haydn-piano-sonata-6-slice01.svg" alt="" />
<Score
id="haydn-piano-sonata-6-slice01"
alt="Haydn Piano Sonata No. 6, measures 1-3"
/>

Sir demonstrated to me where the "Adagio" is meant for, as the pulse is made out of quarter notes. He gestured to me
the 4/4 time signature and said the grouping is made out of 6 notes--"imagine the pulse is made out of sextuplets".


src/pages/api/assets/[asset].svg.ts → src/pages/scores/[asset].svg.ts View File

@@ -69,9 +69,9 @@ const processOutput = (xmlData: string) => {
};

export const GET: APIRoute = async ({ params }) => {
console.log('asdfasdf');
const verovioModule = await createVerovioModule();
verovioModule.FS_createDataFile('', 'bravura', 'asdfasdf', true, false, true);
const score = await readFile(`src/assets/${params.asset}.musicxml`, 'utf-8');
const score = await readFile(`public/scores/${params.asset}.musicxml`, 'utf-8');
const verovioToolkit = new VerovioToolkit(verovioModule);
const filteredScore = filter(score);
const isSuccessful = verovioToolkit.loadData(filteredScore);
@@ -107,7 +107,7 @@ export const GET: APIRoute = async ({ params }) => {
};

export const getStaticPaths: GetStaticPaths = async () => {
const files = await readdir('src/assets');
const files = await readdir('public/scores');
return files
.filter((f) => f.endsWith('.musicxml'))
.map((f) => ({

+ 1
- 1
tailwind.config.mjs View File

@@ -3,7 +3,7 @@ export default {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
theme: {
fontFamily: {
body: ['Century', 'serif'],
body: ['Times New Roman', 'Times', 'serif'],
},
extend: {
},


Loading…
Cancel
Save