Skip to content

proposed ring chain: .invert(n) #2089

Open
@datramt

Description

@datramt

Hi!

There have been a handful of times in which I desired a ring chain that inverts the ring over a specified pitch axis. This would mainly work for rings that are intended as collections of pitches. Would there be interest in adding a feature like this? I have a prototype below, that I'm positive could be more thoughtfully implemented, but for what I typically need, it works well:

class SonicPi::Core::RingVector
  
  def invert(n)
    self.map {|e| n-e + self.min}
  end
  
end

puts (scale :c, :major).invert(60)

this will return: (ring 60, 58, 56, 55, 53, 51, 49, 48)

At any rate, thanks so much for this fantastic environment. Much <3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions