rubySC 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c715abbf1240f534cab6767762f9e89c2b9d50e
4
- data.tar.gz: 176efdd566e7bb588b0ad853ce1524c7cc133489
3
+ metadata.gz: 192ed2fc0c38281ca89da8d6e75d16fba4b447a3
4
+ data.tar.gz: 670103c666d4b8ddeb84f38e5ad24f2d94e35cbd
5
5
  SHA512:
6
- metadata.gz: 0c49e497d1af6da7de5669e2b3c0272a856c066070722cc97e098c28041b84752cd3ab3a205a06708db2b09222d151cd40bbe8a3780b601bda634107974891be
7
- data.tar.gz: 8fe82bb7e78e2b616255b9ede8e0ff4c88119263dfa78c875dd96d7510b2503407074ea7e5accfd6bfcb18f91d36985c99b72e89ced0eec4330a0537d8f8cf08
6
+ metadata.gz: f10a28132c701d40ca72d10d8cfe1f3030439b1dcd5d6359d75212360a010627ec5429d2b2a862dc3dc710aa8f678e511b47d96f226e5de3dbf66758e41767fb
7
+ data.tar.gz: 27a40182ef4c1209ae178069727f693a7528fee78aff20a68c348d094da5d6eba21ced4450df777f91316012ed85b7dae8196476d4a5f815f6227c6bf17cab60
data/README.md CHANGED
@@ -1,36 +1,3 @@
1
- <<<<<<< HEAD
2
- # RubySC
3
-
4
- TODO: Write a gem description
5
-
6
- ## Installation
7
-
8
- Add this line to your application's Gemfile:
9
-
10
- gem 'rubySC'
11
-
12
- And then execute:
13
-
14
- $ bundle
15
-
16
- Or install it yourself as:
17
-
18
- $ gem install rubySC
19
-
20
- ## Usage
21
-
22
- TODO: Write usage instructions here
23
-
24
- ## Contributing
25
-
26
- 1. Fork it ( http://github.com/<my-github-username>/rubySC/fork )
27
- 2. Create your feature branch (`git checkout -b my-new-feature`)
28
- 3. Commit your changes (`git commit -am 'Add some feature'`)
29
- 4. Push to the branch (`git push origin my-new-feature`)
30
- 5. Create new Pull Request
31
- =======
32
- # rubySC
33
-
34
1
  rubySC est une petite biliothèque qui complète à sa manière
35
2
  [SCruby](https://github.com/maca/scruby) en offrant une interface avec
36
3
  la bibliothèque JTLib de SuperCollider, cette dernière étant tournée
data/lib/rubySC.rb CHANGED
@@ -123,24 +123,15 @@ class SC
123
123
 
124
124
  SC.updateScore
125
125
 
126
- args.each do |arg|
127
- if arg.is_a? Voix
128
- @@listeVoix[arg.name]=arg
129
- self.updateScore
130
- self.send "Pdef(\\#{arg.name}).play"
131
- else
132
- if arg==nil then
133
- tmpargs=@@listeVoix.keys
134
- tmpargs.each do |voix|
135
- self.send "Pdef(\\#{voix.to_s}).play"
136
- end
137
- else
138
- self.send "Pdef(\\#{arg.to_s}).play"
126
+ if args[0]==nil then
127
+ args=@@listeVoix.keys
128
+ args.each do |voix|
129
+ self.send "Pdef(\\#{voix.to_s}).play"
139
130
  end
140
131
  end
141
- end
142
132
  end
143
133
 
134
+
144
135
  def self.stop *args
145
136
  if args[0]==nil then
146
137
  args=@@listeVoix.keys
@@ -22,10 +22,12 @@ end
22
22
 
23
23
  end
24
24
 
25
- def organum voix
25
+ def organum voix, typeHarmonisation=[-2,0,2,4]
26
26
 
27
27
  a= Voix.new "harmonisationDe"+voix.name
28
28
 
29
- a.degree= harmoniser voix.degree, [2]
29
+ a.degree= harmoniser voix.degree, typeHarmonisation
30
+ a.setDuree voix.dur
30
31
 
32
+ SC.updateScore
31
33
  end
@@ -1,7 +1,7 @@
1
- def creerMelodie nbNote=rand(4..12)
1
+ def creerMelodie nbNote=rand(10..30)
2
2
 
3
3
  Array.new (nbNote) do |note|
4
- note=[0,0,1,2,3,3,4,4,5,6].sample
4
+ note=[0,0,1,1,2,3,3,3,3,4,4,4,4,5,6].sample #manière un peu bourrine de "pondérer" les notes possibles
5
5
  end
6
6
  end
7
7
 
@@ -24,8 +24,8 @@ end
24
24
  def creerRythme melodie #analyse
25
25
 
26
26
  rythme = intervallesMel melodie
27
- rythme.map { |inter|
28
- if inter.abs>1
27
+ rythme.map! { |inter|
28
+ if inter.abs > 1
29
29
  note= 2
30
30
  else
31
31
  note=1
@@ -1,3 +1,3 @@
1
1
  module RubySC
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
data/lib/rubySC/voix.rb CHANGED
@@ -25,10 +25,10 @@ class Voix
25
25
 
26
26
  self.setDuree options["dur"]
27
27
 
28
- if options["degree"].nil?
28
+ if options[:degree].nil?
29
29
  then @degree=Array.new(rand(1..5)) do |x| x=rand(12) end
30
30
  else
31
- @degree=options["degree"]
31
+ @degree=options[:degree]
32
32
  end
33
33
 
34
34
  if options["octave"].nil?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubySC
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - simdax