{"action":"created","comment":{"url":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/comments/79211315","id":79211315,"diff_hunk":"@@ -41,17 +41,112 @@ class ToneTests: XCTestCase {\n         XCTAssertTrue(tone.debugDescription == \"f𝄫7\")\n     }\n     \n+    // MARK: - ==\n+    // MARK: Successes\n+    \n     func testEqual() {\n         let tone1 = Tone(accidental: .sharp, noteLetter: .d, octave: .octave1)\n         let tone2 = Tone(accidental: .sharp, noteLetter: .d, octave: .octave1)\n         \n         XCTAssertEqual(tone1, tone2)\n     }\n     \n+    // MARK: Failures\n+    \n     func testNotEqual() {\n         let tone1 = Tone(accidental: .flat, noteLetter: .b, octave: .octave5)\n         let tone2 = Tone(accidental: .flat, noteLetter: .b, octave: .octave4)\n         \n         XCTAssertNotEqual(tone1, tone2)\n     }\n+    \n+    // MARK: - Midi numbers\n+    // MARK: Successes\n+    \n+    func testRidiculouslyLowNote() {\n+        let tone = Tone(accidental: .natural, noteLetter: .c, octave: .octaveNegative1)\n+        \n+        XCTAssertEqual(tone.midiNoteNumber, 0)\n+    }\n+    \n+    func testLowNote() {\n+        let tone = Tone(accidental: .sharp, noteLetter: .f, octave: .octave1)\n+        \n+        XCTAssertEqual(tone.midiNoteNumber, 30)\n+    }\n+    \n+    func testMidRangeNote() {\n+        let tone = Tone(accidental: nil, noteLetter: .d, octave: .octave4)\n+        \n+        XCTAssertEqual(tone.midiNoteNumber, 62)\n+    }\n+    \n+    func testHighNote() {\n+        let tone = Tone(accidental: .flat, noteLetter: .c, octave: .octave8)\n+        \n+        XCTAssertEqual(tone.midiNoteNumber, 107)\n+    }\n+    \n+    // MARK: - Enharmonic\n+    // MARK: Successes\n+    \n+    func testSameToneIsEnharmonic() {\n+        let tone1 = Tone(accidental: .natural, noteLetter: .g, octave: .octave6)\n+        let tone2 = Tone(accidental: .natural, noteLetter: .g, octave: .octave6)\n+        \n+        XCTAssertEqual(tone1, tone2)\n+        XCTAssertTrue(tone1.isEnharmonic(with: tone2))\n+        // Transitive property\n+        XCTAssertTrue(tone2.isEnharmonic(with: tone1))\n+    }\n+    \n+    func testEnharmonicNotEquatable() {\n+        let tone1 = Tone(accidental: .flat, noteLetter: .a, octave: .octave3)\n+        let tone2 = Tone(accidental: .sharp, noteLetter: .g, octave: .octave3)\n+        \n+        XCTAssertNotEqual(tone1, tone2)\n+        XCTAssertTrue(tone1.isEnharmonic(with: tone2))\n+    }\n+    \n+    func testNaturalAndFlat() {\n+        let tone1 = Tone(accidental: .natural, noteLetter: .e, octave: .octave4)\n+        let tone2 = Tone(accidental: .flat, noteLetter: .f, octave: .octave4)\n+        \n+        XCTAssertNotEqual(tone1, tone2)\n+        XCTAssertTrue(tone1.isEnharmonic(with: tone2))\n+    }\n+    \n+    func testDoubleFlat() {\n+        let tone1 = Tone(accidental: .doubleFlat, noteLetter: .b, octave: .octave2)\n+        let tone2 = Tone(accidental: nil, noteLetter: .a, octave: .octave2)\n+        \n+        XCTAssertNotEqual(tone1, tone2)\n+        XCTAssertTrue(tone1.isEnharmonic(with: tone2))\n+    }\n+    \n+    func testDifferentOctaveNumbers() {\n+        let tone1 = Tone(accidental: .sharp, noteLetter: .b, octave: .octave6)\n+        let tone2 = Tone(accidental: .natural, noteLetter: .c, octave: .octave7)\n+        \n+        XCTAssertNotEqual(tone1, tone2)\n+        XCTAssertTrue(tone1.isEnharmonic(with: tone2))\n+    }\n+    \n+    // MARK: Failures","path":"MusicNotationKit/MusicNotationKitTests/ToneTests.swift","position":95,"original_position":95,"commit_id":"815814b97b2a0dac1e9ba7f952fa092adc7b1f4c","original_commit_id":"815814b97b2a0dac1e9ba7f952fa092adc7b1f4c","user":{"login":"drumnkyle","id":52436,"avatar_url":"https://avatars.githubusercontent.com/u/52436?v=3","gravatar_id":"","url":"https://api.github.com/users/drumnkyle","html_url":"https://github.com/drumnkyle","followers_url":"https://api.github.com/users/drumnkyle/followers","following_url":"https://api.github.com/users/drumnkyle/following{/other_user}","gists_url":"https://api.github.com/users/drumnkyle/gists{/gist_id}","starred_url":"https://api.github.com/users/drumnkyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drumnkyle/subscriptions","organizations_url":"https://api.github.com/users/drumnkyle/orgs","repos_url":"https://api.github.com/users/drumnkyle/repos","events_url":"https://api.github.com/users/drumnkyle/events{/privacy}","received_events_url":"https://api.github.com/users/drumnkyle/received_events","type":"User","site_admin":false},"body":"I think you are missing two totally different notes. And maybe two notes with different accidentals that would be enharmonic except their octaves are different. ","created_at":"2016-09-16T17:09:37Z","updated_at":"2016-09-16T17:10:30Z","html_url":"https://github.com/drumnkyle/music-notation-swift/pull/78#discussion_r79211315","pull_request_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/comments/79211315"},"html":{"href":"https://github.com/drumnkyle/music-notation-swift/pull/78#discussion_r79211315"},"pull_request":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/78","id":85604314,"html_url":"https://github.com/drumnkyle/music-notation-swift/pull/78","diff_url":"https://github.com/drumnkyle/music-notation-swift/pull/78.diff","patch_url":"https://github.com/drumnkyle/music-notation-swift/pull/78.patch","issue_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/issues/78","number":78,"state":"open","locked":false,"title":"Add Enharmonic protocol and comparison for Tone","user":{"login":"robtimp","id":6910829,"avatar_url":"https://avatars.githubusercontent.com/u/6910829?v=3","gravatar_id":"","url":"https://api.github.com/users/robtimp","html_url":"https://github.com/robtimp","followers_url":"https://api.github.com/users/robtimp/followers","following_url":"https://api.github.com/users/robtimp/following{/other_user}","gists_url":"https://api.github.com/users/robtimp/gists{/gist_id}","starred_url":"https://api.github.com/users/robtimp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robtimp/subscriptions","organizations_url":"https://api.github.com/users/robtimp/orgs","repos_url":"https://api.github.com/users/robtimp/repos","events_url":"https://api.github.com/users/robtimp/events{/privacy}","received_events_url":"https://api.github.com/users/robtimp/received_events","type":"User","site_admin":false},"body":"Resolves #77\r\n\r\n* Add an `Enharmonic` protocol to check if two notes have the same sound, even if spelled differently (e.g. E-flat and D-sharp).\r\n* Implement `Enharmonic` for Tone\r\n* Add Midi Note number (used to calculate if two tones are enharmonic)\r\n* Add tests for midi note number and Enharmonic\r\n* Enharmonic comparison should also be added for key signatures and chords","created_at":"2016-09-16T16:42:52Z","updated_at":"2016-09-16T17:10:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25cbdc95781798ba453b76725706e9dbea020795","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/78/commits","review_comments_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/78/comments","review_comment_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/issues/78/comments","statuses_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/statuses/815814b97b2a0dac1e9ba7f952fa092adc7b1f4c","head":{"label":"robtimp:enharmonic","ref":"enharmonic","sha":"815814b97b2a0dac1e9ba7f952fa092adc7b1f4c","user":{"login":"robtimp","id":6910829,"avatar_url":"https://avatars.githubusercontent.com/u/6910829?v=3","gravatar_id":"","url":"https://api.github.com/users/robtimp","html_url":"https://github.com/robtimp","followers_url":"https://api.github.com/users/robtimp/followers","following_url":"https://api.github.com/users/robtimp/following{/other_user}","gists_url":"https://api.github.com/users/robtimp/gists{/gist_id}","starred_url":"https://api.github.com/users/robtimp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robtimp/subscriptions","organizations_url":"https://api.github.com/users/robtimp/orgs","repos_url":"https://api.github.com/users/robtimp/repos","events_url":"https://api.github.com/users/robtimp/events{/privacy}","received_events_url":"https://api.github.com/users/robtimp/received_events","type":"User","site_admin":false},"repo":{"id":63102641,"name":"music-notation-swift","full_name":"robtimp/music-notation-swift","owner":{"login":"robtimp","id":6910829,"avatar_url":"https://avatars.githubusercontent.com/u/6910829?v=3","gravatar_id":"","url":"https://api.github.com/users/robtimp","html_url":"https://github.com/robtimp","followers_url":"https://api.github.com/users/robtimp/followers","following_url":"https://api.github.com/users/robtimp/following{/other_user}","gists_url":"https://api.github.com/users/robtimp/gists{/gist_id}","starred_url":"https://api.github.com/users/robtimp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robtimp/subscriptions","organizations_url":"https://api.github.com/users/robtimp/orgs","repos_url":"https://api.github.com/users/robtimp/repos","events_url":"https://api.github.com/users/robtimp/events{/privacy}","received_events_url":"https://api.github.com/users/robtimp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robtimp/music-notation-swift","description":"Music Notation Library in Swift","fork":true,"url":"https://api.github.com/repos/robtimp/music-notation-swift","forks_url":"https://api.github.com/repos/robtimp/music-notation-swift/forks","keys_url":"https://api.github.com/repos/robtimp/music-notation-swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robtimp/music-notation-swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robtimp/music-notation-swift/teams","hooks_url":"https://api.github.com/repos/robtimp/music-notation-swift/hooks","issue_events_url":"https://api.github.com/repos/robtimp/music-notation-swift/issues/events{/number}","events_url":"https://api.github.com/repos/robtimp/music-notation-swift/events","assignees_url":"https://api.github.com/repos/robtimp/music-notation-swift/assignees{/user}","branches_url":"https://api.github.com/repos/robtimp/music-notation-swift/branches{/branch}","tags_url":"https://api.github.com/repos/robtimp/music-notation-swift/tags","blobs_url":"https://api.github.com/repos/robtimp/music-notation-swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robtimp/music-notation-swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robtimp/music-notation-swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/robtimp/music-notation-swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robtimp/music-notation-swift/statuses/{sha}","languages_url":"https://api.github.com/repos/robtimp/music-notation-swift/languages","stargazers_url":"https://api.github.com/repos/robtimp/music-notation-swift/stargazers","contributors_url":"https://api.github.com/repos/robtimp/music-notation-swift/contributors","subscribers_url":"https://api.github.com/repos/robtimp/music-notation-swift/subscribers","subscription_url":"https://api.github.com/repos/robtimp/music-notation-swift/subscription","commits_url":"https://api.github.com/repos/robtimp/music-notation-swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/robtimp/music-notation-swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/robtimp/music-notation-swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/robtimp/music-notation-swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/robtimp/music-notation-swift/contents/{+path}","compare_url":"https://api.github.com/repos/robtimp/music-notation-swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robtimp/music-notation-swift/merges","archive_url":"https://api.github.com/repos/robtimp/music-notation-swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robtimp/music-notation-swift/downloads","issues_url":"https://api.github.com/repos/robtimp/music-notation-swift/issues{/number}","pulls_url":"https://api.github.com/repos/robtimp/music-notation-swift/pulls{/number}","milestones_url":"https://api.github.com/repos/robtimp/music-notation-swift/milestones{/number}","notifications_url":"https://api.github.com/repos/robtimp/music-notation-swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robtimp/music-notation-swift/labels{/name}","releases_url":"https://api.github.com/repos/robtimp/music-notation-swift/releases{/id}","deployments_url":"https://api.github.com/repos/robtimp/music-notation-swift/deployments","created_at":"2016-07-11T21:13:19Z","updated_at":"2016-07-11T21:13:20Z","pushed_at":"2016-09-16T16:39:52Z","git_url":"git://github.com/robtimp/music-notation-swift.git","ssh_url":"git@github.com:robtimp/music-notation-swift.git","clone_url":"https://github.com/robtimp/music-notation-swift.git","svn_url":"https://github.com/robtimp/music-notation-swift","homepage":null,"size":185,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"drumnkyle:master","ref":"master","sha":"14d1eda2e31ff336a6f0a8003463476f69d25df5","user":{"login":"drumnkyle","id":52436,"avatar_url":"https://avatars.githubusercontent.com/u/52436?v=3","gravatar_id":"","url":"https://api.github.com/users/drumnkyle","html_url":"https://github.com/drumnkyle","followers_url":"https://api.github.com/users/drumnkyle/followers","following_url":"https://api.github.com/users/drumnkyle/following{/other_user}","gists_url":"https://api.github.com/users/drumnkyle/gists{/gist_id}","starred_url":"https://api.github.com/users/drumnkyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drumnkyle/subscriptions","organizations_url":"https://api.github.com/users/drumnkyle/orgs","repos_url":"https://api.github.com/users/drumnkyle/repos","events_url":"https://api.github.com/users/drumnkyle/events{/privacy}","received_events_url":"https://api.github.com/users/drumnkyle/received_events","type":"User","site_admin":false},"repo":{"id":37359639,"name":"music-notation-swift","full_name":"drumnkyle/music-notation-swift","owner":{"login":"drumnkyle","id":52436,"avatar_url":"https://avatars.githubusercontent.com/u/52436?v=3","gravatar_id":"","url":"https://api.github.com/users/drumnkyle","html_url":"https://github.com/drumnkyle","followers_url":"https://api.github.com/users/drumnkyle/followers","following_url":"https://api.github.com/users/drumnkyle/following{/other_user}","gists_url":"https://api.github.com/users/drumnkyle/gists{/gist_id}","starred_url":"https://api.github.com/users/drumnkyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drumnkyle/subscriptions","organizations_url":"https://api.github.com/users/drumnkyle/orgs","repos_url":"https://api.github.com/users/drumnkyle/repos","events_url":"https://api.github.com/users/drumnkyle/events{/privacy}","received_events_url":"https://api.github.com/users/drumnkyle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drumnkyle/music-notation-swift","description":"Music Notation Library in Swift","fork":false,"url":"https://api.github.com/repos/drumnkyle/music-notation-swift","forks_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/forks","keys_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/teams","hooks_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/hooks","issue_events_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/issues/events{/number}","events_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/events","assignees_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/assignees{/user}","branches_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/branches{/branch}","tags_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/tags","blobs_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/statuses/{sha}","languages_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/languages","stargazers_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/stargazers","contributors_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/contributors","subscribers_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/subscribers","subscription_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/subscription","commits_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/contents/{+path}","compare_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/merges","archive_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/downloads","issues_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/issues{/number}","pulls_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls{/number}","milestones_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/milestones{/number}","notifications_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/labels{/name}","releases_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/releases{/id}","deployments_url":"https://api.github.com/repos/drumnkyle/music-notation-swift/deployments","created_at":"2015-06-13T05:44:54Z","updated_at":"2016-09-14T06:23:37Z","pushed_at":"2016-09-16T16:42:52Z","git_url":"git://github.com/drumnkyle/music-notation-swift.git","ssh_url":"git@github.com:drumnkyle/music-notation-swift.git","clone_url":"https://github.com/drumnkyle/music-notation-swift.git","svn_url":"https://github.com/drumnkyle/music-notation-swift","homepage":null,"size":302,"stargazers_count":15,"watchers_count":15,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":38,"forks":3,"open_issues":38,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/78"},"html":{"href":"https://github.com/drumnkyle/music-notation-swift/pull/78"},"issue":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/issues/78"},"comments":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/drumnkyle/music-notation-swift/statuses/815814b97b2a0dac1e9ba7f952fa092adc7b1f4c"}}}}
{"actor":{"display_login":"drumnkyle"}}