Skip to content

Commit

Permalink
Publish update v3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Specy committed Apr 8, 2024
1 parent c939ee0 commit 2350f04
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/components/pages/Composer/MidiParser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class MidiImport extends Component<MidiImportProps, MidiImportState> {
return buffer
}
parseAudioToMidi = async (audio: AudioBuffer, name: string) => {
if (!this.warnedOfExperimental) logger.warn("🔬 This feature is experimental, it might not work or get stuck. \nAudio and video conversion is less accurate than MIDI, if you can, it's better to use MIDI or compose manualy. \nUse audio and videos that have only one instrument playing.", 18000)
if (!this.warnedOfExperimental) logger.warn("🔬 This feature is experimental, it might not work or get stuck. \nAudio and video conversion is less accurate than MIDI, if you can, it's better to use MIDI or compose manually. \nUse audio and videos that have only one instrument playing.", 18000)
this.warnedOfExperimental = true
const frames: number[][] = []
const onsets: number[][] = []
Expand Down
3 changes: 2 additions & 1 deletion src/components/pages/Index/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export default function Home({askForStorage, hasVisited, setDontShowHome, closeW
const history = useRouter()
const [theme] = useTheme()

function clearCache() {
async function clearCache() {
if(await asyncConfirm("Are you sure you want to clear the cache? The page will reload")) return
clearClientCache()
.then(() => {
logger.success("Cache Cleared")
Expand Down
76 changes: 39 additions & 37 deletions src/pages/keybinds/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,45 @@ export default function Keybinds() {
<MidiSetup/>
{!IS_MOBILE
&& <>
<h1>
Keyboard keybinds
</h1>
<div>
You can remap the keyboard keys to whatever key on your keyboard, press the note you want to remap
then press the key you want to assign to it.
</div>
<div className="flex-centered">
<div
className={`keyboard ${APP_NAME === 'Sky' ? 'keyboard-5' : ''}`}
style={{
margin: '1rem 0'
}}
>
{baseInstrument.notes.map((note, i) =>
<BaseNote
key={i}
data={{
status: (selected.type === 'keyboard' && i === selected.index) ? 'clicked' : ''
}}
noteImage={baseInstrument.notes[i].noteImage}
noteText={(
keyBinds.getKeyOfShortcut(
"keyboard",
{name: note.noteNames.keyboard, holdable: false}
) ?? "???")
.replace("Key", "")
}
handleClick={() => {
setSelected({
type: 'keyboard',
index: selected.index === i ? -1 : i
})
}}
/>
)}
</div>
</div>

<h1>
Composer shortcuts
</h1>
Expand Down Expand Up @@ -112,43 +151,6 @@ export default function Keybinds() {
}}
/>
</div>
<h1>
Keyboard keybinds
</h1>
<div>
You can remap the keyboard keys to whatever key on your keyboard
</div>
<div className="flex-centered">
<div
className={`keyboard ${APP_NAME === 'Sky' ? 'keyboard-5' : ''}`}
style={{
margin: '1rem 0'
}}
>
{baseInstrument.notes.map((note, i) =>
<BaseNote
key={i}
data={{
status: (selected.type === 'keyboard' && i === selected.index) ? 'clicked' : ''
}}
noteImage={baseInstrument.notes[i].noteImage}
noteText={(
keyBinds.getKeyOfShortcut(
"keyboard",
{name: note.noteNames.keyboard, holdable: false}
) ?? "???")
.replace("Key", "")
}
handleClick={() => {
setSelected({
type: 'keyboard',
index: selected.index === i ? -1 : i
})
}}
/>
)}
</div>
</div>
<h1>
Vsrg keybinds
</h1>
Expand Down
25 changes: 15 additions & 10 deletions src/service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ if (IS_TAURI) {
console.log("registering routes")
registerRoute(
({url}) => {
if (forbiddenCachedItems(new URL(url))) {
console.log("forbidden", url.pathname)
return false
try {
if (forbiddenCachedItems(new URL(url))) {
return false
}
} catch (e) {
console.error("Error caching", e)
}
console.log("allowed", url.pathname)
return true
},
new NetworkFirst({
Expand All @@ -68,12 +70,15 @@ if (IS_TAURI) {
);
registerRoute(
({url}) => {
if (forbiddenCachedItems(new URL(url))){
return false
}
if(url.pathname.endsWith(".mp3") || url.pathname.endsWith(".wav")){
console.log("runtime cache audio", url.pathname)
return true
try {
if (forbiddenCachedItems(new URL(url))) {
return false
}
if (url.pathname.endsWith(".mp3") || url.pathname.endsWith(".wav")) {
return true
}
} catch (e) {
console.error("Error caching", e)
}
return false
},
Expand Down

0 comments on commit 2350f04

Please sign in to comment.