Architect beta for macOS, Windows, and Linux. 0.10.5 now available

Official support for: loomer.co.uk
KVRist
131 posts since 11 Mar, 2014

Post Wed Apr 28, 2021 9:48 am

I've attached 2 text files in a zip archive using intervals of scales I would like to use. The "modes.txt" file has the scale intervals with numbers corresponding to the second file "Mode Names.txt". Perhaps this list could be easily converted to your scale format? I would be happy with just that.

I would also like to see Scala (.scl) supported for import would be great for a future release.

Much appreciated!
You do not have the required permissions to view the files attached to this post.

KVRAF

Topic Starter

2263 posts since 25 Aug, 2003 from Bournemouth, UK

Post Thu Apr 29, 2021 1:10 am

mannymang wrote:
Wed Apr 28, 2021 9:48 am
I've attached 2 text files in a zip archive using intervals of scales I would like to use.
Thanks. These are easily parsable, so I'll cobble together a quick script later today that converts them to .scale files.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

KVRAF

Topic Starter

2263 posts since 25 Aug, 2003 from Bournemouth, UK

Post Thu Apr 29, 2021 3:50 am

Please find the converted scales attached to this post. If you unzip them and place all the .scale files in your Scales folder, you will find them available if you click on the + button in the Scale window and choose 'External'. I guess the easiest way to get to the Scales folder is by opening the preset browser, right-clicking on "User" and choosing "Show in Finder/Explorer". You should see the Scales folder in the same directory as the User presets folder.

I think some of these scales are slightly off though: it appears the document uses the same intervals for Lydian as for the Major scale. Lydian should have an augmented 4th, I think, although I'm no expert of these matters so I could well be wrong.

Anyway, here is the Lua script I used for the conversion.

Code: Select all

local function readlines(file)
  local t = {}
  local f = assert(io.open(file, 'r'))
  for line in f:lines() do
    t[#t + 1] = line
  end
  f:close()
  return t
end

local function writescale(name, intervals)
  name = name:match('%d+: ([^,]*),')
  intervals = intervals:match('%d+, ([^;]*);')

  io.write('found ', name, '/', intervals, '\n')

  local class = 1
  local degrees = {}
  for degree in intervals:gmatch("%d+") do
    degrees[class] = true
    class = class + tonumber(degree)
  end

  local outfilename = name:gsub('/', '-')
  local outfile = assert(io.open(outfilename .. '.scale', 'w'))
  outfile:write('<?xml version="1.0" encoding="UTF-8"?>\n')
  outfile:write('<Scale>\n')
  outfile:write('\t<Name>' .. name .. '</Name>\n')
  outfile:write('\t<Version>1</Version>\n')
  for i = 1, 12 do 
    if degrees[i] then
      outfile:write('\t<Degree>' .. tostring(i - 1) .. '</Degree>\n')
    end
  end
  outfile:write('</Scale>\n')

  outfile:close()
end

local intervals = readlines('modes.txt')
local names = readlines('Mode Names.txt')
assert(#intervals == #names)

for i = 1, #intervals do
  writescale(names[i], intervals[i])
end
You do not have the required permissions to view the files attached to this post.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

KVRist
131 posts since 11 Mar, 2014

Post Thu Apr 29, 2021 6:02 am

Wow Colin, this is great!

You are correct on the intervals for the Major and Lydian scales. I got this list years ago somewhere. I am no expert by any means. Thank you for pointing that out, will need to go through the list.

Thank you for taking the time to do this and for making the script. Such a great time saver!

Hope all is well with you Colin. :phones:

KVRAF

Topic Starter

2263 posts since 25 Aug, 2003 from Bournemouth, UK

Post Thu Apr 29, 2021 6:23 am

No problem at all. Thank you for the list: I've probably came across maybe a tenth of those scales before, so I can't wait to try out the rest.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

KVRist
131 posts since 11 Mar, 2014

Post Thu Apr 29, 2021 6:25 am

Here are zip files correcting my error between Major and Lydian. There are likely other errors. I offer no guarantees as to accuracy. :party: If I find any other errors, I'll update on this thread.

scales.zip has the text files for the lists.
parsed-scales.zip has the corrected Major and Lydian .scale files that Colin converted.

Thanks again Colin!
You do not have the required permissions to view the files attached to this post.

Return to “Loomer”