Comments (12)
Currently there's no support for abc notation. If you mean convert a note from, for example "c" to "C5", it should be easy to implement using note.build
function.
What do you need this for?
from tonal.
I'm trying to computationally parse an abc string it into an object, manipulate it (ie change tones, pitch and etc) using tonal and convert it back into a string.
from tonal.
I've wrote the tonal-abc-notation
: http://danigb.github.io/tonal/api/module-abc-notation.html
You can install it using npm. Hope it helps.
from tonal.
Thanks for the reply! How can I use that module in the browser?
from tonal.
You can use a tool that can convert from node modules to browser modules. I think the easiest one is browserify: http://browserify.org/
The other option is to use a tool like budo: https://github.com/mattdesl/budo. It's easier to get started, but after you will need to use browserify or something similar.
Hope it helps.
from tonal.
Thanks! I have Tonal running in the browser but now I'm not able to call functions from it in the console. Any tips?
from tonal.
If you are using the including the file from the dist/
folder, like this: <script src="tonal.min.js"></script>
, you can write at the console: Tonal.midi('c4')
and it should work.
But abc-notation module is not included in the bundled file. So, to use it, you need to create a file like index.js with something like:
// use the Abc module standalone
const Abc = require("tonal-abc-notation");
console.log(Abc.toAbc("C#4"));
// use it with Tonal
const Tonal = require("tonal");
console.log(Tonal.Scale.notes("Bb major").map(Abc.toAbc));
and then use browserify to create a browser compatible version (and load that file with a <script>
tag inside an html file). Hope it helps.
from tonal.
Thanks. As I mentioned I have it bundled using browserify and running in the browser. I just asking if its possible to call functions in the console. If so how? Thanks again!
from tonal.
Yes, I don't know if I get you
You can open a console using the browser's developer tools, and write Tonal.Scale.notes("C major")
and you will see the output (an array of notes). This just works.
from tonal.
It doesnt work for me. When I tried to call:
Tonal.Scale.notes("C major")
and I get this error:
VM2704:1 Uncaught ReferenceError: Tonal is not defined
at <anonymous>:1:1
from tonal.
If you use the tonal.min.js dist file, it works out of the box. If you are transpiling your own sources, you must export the tonal facade inside your code: window.Tonal = Tonal;
(and window.Abc = Abc;
if you want to use it from the console)
Hope it helps!
from tonal.
That works! Thanks for answering these general JS questions! Can I also ask how you recommend structuring the other vars and functions (that aren't in a class) to access in the same way? I tried using a closure but that didn't work.
from tonal.
Related Issues (20)
- Chord Progressions only for Major keys HOT 2
- Command line interface HOT 1
- Can't edit the Readme file in order to add a personal project to the list HOT 2
- Chord.get() doesn't work with some results from Chord.detect() HOT 2
- Getting some unexpected note names for some scales HOT 1
- Few questions about setting up the development environment
- Chord.detect unexpected results for simple detection Cmajor HOT 1
- Diminshed chords bug in Progressions HOT 1
- State of the Project HOT 1
- Tonal is not defined HOT 12
- Tonal Browser version does not work since last repo update HOT 1
- memory leak in note function HOT 10
- error when trying to get TimeSignature with lower > 9 HOT 3
- Triads in key HOT 5
- Tonal is not defined HOT 2
- tonaljs/key melodic minor chord HOT 3
- How to transpose note along scale based on interval (across octaves)? HOT 1
- Scale.detect() is producing incorrect results when using a tonic outside the list of provided notes HOT 1
- Chord.get cannot parse `G6add9` HOT 8
- `Scale.scaleNotes` returns an array instead of a pcset. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tonal.