feat: note transcription convention

This commit is contained in:
2023-06-05 01:27:44 +04:00
parent 9aba6c1855
commit 07cb8f8003
2 changed files with 29 additions and 126 deletions

View File

@@ -7,7 +7,7 @@ open SoundGen.Oscillator
let private getHzBySemitones semi =
pitchStandard * (2. ** (1. / 12.)) ** semi
let private getSemitoneShift (rootNote : string) (targetNote : string) : int =
let getSemitoneShift (rootNote : string) (targetNote : string) : int =
// Define arrays to map pitch classes to numeric values and vice versa
let pitchClasses = [| "C"; "C#"; "D"; "D#"; "E"; "F"; "F#"; "G"; "G#"; "A"; "A#"; "B" |]
let pitchClassValues = [| 0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11 |]
@@ -25,6 +25,8 @@ let private getSemitoneShift (rootNote : string) (targetNote : string) : int =
let private freq hz duration (osc: OscillatorParameter list) =
let samples =
seq { 0.0 .. (duration * sampleRate) }