Skip to content
Browse files

gem version bump

  • Loading branch information...
1 parent 74a8e8e commit 9ce6e4fa3959ffa69e3004c1cb60b8bcfd792cb0 @maca committed
Showing with 39 additions and 388 deletions.
  1. +6 −0 Manifest.txt
  2. +2 −2 Rakefile
  3. +1 −1 lib/scruby.rb
  4. +1 −2 lib/scruby/ugens/buffer_read_write.rb
  5. +0 −167 lib/scruby/ugens/pan.rb
  6. +4 −4 scruby.gemspec
  7. +0 −204 spec/pan_spec.rb
  8. +25 −8 test.live.rb
View
6 Manifest.txt
@@ -33,19 +33,24 @@ lib/scruby/node.rb
lib/scruby/server.rb
lib/scruby/synth.rb
lib/scruby/synthdef.rb
+lib/scruby/ticker.rb
+lib/scruby/ugens/buffer_read_write.rb
lib/scruby/ugens/env_gen.rb
lib/scruby/ugens/in_out.rb
lib/scruby/ugens/multi_out_ugens.rb
lib/scruby/ugens/operation_indices.yaml
lib/scruby/ugens/operation_ugens.rb
+lib/scruby/ugens/panner.rb
lib/scruby/ugens/ugen.rb
lib/scruby/ugens/ugen_defs.yaml
lib/scruby/ugens/ugen_operations.rb
lib/scruby/ugens/ugens.rb
+notas.markdown
script/console
script/destroy
script/generate
scruby.gemspec
+spec/buffer_read_write_spec.rb
spec/buffer_spec.rb
spec/bus_spec.rb
spec/core_ext/core_ext_spec.rb
@@ -60,6 +65,7 @@ spec/integration_spec.rb
spec/multiout_ugen_spec.rb
spec/node_spec.rb
spec/operation_ugens_spec.rb
+spec/panner_spec.rb
spec/server.rb
spec/server_spec.rb
spec/synth_spec.rb
View
4 Rakefile
@@ -12,12 +12,12 @@ Hoe.plugin :newgem
# Run 'rake -T' to see list of generated tasks (from gem root directory)
$hoe = Hoe.spec 'scruby' do
self.developer 'Macario Ortega', 'macarui@gmail.com'
+ self.summary = %q{SuperCollider client for Ruby}
self.rubyforge_name = self.name
self.extra_deps = [
['maca-arguments','>= 0.6'],
['maca-rosc', '>= 0.0.1']
]
-
end
require 'newgem/tasks'
@@ -25,4 +25,4 @@ Dir['tasks/**/*.rake'].each { |t| load t }
# TODO - want other tests/tasks run by default? Add them to the list
# remove_task :default
-# task :default => [:spec, :features]
+task :default => [:spec]
View
2 lib/scruby.rb
@@ -25,7 +25,7 @@
$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
module Scruby
- VERSION = '0.2.5'
+ VERSION = '0.2.6'
end
require "scruby/core_ext/object"
View
3 lib/scruby/ugens/buffer_read_write.rb
@@ -88,8 +88,7 @@ def ar input, bufnum = 0
class Tap < Ugen
class << self
def ar bufnum = 0, num_channels = 1, delay_time = 0.2
- n = SampleRate.ir.neg * 3
- PlayBuf.ar num_channels, bufnum, 1, 0, n, 1
+ PlayBuf.ar num_channels, bufnum, 1, 0, SampleRate.ir.neg * 3, 1
end
named_args_for :ar
end
View
167 lib/scruby/ugens/pan.rb
@@ -1,167 +0,0 @@
-module Scruby
- module Ugens
-
- class Panner < MultiOutUgen
- def initialize rate, inputs, channels
- super rate, *(0...channels).map{ |i| OutputProxy.new(rate, self, i) }
- @inputs = inputs
- inputs.each do |i|
- raise ArgumentError.new("input #{ i } has not audio rate.") unless i.rate == :audio if Ugen === i
- end if rate == :audio
- end
- end
-
- class Pan2 < Panner
- def initialize rate, *inputs
- super rate, inputs, 2
- end
-
- class << self
- def ar input, pos = 0.0, level = 1.0
- new :audio, input, pos, level
- end
-
- def kr input, pos = 0.0, level = 1.0
- new :control, input, pos, level
- end
- named_args_for :ar, :kr
- end
- end
-
- class LinPan2 < Pan2; end
-
- class Pan4 < Panner
- def initialize rate, *inputs
- super rate, inputs, 4
- end
-
- class << self
- def ar input, xpos = 0.0, ypos = 0.0, level = 1.0
- new :audio, input, xpos, ypos, level
- end
-
- def kr input, xpos = 0.0, ypos = 0.0, level = 1.0
- new :control, input, xpos, ypos, level
- end
-
- named_args_for :ar, :kr
- end
- end
-
- class Balance2 < Panner
- def initialize rate, *inputs
- super rate, inputs, 2
- end
-
- class << self
- def ar left, right, pos = 0.0, level = 1.0
- new :audio, left, right, pos, level
- end
-
- def kr left, right, pos = 0.0, level = 1.0
- new :control, left, right, pos, level
- end
- named_args_for :ar, :kr
- end
- end
-
- class Rotate2 < Panner
- def initialize rate, *inputs
- super rate, inputs, 2
- end
-
- class << self
- def ar x, y, pos = 0.0
- new :audio, x, y, pos
- end
-
- def kr x, y, pos = 0.0
- new :control, x, y, pos
- end
- end
- end
-
- class PanB < Panner
- def initialize rate, *inputs
- super rate, inputs, 4
- end
-
- class << self
- def ar input, azimuth = 0, elevation = 0, gain = 1
- new :audio, input, azimuth, elevation, gain
- end
-
- def kr input, azimuth = 0, elevation = 0, gain = 1
- new :control, input, azimuth, elevation, gain
- end
- named_args_for :ar, :kr
- end
- end
-
- class PanB2 < Panner
- def initialize rate, *inputs
- super rate, inputs, 3
- end
-
- class << self
- def ar input, azimuth = 0, gain = 1
- new :audio, input, azimuth, gain
- end
-
- def kr input, azimuth = 0, gain = 1
- new :control, input, azimuth, gain
- end
- named_args_for :ar, :kr
- end
- end
-
- class BiPanB2 < Panner
- def initialize rate, *inputs
- super rate, inputs, 3
- end
-
- class << self
- def ar a, b, azimuth, gain = 1
- new :audio, a, b, azimuth, gain
- end
-
- def kr a, b, azimuth, gain = 1
- new :control, a, b, azimuth, gain
- end
- end
- end
-
- class DecodeB2 < Panner
- def initialize rate, num_channels, *inputs
- super rate, inputs, num_channels
- end
-
- class << self
- def ar num_channels, w, x, y, orientation = 0.5
- new :audio, num_channels, w, x, y, orientation
- end
-
- def kr num_channels, w, x, y, orientation = 0.5
- new :control, num_channels, w, x, y, orientation
- end
- end
- end
-
- class PanAz < Panner
- def initialize rate, num_channels, *inputs
- super rate, inputs, num_channels
- end
-
- class << self
- def ar num_channels, input, pos = 0.0, level = 1.0, width = 2.0, orientation = 0.5
- new :audio, num_channels, input, pos, level, width, orientation
- end
-
- def kr num_channels, input, pos = 0.0, level = 1.0, width = 2.0, orientation = 0.5
- new :control, num_channels, input, pos, level, width, orientation
- end
- end
- end
-
- end
-end
View
8 scruby.gemspec
@@ -2,24 +2,24 @@
Gem::Specification.new do |s|
s.name = %q{scruby}
- s.version = "0.2.2"
+ s.version = "0.2.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Macario Ortega"]
- s.date = %q{2009-08-07}
+ s.date = %q{2009-08-18}
s.default_executable = %q{livecode.rb}
s.description = %q{}
s.email = ["macarui@gmail.com"]
s.executables = ["livecode.rb"]
s.extra_rdoc_files = ["History.txt", "Manifest.txt"]
- s.files = ["History.txt", "Manifest.txt", "README.rdoc", "Rakefile", "TODO.markdown", "bin/livecode.rb", "examples/example.live.rb", "extras/Ruby Live.tmbundle/Commands/Run selection:line in session.tmCommand", "extras/Ruby Live.tmbundle/Commands/Run selection:scope in session.tmCommand", "extras/Ruby Live.tmbundle/Commands/Run update blocks in session.tmCommand", "extras/Ruby Live.tmbundle/Commands/Start Session.tmCommand", "extras/Ruby Live.tmbundle/Commands/Stop server.tmCommand", "extras/Ruby Live.tmbundle/Support/lib/live_session.rb", "extras/Ruby Live.tmbundle/Syntaxes/Ruby Live.tmLanguage", "extras/Ruby Live.tmbundle/info.plist", "lib/live/session.rb", "lib/scruby.rb", "lib/scruby/buffer.rb", "lib/scruby/bus.rb", "lib/scruby/control_name.rb", "lib/scruby/core_ext/array.rb", "lib/scruby/core_ext/delegator_array.rb", "lib/scruby/core_ext/fixnum.rb", "lib/scruby/core_ext/numeric.rb", "lib/scruby/core_ext/object.rb", "lib/scruby/core_ext/proc.rb", "lib/scruby/core_ext/string.rb", "lib/scruby/core_ext/symbol.rb", "lib/scruby/core_ext/typed_array.rb", "lib/scruby/env.rb", "lib/scruby/group.rb", "lib/scruby/node.rb", "lib/scruby/server.rb", "lib/scruby/synth.rb", "lib/scruby/synthdef.rb", "lib/scruby/ugens/env_gen.rb", "lib/scruby/ugens/in_out.rb", "lib/scruby/ugens/multi_out_ugens.rb", "lib/scruby/ugens/operation_indices.yaml", "lib/scruby/ugens/operation_ugens.rb", "lib/scruby/ugens/ugen.rb", "lib/scruby/ugens/ugen_defs.yaml", "lib/scruby/ugens/ugen_operations.rb", "lib/scruby/ugens/ugens.rb", "script/console", "script/destroy", "script/generate", "scruby.gemspec", "spec/buffer_spec.rb", "spec/bus_spec.rb", "spec/core_ext/core_ext_spec.rb", "spec/core_ext/delegator_array_spec.rb", "spec/core_ext/typed_array_spec.rb", "spec/env_gen_spec.rb", "spec/env_spec.rb", "spec/group_spec.rb", "spec/helper.rb", "spec/in_out_spec.rb", "spec/integration_spec.rb", "spec/multiout_ugen_spec.rb", "spec/node_spec.rb", "spec/operation_ugens_spec.rb", "spec/server.rb", "spec/server_spec.rb", "spec/synth_spec.rb", "spec/synthdef_spec.rb", "spec/ugen_operations_spec.rb", "spec/ugen_spec.rb", "spec/ugens_spec.rb", "test.live.rb"]
+ s.files = ["History.txt", "Manifest.txt", "README.rdoc", "Rakefile", "TODO.markdown", "bin/livecode.rb", "examples/example.live.rb", "extras/Ruby Live.tmbundle/Commands/Run selection:line in session.tmCommand", "extras/Ruby Live.tmbundle/Commands/Run selection:scope in session.tmCommand", "extras/Ruby Live.tmbundle/Commands/Run update blocks in session.tmCommand", "extras/Ruby Live.tmbundle/Commands/Start Session.tmCommand", "extras/Ruby Live.tmbundle/Commands/Stop server.tmCommand", "extras/Ruby Live.tmbundle/Support/lib/live_session.rb", "extras/Ruby Live.tmbundle/Syntaxes/Ruby Live.tmLanguage", "extras/Ruby Live.tmbundle/info.plist", "lib/live/session.rb", "lib/scruby.rb", "lib/scruby/buffer.rb", "lib/scruby/bus.rb", "lib/scruby/control_name.rb", "lib/scruby/core_ext/array.rb", "lib/scruby/core_ext/delegator_array.rb", "lib/scruby/core_ext/fixnum.rb", "lib/scruby/core_ext/numeric.rb", "lib/scruby/core_ext/object.rb", "lib/scruby/core_ext/proc.rb", "lib/scruby/core_ext/string.rb", "lib/scruby/core_ext/symbol.rb", "lib/scruby/core_ext/typed_array.rb", "lib/scruby/env.rb", "lib/scruby/group.rb", "lib/scruby/node.rb", "lib/scruby/server.rb", "lib/scruby/synth.rb", "lib/scruby/synthdef.rb", "lib/scruby/ticker.rb", "lib/scruby/ugens/buffer_read_write.rb", "lib/scruby/ugens/env_gen.rb", "lib/scruby/ugens/in_out.rb", "lib/scruby/ugens/multi_out_ugens.rb", "lib/scruby/ugens/operation_indices.yaml", "lib/scruby/ugens/operation_ugens.rb", "lib/scruby/ugens/panner.rb", "lib/scruby/ugens/ugen.rb", "lib/scruby/ugens/ugen_defs.yaml", "lib/scruby/ugens/ugen_operations.rb", "lib/scruby/ugens/ugens.rb", "notas.markdown", "script/console", "script/destroy", "script/generate", "scruby.gemspec", "spec/buffer_read_write_spec.rb", "spec/buffer_spec.rb", "spec/bus_spec.rb", "spec/core_ext/core_ext_spec.rb", "spec/core_ext/delegator_array_spec.rb", "spec/core_ext/typed_array_spec.rb", "spec/env_gen_spec.rb", "spec/env_spec.rb", "spec/group_spec.rb", "spec/helper.rb", "spec/in_out_spec.rb", "spec/integration_spec.rb", "spec/multiout_ugen_spec.rb", "spec/node_spec.rb", "spec/operation_ugens_spec.rb", "spec/panner_spec.rb", "spec/server.rb", "spec/server_spec.rb", "spec/synth_spec.rb", "spec/synthdef_spec.rb", "spec/ugen_operations_spec.rb", "spec/ugen_spec.rb", "spec/ugens_spec.rb", "test.live.rb"]
s.has_rdoc = true
s.homepage = %q{Is a bare-bones SuperCollider livecoding library for Ruby, it provides comunication with a remote or local scsynth server and SynthDef creation with a}
s.rdoc_options = ["--main", "README.rdoc"]
s.require_paths = ["lib"]
s.rubyforge_project = %q{scruby}
s.rubygems_version = %q{1.3.1}
- s.summary = %q{}
+ s.summary = %q{SuperCollider client for Ruby}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
View
204 spec/pan_spec.rb
@@ -1,204 +0,0 @@
-require File.expand_path(File.dirname(__FILE__)) + "/helper"
-
-require "scruby/control_name"
-require "scruby/env"
-require "scruby/ugens/ugen"
-require "scruby/ugens/ugen_operations"
-require "scruby/ugens/multi_out_ugens"
-require "scruby/ugens/ugens"
-require "scruby/ugens/pan"
-
-include Scruby
-include Ugens
-
-describe 'Panner' do
- shared_examples_for 'Panner' do
- before do
- @pan = @class.new :audio, *@params
- @inputs ||= @params
- @instance = @pan.first.source
- end
-
- it "should instantiate using control rate" do
- @class.should_receive(:new).with(:control, *@params)
- @class.kr *@params
- end
-
- it "should instantiate using audio rate" do
- @class.should_receive(:new).with(:audio, *@params)
- @class.ar *@params
- end
-
- it "should return an array of output proxies" do
- @pan.should be_a(Array)
- @pan.should have(@channels).proxies
- @pan.each_with_index do |proxy, i|
- proxy.source.should be_a(@class)
- proxy.should be_a(OutputProxy)
- proxy.output_index.should == i
- end
- end
-
- it "should set inputs" do
- @instance.inputs.should == @inputs
- end
-
- it "should just accept audio inputs if rate is audio" do
- lambda { @class.new( :audio, Ugen.new(:control) ) }.should raise_error(ArgumentError)
- end
-
- it "should accept control rate inputs unless rate is audio" do
- @class.new :control, 1, Ugen.new(:control), Ugen.new(:audio)
- end
- end
-
- describe Pan2 do
- before do
- @class = Pan2
- @ugen = Ugen.new :audio, 1, 2
- @params = @ugen, 0.5, 1.0
- @channels = 2
- end
-
- it_should_behave_like 'Panner'
-
- it "should have keyword args" do
- @class.ar( @ugen, :level => 2.0 ).first.source.inputs.should == [@ugen, 0.0, 2.0]
- end
- end
-
- describe LinPan2 do
- before do
- @class = LinPan2
- @ugen = Ugen.new :audio, 1, 2
- @params = @ugen, 0.5, 1.0
- @channels = 2
- end
-
- it_should_behave_like 'Panner'
-
- it "should have keyword args" do
- @class.ar( @ugen, :level => 2.0 ).first.source.inputs.should == [@ugen, 0.0, 2.0]
- end
- end
-
- describe Pan4 do
- before do
- @class = Pan4
- @ugen = Ugen.new :audio, 1, 2
- @params = @ugen, 0.5, 0.5, 1.0
- @channels = 4
- end
-
- it_should_behave_like 'Panner'
-
- it "should have keyword args" do
- @class.ar( @ugen, :level => 2.0 ).first.source.inputs.should == [@ugen, 0.0, 0.0, 2.0]
- end
- end
-
- describe Balance2 do
- before do
- @class = Balance2
- @ugen = Ugen.new :audio, 1, 2
- @ugen2 = Ugen.new(:audio, 2, 4)
- @params = @ugen, @ugen2, 0.5, 1.0
- @channels = 2
- end
-
- it_should_behave_like 'Panner'
-
- it "should have keyword args" do
- @class.ar( @ugen, @ugen2 , :level => 2.0 ).first.source.inputs.should == [@ugen, @ugen2 , 0.0, 2.0]
- end
- end
-
- describe Rotate2 do
- before do
- @class = Rotate2
- @ugen = Ugen.new :audio, 1, 2
- @ugen2 = Ugen.new :audio, 2, 4
- @params = @ugen, @ugen2, 0.5
- @channels = 2
- end
-
- it_should_behave_like 'Panner'
- # it "should have keyword args" do
- # @class.ar( @ugen, @ugen2 , :level => 2.0 ).first.source.inputs.should == [@ugen, @ugen2 , 0.0, 2.0]
- # end
- end
-
- describe PanB do
- before do
- @class = PanB
- @ugen = Ugen.new :audio, 1, 2
- @params = @ugen, 0.5, 0.5, 1.0
- @channels = 4
- end
-
- it_should_behave_like 'Panner'
- # it "should have keyword args" do
- # @class.ar( @ugen, @ugen2 , :level => 2.0 ).first.source.inputs.should == [@ugen, @ugen2 , 0.0, 2.0]
- # end
- end
-
- describe PanB2 do
- before do
- @class = PanB2
- @ugen = Ugen.new :audio, 1, 2
- @params = @ugen, 0.5, 1.0
- @channels = 3
- end
-
- it_should_behave_like 'Panner'
- # it "should have keyword args" do
- # @class.ar( @ugen, @ugen2 , :level => 2.0 ).first.source.inputs.should == [@ugen, @ugen2 , 0.0, 2.0]
- # end
- end
-
- describe BiPanB2 do
- before do
- @class = BiPanB2
- @ugen2 = Ugen.new(:audio, 2, 4)
- @ugen = Ugen.new :audio, 1, 2
- @params = @ugen, @ugen2, 0.5, 0.5
- @channels = 3
- end
-
- it_should_behave_like 'Panner'
- # it "should have keyword args" do
- # @class.ar( @ugen, @ugen2 , :level => 2.0 ).first.source.inputs.should == [@ugen, @ugen2 , 0.0, 2.0]
- # end
- end
-
- describe DecodeB2, 'five channels' do
- before do
- @class = DecodeB2
- @params = 5, 0.5, 0.5, 0.5, 0.5
- @inputs = 0.5, 0.5, 0.5, 0.5
- @channels = 5
- end
- it_should_behave_like 'Panner'
- end
-
- describe DecodeB2, 'seven channels' do
- before do
- @class = DecodeB2
- @params = 7, 0.5, 0.5, 0.5, 0.5
- @inputs = 0.5, 0.5, 0.5, 0.5
- @channels = 7
- end
- it_should_behave_like 'Panner'
- end
-
- describe PanAz, 'five channels' do
- before do
- @class = PanAz
- @ugen = Ugen.new(:audio, 1, 2)
- @params = 5, @ugen, 0.5, 0.5, 0.5, 0.5
- @inputs = @ugen, 0.5, 0.5, 0.5, 0.5
- @channels = 5
- end
- it_should_behave_like 'Panner'
- end
-end
View
33 test.live.rb
@@ -1,11 +1,29 @@
load File.expand_path( File.dirname( __FILE__ ) + '/../scruby.rb' )
-
s = Server.new
s.boot
-10.times { |i| print "hola #{i}" }
-1+1
+t = Scheduler.new 120, 2
+t.at 0 do
+ p t.index
+end
+
+t.run
+
+t.stop
+
+
+# t2 = Ticker.new 120 do |i|
+# p "2: #{i}"
+# t2.reset if i % 4 == 0
+# end
+# t2.run
+
+t.stop
+t2.stop
+
+
+
# Síntesis aditiva básica
SynthDef.new :add do
@@ -184,21 +202,20 @@
# Multiplicación de dos señales, el resultado es todo lo que coincide en las dos señales
-buffer = Buffer.read s, "sounds/Sound0.aiff", :frames => 10460
+buffer = Buffer.read s, "azteca/clave.wav", :frames => 5000, :start => 25050
+Synth.new :convo, :dur => 1, :buffnum => buffer.buffnum
SynthDef.new :convo do |dur, buffnum|
sig = WhiteNoise.ar
- sig *= EnvGen.kr Env.perc(0, 0.5), :doneAction => 2
- buff = PlayBuf.ar buffnum, :rate => 0.6, :loop => 1.0
- sig = Convolution.ar buff, sig, 1024, 0.5
+ EnvGen.kr Env.perc(0, 1), :doneAction => 2
+ sig = PlayBuf.ar buffnum, :rate => 0.6, :loop => 0
Out.ar 0, [sig]*2
end.send
-Synth.new :convo, :dur => 1, :buffnum => buffer.buffnum

0 comments on commit 9ce6e4f

Please sign in to comment.
Something went wrong with that request. Please try again.