< Summary

Information
Class: MusicTheory.Theory.Pitch.Pitch
Assembly: MusicTheory
File(s): /home/runner/work/MusicTheory/MusicTheory/Theory/Pitch/PitchClass.cs
Line coverage
50%
Covered lines: 1
Uncovered lines: 1
Coverable lines: 2
Total lines: 20
Line coverage: 50%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Spelling()100%11100%
ToString()100%210%

File(s)

/home/runner/work/MusicTheory/MusicTheory/Theory/Pitch/PitchClass.cs

#LineLine coverage
 1namespace MusicTheory.Theory.Pitch
 2{
 3
 4    // 等音(pc)
 5    public readonly record struct PitchClass(int Value)
 6{
 7    public int Pc => ((Value % 12) + 12) % 12;
 8    public static PitchClass FromMidi(int midi) => new(midi % 12);
 9    public static PitchClass operator +(PitchClass a, int semitones) => new(a.Pc + semitones);
 10    public override string ToString() => Pc.ToString("00");
 11}
 12
 13
 14    // 絶対音(綴り+オクターブ)
 5715    public readonly record struct Pitch(SpelledPitch Spelling, int Octave)
 16    {
 017        public override string ToString() => $"{Spelling}{Octave}";
 18    }
 19
 20}

Methods/Properties

get_Spelling()
ToString()