Drag Baroque charts onto a line, reorder them, set a duration, or remove a note. The AppImage no longer packages oemer, ONNX, or the models. Version 0.2.0. Co-authored-by: catpersonisme <catpersonisme@gmail.com>
This commit is contained in:
22 files changed
+569
-2231
No files matched your search
@@ -1,52 +0,0 @@
|
||||
import { connection } from "next/server";
|
||||
import { recognizeImage, recognizerInfo } from "@/lib/recognize";
|
||||
|
||||
const TYPES = new Set(["image/png", "image/jpeg", "image/webp"]);
|
||||
|
||||
export async function GET() {
|
||||
await connection();
|
||||
return Response.json(recognizerInfo());
|
||||
}
|
||||
|
||||
export async function POST(request: Request) {
|
||||
let form: FormData;
|
||||
try {
|
||||
form = await request.formData();
|
||||
} catch {
|
||||
return Response.json({ error: "The upload could not be read. No notes were invented." }, { status: 400 });
|
||||
}
|
||||
|
||||
const image = form.get("image");
|
||||
if (!(image instanceof File)) {
|
||||
return Response.json({ error: "Choose a PNG, JPG, or WEBP image first." }, { status: 400 });
|
||||
}
|
||||
if (image.size === 0) {
|
||||
return Response.json(
|
||||
{ error: "That file is empty. No notes were invented." },
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
const named = /\.(png|jpe?g|webp)$/i.test(image.name);
|
||||
if (image.type && !TYPES.has(image.type) && !named) {
|
||||
return Response.json(
|
||||
{ error: "Use a PNG, JPG, or WEBP photo. That file is not one of those. No notes were invented." },
|
||||
{ status: 415 },
|
||||
);
|
||||
}
|
||||
if (image.size > 8 * 1024 * 1024) {
|
||||
return Response.json(
|
||||
{ error: "That image is over 8 MB. Crop the line or export a smaller JPEG." },
|
||||
{ status: 413 },
|
||||
);
|
||||
}
|
||||
|
||||
const result = await recognizeImage(image);
|
||||
if (!result.ok) {
|
||||
return Response.json({ error: result.error, recognizer: result.recognizer }, { status: result.status });
|
||||
}
|
||||
return Response.json({
|
||||
score: result.score,
|
||||
warnings: result.warnings,
|
||||
recognizer: result.recognizer,
|
||||
});
|
||||
}
|
||||
+2
-2
@@ -16,9 +16,9 @@ const display = Fraunces({
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Recorder Tab Converter",
|
||||
title: "Recorder fingering editor",
|
||||
description:
|
||||
"Turn a lead melody into soprano recorder fingering tabs, with rhythm, rests, and bar lines kept.",
|
||||
"Drag soprano recorder fingering charts onto a line, reorder them, and set how long each note lasts.",
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: LayoutProps<"/">) {
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import { Converter } from "@/components/converter";
|
||||
import { Editor } from "@/components/editor";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main>
|
||||
<Converter />
|
||||
<Editor />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user