Skip to content

parameswaran-natarajan/Chords-Transposer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chords Transposer

Easily transpose chords from a one scale to another scale

using chords.js file you can parse a raw text into chords and song lines, transpose song from this scale to given scale or from a required numbers of semitones.

use

<script src="lib/chords.js"></script>

to add chords.js file into html page

Exposed Functions

  shiftScale(src, from, to);
  shiftScaleBy(src, val);
  parse(src);

Examples

function shift(src_id, dst_id, from, to) {
    val = 0;
    var src = document.getElementById(src_id);
    var dst = document.getElementById(dst_id);
    dst.innerHTML = chords.shiftScale(src, from, to); //returns a string
}

function shiftPlus(src_id, dst_id) {
    val += 1;
    var src = document.getElementById(src_id);
    var dst = document.getElementById(dst_id);
    dst.innerHTML = chords.shiftScaleBy(src, val); //returns a string
}

function shiftMinus(src_id, dst_id) {
    val -= 1;
    var src = document.getElementById(src_id);
    var dst = document.getElementById(dst_id);
    dst.innerHTML = chords.shiftScaleBy(src, val); //returns a string
}

function parse(src_id, dst_id) {
    val = 0;
    var src = document.getElementById(src_id);
    var dst = document.getElementById(dst_id);
    dst.innerHTML = chords.parse(src); //returns a string
}

Contributions are welcome!

About

Chords Transposer and raw string parse into chords and lyrics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 50.3%
  • HTML 44.0%
  • CSS 5.7%