Skip to content

Commit

Permalink
Adjust Scrollbar and Make Ending Refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-serna committed Nov 16, 2024
1 parent 83b65ea commit c803224
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 20 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,30 @@ That's why I made **Songscribe**, a tool for jumpstarting the transcription proc

## Quick Start

You can get started with Songscribe by visiting [songscribe.xyz](https://songscribe.xyz).

> <p>Currently, the API backend powering the audio isolation and audio to MIDI conversion is not hosted anywhere (<i>the machine learning models are a bit too intensive for free hosting solutions</i>). <br><br> <strong>This means you will have to run the API locally.</strong> Extensive documentation on how to do so have been provided for you <a href="https://github.com/gabe-serna/songscribe-api?tab=readme-ov-file#songscribe-api">here</a> for this reason.</p>
You can get started transcribing with Songscribe by visiting **[songscribe.xyz](https://songscribe.xyz)**.

Here's a quick overview of how to use Songscribe:

- Upload the song you want to transcribe
- File Upload
- YouTube Link
- Choose the preset that best suits the song you're transcribing
- **Solo** (1 instrument)
- **Duet** (vocals, no vocals)
- **Small Band** (vocals, drums, bass, and other instruments)
- **Full Band** (vocals, drums, bass, guitar, piano, and other instruments)
- Optionally, select the tempo and the start time and end time of the song to be transcribed
- Click the **Transcribe** button
- Adjust the MIDI parameters to regenerate the transcription for each instrument to your liking
- Click the **Export** button to create the final score and download all files generated from the session

<br/>

## Technologies Used

Here is a quick breakdown of all the main technologies used to create Songscribe.

Frontend:
**[Frontend](https://github.com/gabe-serna/songscribe)**:

- React
- Next.js
Expand All @@ -69,15 +82,16 @@ Frontend:
- **[wavesurfer.js](https://github.com/katspaugh/wavesurfer.js)**- Waveform Visualization
- **[Flat Embed](https://github.com/FlatIO/embed-client)**- Embedded sheet music viewer

Backend:
**[Backend](https://github.com/gabe-serna/songscribe-api)**:

- Python
- Libraries:
- **[Moseca](https://github.com/fabiogra/moseca)**- Instrument separation
- **[Spotify Basic Pitch](https://github.com/spotify/basic-pitch)**- Audio to MIDI conversion
- **[Basic Pitch](https://github.com/spotify/basic-pitch)**- Audio to MIDI conversion
- **[ADTOF](https://github.com/MZehren/ADTOF)**- Drum transcription

<br/>

## Feedback and issues

Please file feedback and issues over on [Github Issues](https://github.com/gabe-serna/songscribe/issues/new).
Please file feedback and issues over on [Github Issues](https://github.com/gabe-serna/songscribe/issues/new). All feedback is welcome!
2 changes: 1 addition & 1 deletion app/DemoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function DemoSection() {
return (
<section
id="demo"
className="flex min-h-screen w-full flex-col items-center justify-start pt-12 max-lg:px-8 lg:w-[calc(100vw-12px)] lg:pt-16 xl:pt-20"
className="flex min-h-screen w-full flex-col items-center justify-start pt-12 max-lg:px-8 lg:pt-16 xl:pt-20"
>
<h1 className="text-2xl font-semibold leading-tight sm:text-3xl xl:text-4xl">
See it in Action!
Expand Down
4 changes: 2 additions & 2 deletions app/ImpactSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export default function ImpactSection() {
<section
ref={containerRef}
id="impact"
className="relative flex h-[420vh] w-screen border-0 bg-[hsl(12,6%,15%)] dark:bg-[hsl(50,10%,92%)] lg:w-[calc(100vw-12px)]"
className="relative flex h-[420vh] w-screen border-0 bg-[hsl(12,6%,15%)] dark:bg-[hsl(50,10%,92%)]"
>
<div className="absolute inset-0 h-1/2 bg-gradient-to-b from-background to-transparent dark:via-background dark:via-15% max-lg:-translate-y-1" />
<div
ref={contentRef}
className="impact-shadow sticky top-[30vh] my-[30vh] flex h-[40vh] w-full items-center justify-center bg-secondary-foreground shadow-pink-800/50 dark:shadow-pink-600/50"
className="impact-shadow sticky top-[30vh] my-[30vh] flex h-[40vh] w-screen items-center justify-center bg-secondary-foreground shadow-pink-800/50 dark:shadow-pink-600/50"
>
<motion.div
style={{ opacity: scrollYProgress }}
Expand Down
2 changes: 1 addition & 1 deletion app/audio/AudioPart3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function AudioPart3({
type="submit"
className="button-action mt-4 w-full rounded-full text-base shadow-md max-lg:text-lg sm:max-lg:py-6 lg:w-3/4"
>
Submit
Transcribe
</Button>
</form>
</Form>
Expand Down
43 changes: 41 additions & 2 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,50 @@ a,
margin-right: 0;
}

::-webkit-scrollbar {
:not(body)::-webkit-scrollbar {
width: 12px;
}

::-webkit-scrollbar-thumb {
:not(body)::-webkit-scrollbar-thumb {
background-color: #78716c;
border-radius: 3px;
}

/* Hide default scrollbar */
html::-webkit-scrollbar {
display: none;
width: 0;
}

body {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}

/* Custom Scrollbar */
.custom-scrollbar {
position: fixed;
right: 0;
top: 0;
width: 12px;
height: 100vh;
z-index: 999;
opacity: 0;
transition: opacity 0.3s;
@media (max-width: 768px) {
display: none;
}
}

.custom-scrollbar.visible {
opacity: 1;
}

.custom-scrollbar-thumb {
position: absolute;
top: 0;
right: 0;
width: 100%;
background-color: #78716c;
border-radius: 3px;
}
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export default function RootLayout({
enableSystem
disableTransitionOnChange
>
<main className="flex min-h-screen flex-col items-center overflow-x-hidden">
<main className="flex min-h-screen flex-col items-center">
<div className="flex w-full flex-1 flex-col items-center">
<div
id="main-content-container"
className="flex min-h-screen w-full flex-col items-center justify-center gap-20 px-5 pt-20"
className="flex min-h-screen w-full flex-col items-center justify-center gap-20 px-5 pt-10"
>
{children}
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default async function Home() {
<div className="relative flex w-full flex-col items-center justify-center sm:px-20 xl:px-24">
<section
id="hero"
className="flex min-h-[calc(100vh-64px)] w-full max-w-[1000px] flex-shrink flex-col items-center justify-center pb-20 lg:flex-row lg:justify-between lg:pl-8 xl:max-w-[1200px]"
className="flex min-h-[calc(100vh-64px)] w-full max-w-[1000px] flex-shrink flex-col items-center justify-center pb-10 lg:flex-row lg:justify-between lg:pl-8 xl:max-w-[1200px]"
>
<div className="flex flex-col max-lg:items-center">
<h1 className="text-3xl font-semibold max-lg:text-center max-sm:max-w-[15ch] sm:w-[20ch] sm:text-4xl xl:w-[20ch] xl:text-5xl xl:leading-tight">
Expand All @@ -32,7 +32,7 @@ export default async function Home() {
<ImpactSection />
<section
id="CTA"
className="flex h-[60vh] w-screen flex-col items-center justify-start bg-[hsl(12,6%,15%)] px-5 pt-[8vh] dark:bg-[hsl(50,10%,92%)] max-lg:-translate-y-1 sm:pt-4 lg:w-[calc(100vw-12px)]"
className="flex h-[60vh] w-screen -translate-y-1 flex-col items-center justify-start overflow-x-hidden bg-[hsl(12,6%,15%)] px-5 pt-[8vh] dark:bg-[hsl(50,10%,92%)] sm:pt-4"
>
<div className="flex flex-col items-center p-4 sm:p-6 xl:p-8">
<h1 className="max-w-[30ch] text-center text-2xl font-semibold leading-tight text-background sm:text-3xl xl:text-4xl">
Expand Down
58 changes: 58 additions & 0 deletions components/CustomScrollbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"use client";

import { useEffect, useRef, useState } from "react";

export default function CustomScrollbar() {
const [scrollbarHeight, setScrollbarHeight] = useState(0);
const [scrollbarTop, setScrollbarTop] = useState(0);
const [isVisible, setIsVisible] = useState(false);
const timeoutRef = useRef<NodeJS.Timeout>();

useEffect(() => {
const updateScrollbar = () => {
const windowHeight = window.innerHeight;
const documentHeight = document.documentElement.scrollHeight;
const scrollTop = window.scrollY;

const scrollbarHeight = (windowHeight / documentHeight) * windowHeight;
const scrollbarTop = (scrollTop / documentHeight) * windowHeight;

setScrollbarHeight(scrollbarHeight);
setScrollbarTop(scrollbarTop);

setIsVisible(true);

if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}

timeoutRef.current = setTimeout(() => {
setIsVisible(false);
}, 1000);
};

window.addEventListener("scroll", updateScrollbar);
window.addEventListener("resize", updateScrollbar);
updateScrollbar();

return () => {
window.removeEventListener("scroll", updateScrollbar);
window.removeEventListener("resize", updateScrollbar);
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
};
}, []);

return (
<div className={`custom-scrollbar ${isVisible ? "visible" : ""}`}>
<div
className="custom-scrollbar-thumb"
style={{
height: `${scrollbarHeight}px`,
transform: `translateY(${scrollbarTop}px)`,
}}
/>
</div>
);
}
8 changes: 7 additions & 1 deletion components/SmoothScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Lenis from "@studio-freight/lenis";
import { useEffect } from "react";
import CustomScrollbar from "./CustomScrollbar";

export default function SmoothScroll({
children,
Expand Down Expand Up @@ -30,5 +31,10 @@ export default function SmoothScroll({
};
}, []);

return <>{children}</>;
return (
<>
{children}
<CustomScrollbar />
</>
);
}
4 changes: 2 additions & 2 deletions components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export function Navbar() {

return (
<nav
className={`fixed top-0 z-50 w-full border-b border-b-foreground/10 bg-background/80 px-5 backdrop-blur-sm transition-transform duration-300 lg:w-[calc(100vw-12px)] ${
className={`fixed top-0 z-50 w-full border-b border-b-foreground/10 bg-background/80 px-9 backdrop-blur-sm transition-all duration-300 sm:px-[6.25rem] xl:px-[7.25rem] ${
scrollDirection === "down" ? "-translate-y-full" : "translate-y-0"
}`}
>
<div className="mx-auto flex h-16 w-full items-center justify-between px-5 sm:px-[6.5rem] sm:pr-[5rem] xl:px-[8rem] xl:pr-[6rem]">
<div className="mx-auto flex h-16 max-w-[1000px] items-center justify-between p-0 sm:px-6 xl:max-w-[1200px] xl:p-8">
<Link href="/" className="text-xl font-bold">
Songscribe
</Link>
Expand Down

0 comments on commit c803224

Please sign in to comment.