npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ta-csa

v1.0.2

Published

Text-Alive Chord String Analysis

Downloads

9

Readme

Text-Alive Chord String Analysis

Text Alive のコード文字列を音の位置の配列に変換するプログラムです。

対応内容

対応コード

  • 対応コード一覧 (括弧内は、分析対象の文字列。重要度分類については、「うちやま作曲教室」様のサイトを参照しました。)
    • コードの種類:重要レベル☆☆☆
      • メジャー( M ) / マイナー( m ) / セブンス( 7 )
      • マイナーセブンス( m7 ) / メジャーセブンス( M7 ) / 分散コード( / )
    • コードの種類:重要レベル☆☆
      • マイナー・セブン フラット・ファイブ( m7(b5) ) / ディミニッシュトライアド( dim ) [^1] / ディミニッシュ( dim7 ) [^2]
      • サスフォー( sus4 ) / セブンサスフォー( 7sus4 ) [^3]
      • オーギュメント( aug ) / マイナーシックス( m6 )
      • テンションコード ( (b9) / (9) / (#9) / (11) / (#11) / (b13) / (13) )
      • アドナインス( add9 )
    • コードの種類:重要レベル☆
      • シックス( 6 ) / マイナーメジャーセブンス( mM7 ) / セブン フラット・ファイブ( 7(b5) ) [^4]
    • コードの種類:その他、上記参照したサイトには記載が無いが、対応しているコード
  • 対応コードのテスト一覧

これから対応予定の事

  • 分散コードの「 on 」の文字列への対応
    • Text Alive では、分散コードが「 / 」の為、優先度低
  • omit 」への対応
    • sus2 」と「 add9(omit3) 」が、ほぼ同義、かつ、「 sus2 」対応済みの為、優先度低
      • Csus2 : C D G
      • Cadd9(omit3) : C ~~E~~(omit3) G D(add9) > C G D
  • 音楽知らない人が、当プログラムを作っているので、「この解釈間違っている」「こんなコードも対応して欲しい」等ありましたら、Issueを書いていただければ、対応します。

使用方法

インストール

npm install ta-csa

プログラム上での利用方法

  • まずはインポートを行います。
import ChordController from "ts-csa";
  • クラスを初期化します。
const chordCtrl = new ChordController();
  • コンソールログに、デバッグログを出力したい方は、フラグを設定します。
chordCtrl.setIsDebug();
  • コードの文字列から、音の位置を示す配列を、数値化して取得する場合には、 analysisChord を使用します。
    • 下記の例だと、 [4, 7, 10, 14] が取得できます。
const chordArray = chordCtrl.analysisChord("Em7(b5)");
  • コードの文字列から、1オクターブに収まる数値化した配列を取得する場合には、 getOctaveChord を使用します。
    • 下記の例だと、 [2, 4, 7, 10] が取得できます。
const chordArray = chordCtrl.getOctaveChord("Em7(b5)");

補足

フラットファイブの扱いについて

  • 当プログラムでは、単純に b5 ( -5 ) が存在した時、5度の音を半音下げる、とします。
    • 括弧があろうがなかろうが、 b5 ( -5 ) の文字列だけで判定します。
    • ただし、♭がありえるコードの場合は、必ず括弧をつけてください。
  • 以前記載していた「マイナー・セブン フラット・ファイブの「 m7(-5) 」「 m-5 」「 m(-5) 」の文字列への対応」も含め、以下の様に扱います。
    • m-5 」「 m(-5) 」を「マイナー・セブン フラット・ファイブ」として取り扱うには、コードが複雑になる為、セブンスとして扱わない事にしました。
  • 取扱例)
    • m7(-5): マイナー・セブン フラット・ファイブ
    • m-5: マイナー フラット・ファイブ
    • m(-5): マイナー フラット・ファイブ
    • B(b5): B の フラット・ファイブ
    • Bb5: B♭ (先頭から、Bbが有効となる為、5だけになるので、フラットファイブとは見做さない)
    • DM7b5: D の メジャー・セブン フラット・ファイブ
    • Dbb5: D♭ の フラット・ファイブ
    • Dmb5: D の マイナー フラット・ファイブ

文中の注釈

[^1]: dim で四和音のディミニッシュとしているサイトもありますが、当プログラムでは三和音と四和音を分ける為に、 dim は三和音のディミニッシュ・トライアド(減三和音)として扱います。 [^2]: m6(b5) の様な記述は、以下理由で、ディミニッシュとして同様に解析されます。
m6(b5): m6 が作成され、 (b5) で5度の音が半音下がるので、 dim7 の表記と同様の解析結果となります。
Cm6(b5) の場合、 Cm6 の「ド、ミ♭、ソ、ラ」が作成され、5度のソが半音下がり、「ド、ミ♭、ソ♭、ラ」となるので、結果として、「ド、レ♯、ファ♯、ラ」と同じ音の位置が取得されます。 [^3]: 当プログラムでは、「セブンス」と「サスフォー」の組み合わせで作成しています。 [^4]: 当プログラムでは、「セブンス」と「フラットファイブ」の組み合わせで作成しています。
参照サイトの表記( C7-5 )と違うのは、当プログラムのフラットの扱いが、基本は b の文字としている為です。 - でもフラットファイブとして取り扱います。