Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsidian freeze on switching to Reading View, if highest note exactly equal to tuning of top string. #33

Open
miesvanderrobot opened this issue Jul 31, 2023 · 1 comment

Comments

@miesvanderrobot
Copy link

miesvanderrobot commented Jul 31, 2023

Well, here's a weird one. This will probably turn out to be an ABCjs issue, but I'm starting here so you can rule out anything on your end.

{
  "tablature": [{
    "instrument": "mandolin", 
    "label": "Tenor Guitar (%T)", 
    "tuning": ["C,", "G,", "D", "A"],
    "highestNote": "A"
  }]
}
---
X:1
T: Cooley's
M: 4/4
L: 1/8
R: reel
K: G
|:D2|EB{c}BA B2 EB|~B2 AB dBAG|FDAD BDAD|FDAD dAFD|

Attempt to switch to reading view and the Obsidian UI becomes almost entirely unresponsive. The only thing you can do is scroll the current pane. No links or UI elements work. I ended up having to quit the app.

Note that this does not happen if the highest note is merely too low for the range of the tune (e.g. if you change the "A" to "B" here), but only if they are equal. The rendering when B is the highest note still doesn't match the ABCjs expected behavior—"If a note is out of range a question mark will be printed instead", but I'll open a separate issue for that.

@miesvanderrobot
Copy link
Author

Not sure it does much to test this one in HTML, as "Obsidian freezes" isn't really reproducible when no Obsidian is involved, but for completeness's sake, this HTML demonstrates that the browser doesn't freeze/crash under this condition:

<html>
<head>
    <style>
        
    </style>
    <script src="/scripts/snippet-javascript-console.min.js?v=1"></script>
</head>
<body>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/abcjs/6.2.2/abcjs-basic-min.js" integrity="sha512-KXKtG2UKjAKEEwwKKNioYwVHGm/gH0ZmME+ePGFwbjs4Banx6+xJVtDpC2A2QM9nGtamOP4tqEYfxloLjq3XcA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<div id="music">
{
    "tablature": [{
        "instrument": "mandolin", 
        "label": "Tenor Guitar (%T)", 
        "tuning": ["C,", "G,", "D", "A"],
        "highestNote": "B"
    }]
}
---
X:1
T: Cooley's
M: 4/4
L: 1/8
R: reel
K: G
|:D2|EB{c}BA B2 EB|~B2 AB dBAG|FDAD BDAD|FDAD dAFD|
</div>
    <script type="text/javascript">
        ABCJS.renderAbc("music", $("#music").text(), {
        "tablature": [{
        "instrument": "mandolin", 
        "label": "Tenor Guitar (%T)", 
        "tuning": ["C,", "G,", "D", "A"],
        "highestNote": "A"
    }]
});
    </script>
</body>
</html>```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant