WIP. A little custom music server
at main 21 lines 540 B view raw
1import { clsx, type ClassValue } from "clsx"; 2import { twMerge } from "tailwind-merge"; 3 4export function cn(...inputs: ClassValue[]) { 5 return twMerge(clsx(inputs)); 6} 7 8import { Schema } from "effect"; 9 10export const NormalizedFloat = Schema.Number.pipe( 11 Schema.between(0, 1, { 12 identifier: "NormalizedFloat", 13 description: "floating point number between 0 and 1", 14 }), 15); 16 17export type NormalizedFloatType = typeof NormalizedFloat.Type; 18 19export function scale(x: number, fromMax: number, toMax: number) { 20 return (x / fromMax) * toMax; 21}