diff --git a/src/components/ScaleBuilder.vue b/src/components/ScaleBuilder.vue index a6e0f49b..4527e608 100644 --- a/src/components/ScaleBuilder.vue +++ b/src/components/ScaleBuilder.vue @@ -129,6 +129,7 @@ function doExport(exporter: ExporterKey) { scale: props.scale, filename: sanitizeFilename(props.scaleName), baseMidiNote: props.baseMidiNote, + midiOctaveOffset: props.midiOctaveOffset, description: props.scaleName, lines: props.scaleLines, appTitle: APP_TITLE, diff --git a/src/exporters/__tests__/test-data.ts b/src/exporters/__tests__/test-data.ts index 97769500..00d059cc 100644 --- a/src/exporters/__tests__/test-data.ts +++ b/src/exporters/__tests__/test-data.ts @@ -31,6 +31,7 @@ export function getTestData(appTitle: string) { appTitle, description: "A scale for testing if the exporter works", baseMidiNote: 69, + midiOctaveOffset: 0, lines: [ "100.", "4\\5", diff --git a/src/exporters/base.ts b/src/exporters/base.ts index 2ec30ace..9f29d37f 100644 --- a/src/exporters/base.ts +++ b/src/exporters/base.ts @@ -5,6 +5,7 @@ export type ExporterParams = { scale: Scale; filename: string; baseMidiNote: number; + midiOctaveOffset: number; name?: string; scaleUrl?: string; description?: string; diff --git a/src/exporters/deflemask.ts b/src/exporters/deflemask.ts index cf0028b6..de4db956 100644 --- a/src/exporters/deflemask.ts +++ b/src/exporters/deflemask.ts @@ -46,7 +46,7 @@ export default class DeflemaskExporter extends BaseExporter { continue; // convert note number to note name - let name = midiNoteNumberToName(noteNumber); + let name = midiNoteNumberToName(noteNumber, this.params.midiOctaveOffset); name = name.length == 2 ? name.slice(0, 1) + "-" + name.slice(1) : name; // convert cents offset to hex where -100c=00, 0c=80, 100c=FF diff --git a/src/exporters/kontakt.ts b/src/exporters/kontakt.ts index fe18f7d1..15fc8d17 100644 --- a/src/exporters/kontakt.ts +++ b/src/exporters/kontakt.ts @@ -30,7 +30,7 @@ export default class KontaktExporter extends BaseExporter { "MIDI note " + baseMidiNote.toString() + " (" + - midiNoteNumberToName(baseMidiNote) + + midiNoteNumberToName(baseMidiNote, this.params.midiOctaveOffset) + ") = " + this.params.scale.baseFrequency.toString() + " Hz" +