Skip to content

girasole123/ABC_Music_Notation-Anki-addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ABC Music Notation (music integration addon for Anki 2)

ABC Notation is a system designed to notate music in plain text format. http://abcnotation.com

With this addon, you can add music snippets to your deck, wrapped in [abc]c d e[/abc] tags, and they will be converted to an MP3 music file.

For this addon to work, you have to install abc2midi, timidity and lame first and they need to be in your PATH.

How to use

This addon understands [abc] tags:
[abc]c d e[/abc]

Alternatively, you can create dedicated fields, e.g. front-abc or back-abc, and omit the [abc] tags for them:
c d e

With abc in the field name, it will act as if the entire field content was wrapped in [abc][/abc] tags.

This addon allows the creation of custom templates (see below), and specifying which template to use:
[abc=default]c d e[/abc]
[abc=yourtemplate]c d e[/abc]

The name of the default template is default, so [abc=default] is identical to [abc].

You can also use templates in abc fields by giving them names like front-abc-yourtemplate, back-abc-yourtemplate.

Mobile/Web support

Anki addons are desktop only, so by default, sounds won't appear on other platforms since those platforms won't know what to make of a [abc] tag or how to treat a abc field.

However, if you are using abc fields, and for each field create another field called abcsnd, the desktop addon will automatically fill it with the [sound] tag.

For example, if your field is front-abc, with content c d e, and you have another field front-abcsnd, and use only the front-abcsnd field in your card template, the sound will appear on all platforms (provided that the desktop addon generated the MP3 file once and the MP3 files were synced to the other platforms as well).

Note: If you add text to a abcsnd field, it will be overwritten and discarded by the addon.

ABC Templates

The addons/abc directory holds template files for ABC Notation. Templates can be created and edited from within Anki, using the Tools->abc menu.

Please restart Anki when you change templates.

The default template is default.abc and used by:
[abc]code[/abc]
[abc=default]code[/abc]
somefield-abc

All other templates have to be specified by name:
[abc=templatename]code[/abc]
somefield-abc-templatename

In the template, %ANKI% will be replaced with code. Multiple codes can be specified, by separating them with %%%:

[abc]
code1
%%%
code2
[/abc]

In the template, the first occurrence of %ANKI% will be replaced with code1, the second occurrence of %ANKI% with code2.

The number of %ANKI% in the template has to match the number of codes used for this template always, otherwise the remaining occurrences of %ANKI% will not be replaced, or the surplus specified codes will not be inserted.

The default template looks like this:

X:1
M:4/4
L:1/4
K:C
%ANKI%

If you would like write your own header, you can choose the void template (file template is void.abc and contains only %ANKI%):

[abc=void]
X:1
T:My own header's title
M:6/8
L:1/8
Q:C8=30
K:F
|: ddc B2 A | AGG F2 D | ddc B2 A | GGF G3 :|
|: AAA c2 c | ccc d2 d | ddc B2 A | GGF G3 :|
[/abc]

or somefield-abc-void

Please refer to the ABC Notation homepage and documentation for details on how to write ABC Notation code.

You can also use %%MIDI commands (or [I:MIDI=] inline equivalents) which are particular to the abc2midi program, e.g. %%MIDI drum command (refer to the Guide to Advanced Futures of abc2midi: http://ifdo.pugmarks.com/~seymour/runabc/abcguide/abc2midi_guide.html).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages