{"version":3,"sources":["TabGenerator/Tab.type.ts","Config/Config.provider.tsx","Button.tsx","TabGenerator/randomArrayItem.ts","Config/Config.page.tsx","TabGenerator/majorScales.ts","TabGenerator/notations.ts","TabGenerator/TabGenerator.page.tsx","index.tsx"],"names":["Note","notes","Object","keys","ConfigContext","createContext","ConfigProvider","children","useState","gradesFromStorage","localStorage","getItem","JSON","parse","grades","setGrades","A","key","setKey","random","setRandom","useEffect","setItem","stringify","Provider","value","updateGrade","id","grade","currentGrades","map","_grade","removeGrade","filter","createGrade","concat","uuid","updateKey","Button","kurasu","button","blueButtonClass","BlueButton","pinkButtonClass","randomArrayItem","array","Math","floor","length","KeySelect","config","useContext","className","onChange","event","newNote","target","note","onClick","RandomEnabled","type","checked","RandomAmount","e","Number","GradesForm","min","step","max","defaultValue","xmlns","fill","viewBox","stroke","stroke-linecap","stroke-linejoin","stroke-width","d","GradesPage","href","width","height","to","majorScales","Aflat","Bflat","C","Dflat","Eflat","F","G","B","D","E","Gflat","notations","fret","string","TabGeneratorPage","randomId","setRandomId","songLines","useMemo","randomAmount","finalGrades","range","chunk","index","randomNote","songKey","mapGradeToNote","beat","createTab","songLine","join","ReactDOM","render","StrictMode","path","exact","document","getElementById"],"mappings":"qKASYA,E,kEAAAA,K,cAAAA,E,MAAAA,E,cAAAA,E,MAAAA,E,MAAAA,E,cAAAA,E,MAAAA,E,cAAAA,E,MAAAA,E,MAAAA,E,cAAAA,E,OAAAA,M,KAeL,IAAMC,EAAQC,OAAOC,KAAKH,G,OCHpBI,EAAgBC,wBAAsB,IAItCC,EAAiB,SAAC,GAEsB,IADnDC,EACkD,EADlDA,SACkD,EACtBC,oBAAkB,WAC5C,IAAMC,EAAoBC,aAAaC,QAAQ,UAC/C,OAAOF,EAAoBG,KAAKC,MAAMJ,GAAqB,MAHX,mBAC3CK,EAD2C,KACnCC,EADmC,OAM5BP,mBAAeR,EAAKgB,GANQ,mBAM3CC,EAN2C,KAMtCC,EANsC,OAOtBV,mBAAyB,IA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EAAUvE,KAAI,SAACmF,GAAD,OACb,8BAAMA,EAASC,KAAK,eCpH5BC,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,IAAD,UACE,cAAC,EAAD,UACE,qBAAKjE,UAAU,mCAAf,SACE,eAAC,IAAD,WACE,cAAC,IAAD,CAAOkE,KAAK,iBAAZ,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOC,OAAK,EAACD,KAAK,IAAlB,SACE,cAAC,EAAD,iBAOZE,SAASC,eAAe,W","file":"static/js/main.ffe6f57e.chunk.js","sourcesContent":["export interface Notation {\n string: number;\n fret: number;\n}\n\nexport interface TabWriterNote extends Notation {\n beat: number;\n}\n\nexport enum Note {\n Aflat = \"Aflat\",\n A = \"A\",\n Bflat = \"Bflat\",\n B = \"B\",\n C = \"C\",\n Dflat = \"Dflat\",\n D = \"D\",\n Eflat = \"Eflat\",\n E = \"E\",\n F = \"F\",\n Gflat = \"Gflat\",\n G = \"G\",\n}\n\nexport const notes = Object.keys(Note) as Note[];\n\nexport type PitchedNote = {\n pitch: number;\n note: Note;\n};\n","import React, { createContext, useEffect, useState } from \"react\";\nimport { v4 as uuid } from \"uuid\";\nimport { Note } from \"../TabGenerator/Tab.type\";\n\ninterface Grade {\n grade?: number;\n id: string;\n}\n\ninterface Config {\n grades: Grade[];\n key: Note;\n updateGrade: (id: string, grade: number) => void;\n createGrade: () => void;\n removeGrade: (id: string) => void;\n updateKey: (key: Note) => void;\n random: false | number;\n setRandom: (random: false | number) => void;\n}\n\n// @ts-ignore\nexport const ConfigContext = createContext({});\n\ninterface ConfigProviderProps {}\n\nexport const ConfigProvider = ({\n children,\n}: React.PropsWithChildren) => {\n const [grades, setGrades] = useState(() => {\n const gradesFromStorage = localStorage.getItem(\"grades\");\n return gradesFromStorage ? JSON.parse(gradesFromStorage) : [];\n });\n\n const [key, setKey] = useState(Note.A);\n const [random, setRandom] = useState(96);\n\n useEffect(() => {\n localStorage.setItem(\"grades\", JSON.stringify(grades, null, 2));\n }, [grades]);\n\n const updateGrade = (id: string, grade: number) => {\n setGrades((currentGrades) => {\n return currentGrades.map((_grade) => {\n if (_grade.id === id) {\n return {\n grade,\n id,\n };\n }\n return _grade;\n });\n });\n };\n\n const createGrade = () => {\n setGrades((currentGrades) => {\n return currentGrades.concat({\n id: uuid(),\n });\n });\n };\n\n const removeGrade = (id: string) => {\n setGrades((currentGrades) => {\n return currentGrades.filter((grade) => grade.id !== id);\n });\n };\n\n return (\n \n {children}\n \n );\n};\n","import kurasu from \"kurasu\";\n\nexport const buttonClass =\n \"w-36 bg-gray-200 inline-flex items-center p-2 justify-center rounded border-gray-400 border\";\n\nexport const Button = kurasu.button(buttonClass);\n\nexport const blueButtonClass =\n \"bg-blue-300 inline-flex items-center p-2 justify-center rounded border-blue-400 border\";\nexport const BlueButton = kurasu.button(blueButtonClass);\n\nexport const pinkButtonClass =\n \"bg-pink-200 inline-flex items-center p-2 justify-center rounded border-pink-300 border\";\nexport const PinkButton = kurasu.button(pinkButtonClass);\n","export const randomArrayItem = (array: T[]): T => {\n const randomIndex = Math.floor(Math.random() * array.length);\n \n return array[randomIndex];\n}\n","import { useContext } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { blueButtonClass, pinkButtonClass, Button } from \"../Button\";\nimport { randomArrayItem } from \"../TabGenerator/randomArrayItem\";\nimport { Note, notes } from \"../TabGenerator/Tab.type\";\nimport { ConfigContext } from \"./Config.provider\";\n\n\n Tab generator\n;\n\nconst KeySelect = () => {\n const config = useContext(ConfigContext);\n\n return (\n
\n {\n const newNote = event.target.value as Note;\n config.updateKey(newNote);\n }}\n >\n {notes.map((note) => (\n \n ))}\n \n {\n config.updateKey(randomArrayItem(notes));\n }}\n >\n Randomise Key\n \n
\n );\n};\n\nconst RandomEnabled = () => {\n const config = useContext(ConfigContext);\n return (\n \n );\n};\n\nconst RandomAmount = () => {\n const config = useContext(ConfigContext);\n return (\n {\n config.setRandom(Number(e.target.value));\n }}\n />\n );\n};\nconst GradesForm = () => {\n const config = useContext(ConfigContext);\n\n return (\n
\n
\n {config.grades.map(({ grade, id }) => {\n return (\n \n config.updateGrade(id, Number(e.target.value))}\n >\n {\n config.removeGrade(id);\n }}\n >\n \n \n \n \n
\n );\n })}\n
\n {\n config.createGrade();\n }}\n >\n \n \n \n \n \n );\n};\n\nexport const GradesPage = () => {\n const config = useContext(ConfigContext);\n return (\n <>\n
\n

Elempiar's Tab Generator

\n

\n This tool helps you generate guitar tabs in case you're stuck writing\n your next masterpiece.\n

\n
\n
\n \n \n \n \n Get Inspired\n \n
\n
\n

\n Start by selecting the key your song is in. Don't have a key yet? Just\n generate one!\n

\n
\n \n
\n

\n Now choose whether you want to completely randomise the tab, or to use\n your own personal input as a base for the tab.\n

\n

\n For example: Keep track of your mood for a week. Rate it on a scale of\n 1-10 every few hours, and use these scores as a base for your tab.\n

\n
\n \n {config.random === false ? (\n
\n

\n Time to add your own input! The generator converts every specific\n input into a note on the tab. Keep in mind; you can only use numbers\n between 0-10.\n

\n \n
\n ) : (\n
\n

\n Last but not least: choose how many notes you want in your tab.\n

\n \n
\n )}\n
\n \n Generate Tab\n \n
\n \n );\n};\n","import { Note } from \"./Tab.type\";\n\n// @ts-ignore\nexport const majorScales: {\n [groundNote in Note]: Note[];\n} = {\n Aflat: [Note.Aflat, Note.Bflat, Note.C, Note.Dflat, Note.Eflat, Note.F, Note.G],\n A: [Note.A, Note.B, Note.Dflat, Note.D, Note.E, Note.Gflat, Note.Aflat],\n Bflat: [Note.Bflat, Note.C, Note.D, Note.Eflat, Note.F, Note.G, Note.A],\n B: [Note.B, Note.Dflat, Note.Eflat, Note.E, Note.Gflat, Note.Aflat, Note.B],\n C: [Note.C, Note.D, Note.E, Note.F, Note.G, Note.A, Note.B],\n Dflat: [Note.Dflat, Note.Eflat, Note.F, Note.Gflat, Note.Aflat, Note.Bflat, Note.C],\n D: [Note.D, Note.E, Note.Gflat, Note.G, Note.A, Note.B, Note.Dflat],\n Eflat: [Note.Eflat, Note.F, Note.G, Note.Aflat, Note.Bflat, Note.C, Note.D],\n E: [Note.E, Note.Gflat, Note.Aflat, Note.A, Note.B, Note.Dflat, Note.Eflat],\n F: [Note.F, Note.G, Note.A, Note.Bflat, Note.C, Note.D, Note.E],\n Gflat: [Note.Gflat, Note.Aflat, Note.Bflat, Note.B, Note.Dflat, Note.Eflat, Note.F],\n G: [Note.G, Note.A, Note.B, Note.C, Note.D, Note.E, Note.Gflat],\n \n}","import { Notation, Note } from \"./Tab.type\";\n\nexport const notations: {\n [note in Note]: Notation[]\n} = {\n A: [{fret: 5, string: 0}, {fret: 0, string: 1}, {fret: 7, string: 2}, {fret: 2, string: 3}, {fret: 10, string: 4}, {fret: 5, string: 5}],\n Bflat: [{fret: 6, string: 0}, {fret: 1, string: 1}, {fret: 8, string: 2}, {fret: 3, string: 3}, {fret: 11, string: 4}, {fret: 6, string: 5}],\n B: [{fret: 7, string: 0}, {fret: 2, string: 1}, {fret: 9, string: 2}, {fret: 4, string: 3}, {fret: 0, string: 4}, {fret: 7, string: 5}],\n C: [{fret: 8, string: 0}, {fret: 3, string: 1}, {fret: 10, string: 2}, {fret: 5, string: 3}, {fret: 1, string: 4}, {fret: 8, string: 5}],\n Dflat: [{fret: 9, string: 0}, {fret: 4, string: 1}, {fret: 11, string: 2}, {fret: 6, string: 3}, {fret: 2, string: 4}, {fret: 9, string: 5}],\n D: [{fret: 10, string: 0}, {fret: 5, string: 1}, {fret: 0, string: 2}, {fret: 7, string: 3}, {fret: 3, string: 4}, {fret: 10, string: 5}],\n Eflat: [{fret: 11, string: 0}, {fret: 6, string: 1}, {fret: 1, string: 2}, {fret: 8, string: 3}, {fret: 4, string: 4}, {fret: 11, string: 5}],\n E: [{fret: 0, string: 0}, {fret: 7, string: 1}, {fret: 2, string: 2}, {fret: 9, string: 3}, {fret: 5, string: 4}, {fret: 0, string: 5}],\n F: [{fret: 1, string: 0}, {fret: 8, string: 1}, {fret: 3, string: 2}, {fret: 10, string: 3}, {fret: 6, string: 4}, {fret: 1, string: 5}],\n Gflat: [{fret: 2, string: 0}, {fret: 9, string: 1}, {fret: 4, string: 2}, {fret: 11, string: 3}, {fret: 7, string: 4}, {fret: 2, string: 5}],\n G: [{fret: 3, string: 0}, {fret: 10, string: 1}, {fret: 5, string: 2}, {fret: 0, string: 3}, {fret: 8, string: 4}, {fret: 3, string: 5}],\n Aflat: [{fret: 4, string: 0}, {fret: 11, string: 1}, {fret: 6, string: 2}, {fret: 1, string: 3}, {fret: 9, string: 4}, {fret: 4, string: 5}]\n}","import { useContext, useMemo, useState } from \"react\";\nimport { ConfigContext } from \"../Config/Config.provider\";\nimport { TabWriterNote, Note, Notation } from \"./Tab.type\";\nimport createTab from \"tabwriter\";\nimport { Link } from \"react-router-dom\";\nimport { randomArrayItem } from \"./randomArrayItem\";\nimport { majorScales } from \"./majorScales\";\nimport { notations } from \"./notations\";\nimport { range, chunk } from \"lodash\";\nimport { BlueButton } from \"../Button\";\nimport { pinkButtonClass, Button } from \"../Button\";\n\nconst mapGradeToNote = (songKey: Note, grade: number) =>\n majorScales[songKey][Math.floor(grade * (6 / 10))];\n\nconst generateFretAndString = (randomNote: Note): Notation =>\n randomArrayItem(notations[randomNote]);\n\nconst generateRandomGrades = (randomAmount: number) =>\n range(randomAmount).map(() => Math.floor(Math.random() * 10));\n\nexport const TabGeneratorPage = () => {\n const config = useContext(ConfigContext);\n\n const [randomId, setRandomId] = useState(0);\n\n const songLines = useMemo(() => {\n const finalGrades =\n config.random === false\n ? config.grades.map(({ grade }) => grade)\n : generateRandomGrades(config.random);\n const gradeChunks = chunk(\n finalGrades.filter((grade): grade is number => typeof grade === \"number\"),\n 16\n );\n\n const notes = gradeChunks.map((grades) => {\n return grades.map((grade, index) => {\n const { fret, string } = generateFretAndString(\n mapGradeToNote(config.key, grade)\n );\n return {\n beat: index * 2 + 1,\n fret,\n string,\n };\n });\n });\n\n return notes.map((notes: TabWriterNote[]): string[] => createTab(notes));\n }, [config.key, randomId]);\n\n return (\n
\n
\n \n \n \n \n Change Settings\n \n {\n setRandomId((id) => id + 1);\n }}\n >\n \n \n \n Regenerate Tab\n \n
\n
\n key\n
\n
{config.key}
\n
\n
\n \n \n \n \n Inspire\n \n
\n
\n {songLines.map((songLine) => (\n
{songLine.join(\"\\n\")}
\n ))}\n
\n );\n};\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./index.css\";\nimport { ConfigProvider } from \"./Config/Config.provider\";\nimport { BrowserRouter, Route, Switch } from \"react-router-dom\";\nimport { GradesPage } from \"./Config/Config.page\";\nimport { TabGeneratorPage } from \"./TabGenerator/TabGenerator.page\";\n\nReactDOM.render(\n \n \n \n
\n \n \n \n \n \n \n \n \n
\n
\n
\n
,\n document.getElementById(\"root\")\n);\n"],"sourceRoot":""}