From afc721e7ed29180a8a50678f30c807d7f3f442ab Mon Sep 17 00:00:00 2001 From: chmaha <120390802+chmaha@users.noreply.github.com> Date: Wed, 20 Aug 2025 22:02:51 -0400 Subject: [PATCH] Add pitch option to dialog --- share/scripts/scl_to_mts.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/scripts/scl_to_mts.lua b/share/scripts/scl_to_mts.lua index a64daa37cf..90106b94d0 100644 --- a/share/scripts/scl_to_mts.lua +++ b/share/scripts/scl_to_mts.lua @@ -2,8 +2,8 @@ ardour { ["type"] = "EditorAction", name = "Scala to MIDI Tuning", license = "MIT", - author = "Ardour Team", - description = [[Read scala (.scl) tuning from a file, generate MIDI tuning standard (MTS) messages and send them to a MIDI port]] + author = "Ardour Team / chmaha", + description = [[Set pitch, Read scala (.scl) tuning from a file, generate MIDI tuning standard (MTS) messages and send them to a MIDI port]] } function factory () return function () @@ -69,6 +69,8 @@ function factory () return function () end local dialog_options = { + { type = "number", key = "tuning", title = "Tuning A4 (Hz)", min= 220.0, max = 880.0, default = 440.0, digits = 1, step = 0.1 }, + { type = "number", key = "ref_note", title = "MIDI note to tune", min = 0, max = 127, step = 1, digits = 0, default = 69 }, { type = "file", key = "file", title = "Select .scl file" }, { type = "checkbox", key = "bulk", default = false, title = "Bulk Transfer (not realtime)" }, { type = "dropdown", key = "tx", title = "MIDI SysEx Target", values = midi_targets () } @@ -137,8 +139,8 @@ function factory () return function () ----------------------------------------------------------------------------- -- TODO consider reading a .kbm file or make these configurable in the dialog -- http://www.huygens-fokker.org/scala/help.htm#mappings - local ref_note = 69 -- Reference note for which frequency is given - local ref_freq = 440.0 -- Frequency to tune the above note to + local ref_note = rv['ref_note'] -- Reference note for which frequency is given, usually 69 (A4) + local ref_freq = rv['tuning'] -- Frequency to tune the above note to local ref_root = 60 -- root-note of the scale, note where the first entry of the scale is mapped to local note_start = 0 local note_end = 127