Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions chord.lua
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,20 @@ function ChordBuilder:clone()
return b
end

-- extensions is a table of 4 elements, false or true
-- the first element is the seventh,
-- the second is the ninth,
-- the third is the eleventh,
-- the fourth is the thirteenth
function ChordBuilder:extend(extensions)
local b = self:clone()
b.seventh = extensions[1]
b.ninth = extensions[2]
b.eleventh = extensions[3]
b.thirteenth = extensions[4]
return b
end

function ChordBuilder:withSeventh()
local b = self:clone()
b.seventh = true
Expand Down
16 changes: 16 additions & 0 deletions scale.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ function Scale:to_the_right_on_circle_of_5ths(iterations)
:to_the_right_on_circle_of_5ths(iterations -1)
end

--[[
Warning: only works for ionian scales
]]
function Scale:circle_of_5ths_rotate(iterations)
if(iterations == 0) then
return self
elseif(iterations < 0) then
return self:to_the_left_on_circle_of_5ths(-iterations)
elseif(iterations > 0) then
return self:to_the_right_on_circle_of_5ths(iterations)
else
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: this else will never be reached :)

return "Error"
end
end


--[[
Returns a new scale based on self, rotated from note_offset
note_offset:
Expand Down
Loading