Module: Marche

Defined in:
lib/rubySC/musique.rb

Overview

module pour gérer des marches.

Class Method Summary collapse

Class Method Details

.marcheChromatique(intervalles, voix) ⇒ Object



101
102
103
104
105
106
107
# File 'lib/rubySC/musique.rb', line 101

def self.marcheChromatique  intervalles, voix

  nbFois=SC.listeVoix[voix.name].degree.length
  voix.setRoot ({"root" => "Pstutter(#{nbFois}, Pseq(#{intervalles}, inf))"})
  SC.updateScore

end

.marcheDiatonique(voix, intervalle) ⇒ Object



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/rubySC/musique.rb', line 109

def self.marcheDiatonique voix, intervalle

  melodie=SC.listeVoix[voix].degree

  tmp= Array.new(intervalle.size) do |x|
    t=melodie.map { |note|
      if note.is_a? Array then
        note.map do |y| y+intervalle[x] end
      else
        note+intervalle[x]*x
      end }
    "Pseq(#{t})"
  end

  SC.updater voix, "degree", "[#{tmp.join(',')}]"
  SC.listeVoix[voix].information="en marche ! ..."

end