Skip to content

ljfreelancer88/transpose

Repository files navigation

Chord transposer for PHP

Latest Version on Packagist Total Downloads GitHub Actions

Tranponse lyrics with chords using PHP. It's been used at Collideborate

Note: Under Development :)

Installation

You can install the package via composer:

composer require ljfreelancer88/transpose
php composer.phar require ljfreelancer88/transpose

Usage

# 1. Import the package
use Ljfreelancer88\Transpose\Transpose;

# 2. Somewhere in your Controller
$key = 'C'; // C, C#, Db, D

$transposer = new Transpose($model->content);
$transposer->setKey($key);
$transposer->loadSong();
$transposedSong = $transposer->transpose($model->key, $key);

# OR

$transposer = new Transpose();
$transposer->setKey($key);
$transposer->loadSong($model->content);
$transposedSong = $transposer->transpose($model->key, $key);

# 3. Somewhere in your View
echo "<pre>$transposedSong</pre>";

Testing

composer test
composer psalm

php vendor/bin/phpunit tests
php vendor/bin/psalm

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

About

Transpose chords using PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages