https://github.com/shingt/harmonykit
Tool to generate harmony in audio frequencies in Swift.
https://github.com/shingt/harmonykit
audio harmony ios swift tuning
Last synced: about 1 year ago
JSON representation
Tool to generate harmony in audio frequencies in Swift.
- Host: GitHub
- URL: https://github.com/shingt/harmonykit
- Owner: shingt
- License: mit
- Created: 2015-05-22T00:54:44.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2021-06-27T22:42:31.000Z (about 5 years ago)
- Last Synced: 2025-04-19T10:38:22.804Z (about 1 year ago)
- Topics: audio, harmony, ios, swift, tuning
- Language: Swift
- Homepage:
- Size: 121 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HarmonyKit
[](https://travis-ci.org/shingt/HarmonyKit)


Tool to generate audio frequencies.
## Synopsis
```swift
let notes = HarmonyKit.tune(
configuration: .init(
temperament: .equal,
pitch: 442,
transpositionTone: .C,
octaveRange: 1..<2
)
)
notes.forEach { print($0) }
// =>
// tone: E, octave: 1, frequency: 41.390736
// tone: F, octave: 1, frequency: 43.851955
// tone: B♭, octave: 1, frequency: 58.53534
// tone: G♭, octave: 1, frequency: 46.459526
// tone: A♭, octave: 1, frequency: 52.149055
// tone: E♭, octave: 1, frequency: 39.06765
// tone: C, octave: 1, frequency: 32.851845
// tone: B, octave: 1, frequency: 62.016026
// tone: D, octave: 1, frequency: 36.87495
// tone: G, octave: 1, frequency: 49.222153
// tone: A, octave: 1, frequency: 55.25
// tone: D♭, octave: 1, frequency: 34.80532
```
You can also specify pure temperament:
```swift
let pureMajorNotes = HarmonyKit.tune(
configuration: .init(
temperament: .pure(.major, rootTone: .C),
pitch: 442,
transpositionTone: .C,
octaveRange: 1..<2
)
)
let pureMinorNotes = HarmonyKit.tune(
configuration: .init(
temperament: .pure(.minor, rootTone: .C),
pitch: 442,
transpositionTone: .C,
octaveRange: 1..<2
)
)
```
## Installation
HarmonyKit is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
```ruby
pod "HarmonyKit"
```
## Example
See `Tests/HarmonyKitTests/HarmonyKitTests.swift`.
### Author
shingt
## License
HarmonyKit is available under the MIT license. See the LICENSE file for more info.