harmonics
tones_to_harmonic_segment(tones, sub=False)
Converts a series of tones to a harmonic or sub-harmonic segment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tones |
List[JustInterval]
|
A series of tones. |
required |
sub |
bool
|
When True, returns a sub-harmonic segment. Else, a harmonic (overtone) segment. |
False
|
Returns:
Type | Description |
---|---|
List[int]
|
The harmonic, or sub-harmonic, segment |
Examples:
>>> from .intervals import JustInterval
>>> tones = []
>>> tones.append(JustInterval(16, 15))
>>> tones.append(JustInterval(4, 3))
>>> tones.append(JustInterval(8, 5))
>>> tones_to_harmonic_segment(tones)
[4, 5, 6]
>>> tones = []
>>> tones.append(JustInterval(9, 5))
>>> tones.append(JustInterval(9, 8))
>>> tones.append(JustInterval(27, 20))
>>> tones.append(JustInterval(63, 40))
>>> tones_to_harmonic_segment(tones)
[4, 5, 6, 7]
Source code in /opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/jintonic/harmonics.py
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 |
|
harmonic_to_identity(harmonic)
Converts a harmonic number to its tone identity.
Paramters
harmonic: A harmonic number
Returns:
Type | Description |
---|---|
int
|
The harmonic's tone identity |
Examples:
>>> harmonic_to_identity(6)
3
Source code in /opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/jintonic/harmonics.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
harmonic_segment_to_identities(segment)
Converts a harmonic or sub-harmonic segment to its tone identities.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
segment |
List[int]
|
A harmonic, or sub-harmonic, segment |
required |
Returns:
Type | Description |
---|---|
List[int]
|
The tone identities of each harmonic in a segment |
Examples:
>>> harmonic_segment_to_identities([4, 5, 6])
[1, 5, 3]
>>> harmonic_segment_to_identities([10, 12, 15])
[5, 3, 15]
>>> harmonic_segment_to_identities([4, 5, 6, 7, 9])
[1, 5, 3, 7, 9]
Source code in /opt/hostedtoolcache/Python/3.11.3/x64/lib/python3.11/site-packages/jintonic/harmonics.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|