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

Using abcjs in moodle with "generico" plugin #726

Closed
nmarafo opened this issue Oct 6, 2021 · 6 comments
Closed

Using abcjs in moodle with "generico" plugin #726

nmarafo opened this issue Oct 6, 2021 · 6 comments

Comments

@nmarafo
Copy link

nmarafo commented Oct 6, 2021

It is impossible to play the audio importing the library through the usual CDNs since "abcjs_basic-min.js" or "abcjs_editor-min.js" do not include the "ABCJS.synth" method.

@paulrosen
Copy link
Owner

What CDN are you using? It must not be updated to use the latest.

@nmarafo
Copy link
Author

nmarafo commented Oct 8, 2021

I'm using cdnjs. I have tried with 3.1.1 (seem the last), but in none I find the ABCJS.synth method

@paulrosen
Copy link
Owner

I'm not sure where that came from. I didn't submit anything to it. Can you try https://cdn.jsdelivr.net/npm/[email protected]/dist/abcjs-basic-min.js ? That reflects the npm package.

@nmarafo
Copy link
Author

nmarafo commented Oct 8, 2021

Thank you very much Paul. Now the sound works perfectly !! However, our idea was to simultaneously enable not only playback of the score, but also editing, so we also needed "ABCJS.Editor". Cannot be found in "abcjs-basic-min.js". In order to achieve the goal of simultaneous editing plus playback, the ideal would be to get "ABCJS.Editor" and "ABCJS.Synth" on a single CDN.
Still I wanted to congratulate you on your great work with this library. The work you have done is amazing.

@paulrosen
Copy link
Owner

The editor is already included. Here is a complete example (modified from the editor.html example):

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" href="favicon.ico" type="image/x-icon"/>
  <link rel="stylesheet" href="examples-styles.css"/>

  <title>Basic Editor</title>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/abcjs-basic-min.js" type="text/javascript"></script>
  <script type="text/javascript">
    window.onload = function() {
      new ABCJS.Editor("abc", { canvas_id: "paper",
        warnings_id: "warnings",
        abcjsParams: {}
      });
    }

  </script>
</head>
<body>
  <header>
    <img src="../docs/.vuepress/public/img/abcjs_comp_extended_08.svg" alt="abcjs logo">
    <h1>abcjs editor</h1>
  </header>
  <div class="container">
    <textarea id="abc" cols="80" rows="12" spellcheck="false">
X: 1
T: Cooley's
M: 4/4
L: 1/8
R: reel
K: Emin
|:D2|EB{c}BA B2 EB|~B2 AB dBAG|FDAD BDAD|FDAD dAFD|
EBBA B2 EB|B2 AB defg|afe^c dBAF|DEFD E2:|
|:gf|eB B2 efge|eB B2 gedB|A2 FA DAFA|A2 FA defg|
eB B2 eBgB|eB B2 defg|afe^c dBAF|DEFD E2:|
    </textarea>

    <div id="warnings"></div>
    <hr>
    <div id="paper"></div>
  </div>
</body>
</html>

@nmarafo
Copy link
Author

nmarafo commented Oct 10, 2021

Indeed, it works with any compiler such as codepen.io rendering, editing and playback. Therefore, the orientations that you indicated to me are correct. Thanks!! I thought that version 6.0.0-beta33 would work with the "Generic" moodle plugin. However it does not work and it does with version 3.1.1. Therefore it is not a failure of the abcjs library, but of the conversion that the moodle plugin performs. I have opened an issue in Justin Hunt's project to see if he can offer any solutions.

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

2 participants