• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbarbin / fingerboard / 75

18 Jul 2024 07:16AM UTC coverage: 95.966% (-0.2%) from 96.151%
75

push

github

mbarbin
Add explicit ppxlib dependency

This will allow enforcing >= 0.33 in the near future.

3521 of 3669 relevant lines covered (95.97%)

19663.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.86
/src/located_note.ml
1
(**********************************************************************************)
2
(*  Fingerboard - a microtonal geography of the cello fingerboard                 *)
3
(*  Copyright (C) 2022-2024 Mathieu Barbin <mathieu.barbin@gmail.com>             *)
4
(*                                                                                *)
5
(*  This file is part of Fingerboard.                                             *)
6
(*                                                                                *)
7
(*  Fingerboard is free software: you can redistribute it and/or modify it under  *)
8
(*  the terms of the GNU Affero General Public License as published by the Free   *)
9
(*  Software Foundation, either version 3 of the License, or any later version.   *)
10
(*                                                                                *)
11
(*  Fingerboard is distributed in the hope that it will be useful, but WITHOUT    *)
12
(*  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or         *)
13
(*  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License   *)
14
(*  for more details.                                                             *)
15
(*                                                                                *)
16
(*  You should have received a copy of the GNU Affero General Public License      *)
17
(*  along with Fingerboard. If not, see <https://www.gnu.org/licenses/>.          *)
18
(**********************************************************************************)
19

20
type t =
31✔
21
  { note : Note.t
31✔
22
  ; fingerboard_location : Fingerboard_location.t
31✔
23
  }
24
[@@deriving sexp_of]
25

26
module Abbrev = struct
27
  type t = string * string * Roman_numeral.t [@@deriving sexp_of]
×
28
end
29

30
let to_abbrev { note; fingerboard_location = { fingerboard_position; string_number } } =
31
  Note.to_string note, Fingerboard_position.to_string fingerboard_position, string_number
31✔
32
;;
33

34
module Scale_abbrev = struct
35
  type t = (Roman_numeral.t * (string * string) list) list [@@deriving sexp_of]
102✔
36
end
37

38
let to_scale_abbrev ts =
39
  List.group ts ~break:(fun t1 t2 ->
102✔
40
    not
2,653✔
41
      (Roman_numeral.equal
2,653✔
42
         t1.fingerboard_location.string_number
43
         t2.fingerboard_location.string_number))
44
  |> List.map ~f:(fun ts ->
102✔
45
    let string_number = (List.hd_exn ts).fingerboard_location.string_number in
362✔
46
    ( string_number
47
    , List.map ts ~f:(fun t ->
362✔
48
        ( Note.to_string t.note
2,755✔
49
        , Fingerboard_position.to_string t.fingerboard_location.fingerboard_position )) ))
2,755✔
50
;;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc