---
title: KeyResult
framework: musicunderstanding
role: symbol
role_heading: Structure
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+, watchOS 27.0+]
path: musicunderstanding/keyresult
---

# KeyResult

A value describing the musical key detected over a time range.

## Declaration

```swift
struct KeyResult
```

## Overview

Overview A key is the central note that organizes a piece of music. The tonic can be any of the supported enharmonic spellings: A, A♭, A♯, B♭, B, C, C♯, D♭, D, D♯, E♭, E, F, F♯, G, G♭, or G♯. The framework represents the enharmonic equivalents as distinct cases to preserve the original spelling.

## Topics

### Getting key result ranges

- [ranges](musicunderstanding/keyresult/ranges.md)

### Getting the mode of the musical key

- [mode](musicunderstanding/keyresult/keysignature/mode.md)

### Getting the notes of a key

- [KeyResult.KeySignature](musicunderstanding/keyresult/keysignature.md)
- [tonic](musicunderstanding/keyresult/keysignature/tonic.md)

### Enumerations

- [KeyResult.Mode](musicunderstanding/keyresult/mode.md)
- [KeyResult.Tonic](musicunderstanding/keyresult/tonic.md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Content results

- [MusicUnderstandingSession.SessionResult](musicunderstanding/musicunderstandingsession/sessionresult.md)
- [RhythmResult](musicunderstanding/rhythmresult.md)
- [LoudnessResult](musicunderstanding/loudnessresult.md)
- [PaceResult](musicunderstanding/paceresult.md)
- [StructureResult](musicunderstanding/structureresult.md)
- [InstrumentActivityResult](musicunderstanding/instrumentactivityresult.md)
