-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchords.cpp
88 lines (70 loc) · 1.95 KB
/
chords.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
Copyright (c) 2014 Auston Sterling
See LICENSE for copying permissions.
-----Chords Listing-----
Auston Sterling
Contains functions to be able to easily use or reference common chords.
*/
#ifndef _chords_cpp_
#define _chords_cpp_
#include "chords.hpp"
namespace midi
{
//Returns the major triadic chord with the given root
Chord majTriad(const Note root)
{
return Chord(root, root+4, root+7);
}
//Returns the minor triadic chord with the given root
Chord minTriad(const Note root)
{
return Chord(root, root+3, root+7);
}
//Returns the diminished triadic chord with the given root
Chord dimTriad(const Note root)
{
return Chord(root, root+3, root+6);
}
//Returns the augmented triadic chord with the given root
Chord augTriad(const Note root)
{
return Chord(root, root+4, root+8);
}
//Returns the major seventh chord with the given root
Chord majSeventh(const Note root)
{
return Chord(root, root+4, root+7, root+11);
}
//Returns the minor seventh chord with the given root
Chord minSeventh(const Note root)
{
return Chord(root, root+3, root+7, root+10);
}
//Returns the dominant seventh chord with the given root
Chord domSeventh(const Note root)
{
return Chord(root, root+4, root+7, root+10);
}
//Returns the diminished seventh chord with the given root
Chord dimSeventh(const Note root)
{
return Chord(root, root+3, root+6, root+9);
}
//Returns the half-diminished seventh chord with the given root
Chord halfDimSeventh(const Note root)
{
return Chord(root, root+3, root+6, root+10);
}
//Returns the minor major seventh chord with the given root
Chord minMajSeventh(const Note root)
{
return Chord(root, root+3, root+7, root+11);
}
//Returns the augmented major seventh chord with the given root
Chord augMajSeventh(const Note root)
{
return Chord(root, root+4, root+8, root+11);
}
} //Namespace
#endif