Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encoding seems to be working, have to try with sdef default values
- Loading branch information
Macario
committed
Nov 13, 2008
1 parent
bda79b0
commit 7b71da4
Showing
25 changed files
with
275 additions
and
1,940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,34 @@ | ||
|
||
|
||
Ruby has operation precendence | ||
|
||
== LICENSE: | ||
|
||
(The MIT License) | ||
|
||
Copyright (c) 2008 Macario Ortega | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
'Software'), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
== NOTES | ||
|
||
Ruby has operation precendence | ||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
module Scruby | ||
module Audio | ||
class Server < OSC::UDPServer | ||
attr_reader :host, :port | ||
@@sc_path = '/Applications/SuperCollider/scsynth' | ||
|
||
def initialize( host = 'localhost', port = 57110) | ||
@host, @port = host, port | ||
end | ||
|
||
alias :udp_send :send | ||
def send( command, *args ) | ||
udp_send( OSC::Message.new( command, type_tag(args), *args ), 0, @host, @port ) | ||
end | ||
|
||
def send_message( message ) | ||
udp_send( message, 0, @host, @port ) | ||
end | ||
|
||
def type_tag(*args) | ||
args = *args | ||
args.collect{ |msg| OSC::Packet.tag( msg ) }.to_s | ||
end | ||
|
||
def send_synth_def( synth_def ) | ||
*blob = OSC::Blob.new( synth_def.encode ), 0 | ||
def_message = OSC::Message.new( '/d_recv', type_tag( blob ), *blob ) | ||
self.send_message( OSC::Bundle.new( nil, def_message ) ) | ||
end | ||
|
||
def stop | ||
end | ||
|
||
def boot | ||
raise SCError.new('Scsynth not found in the given path') unless File.exists?( @@sc_path ) | ||
end | ||
|
||
class << self | ||
def sc_path=( path ) | ||
@@sc_path = path | ||
end | ||
|
||
def sc_path | ||
@@sc_path | ||
end | ||
end | ||
|
||
class SCError < StandardError | ||
end | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,20 @@ | ||
module Scruby | ||
module Audio | ||
module Ugens | ||
|
||
class EnvGen < Ugen | ||
|
||
class << self | ||
def ar( envelope, gate = 1.0, levelScale = 1.0, levelBias = 0.0, timeScale = 1.0, doneAction = 0 ) | ||
def ar( envelope, gate = 1, levelScale = 1, levelBias = 0, timeScale = 1, doneAction = 0 ) | ||
new(:audio, gate, levelScale, levelBias, timeScale, doneAction, *envelope.to_array) | ||
end | ||
|
||
def kr( envelope, gate = 1.0, levelScale = 1.0, levelBias = 0.0, timeScale = 1.0, doneAction = 0 ) | ||
def kr( envelope, gate = 1, levelScale = 1, levelBias = 0, timeScale = 1, doneAction = 0 ) | ||
new(:control, gate, levelScale, levelBias, timeScale, doneAction, *envelope.to_array) | ||
end | ||
named_args_for :ar, :kr | ||
end | ||
|
||
end | ||
|
||
class Done < Ugen | ||
def self.kr( src ) | ||
self.init( :control, src ) | ||
end | ||
end | ||
|
||
class FreeSelf < Ugen | ||
def self.kr( input ) | ||
self.init(:control, input) | ||
input | ||
end | ||
end | ||
|
||
class PauseSelf < Ugen | ||
def self.kr(input) | ||
self.init(:control, input) | ||
input | ||
end | ||
end | ||
|
||
class FreeSelfWhenDone < Ugen | ||
def self.kr(src) | ||
self.init(:control, src) | ||
end | ||
end | ||
|
||
class PauseSelfWhenDone < Ugen | ||
def self.kr(src) | ||
self.init(:control, src) | ||
end | ||
end | ||
|
||
class Pause < Ugen | ||
def self.kr(gate, id) | ||
self.init(:control, gate, id) | ||
end | ||
end | ||
|
||
class Free < Ugen | ||
def self.kr(trig, id) | ||
self.init(:control, trig, id) | ||
end | ||
end | ||
|
||
class Linen < Ugen | ||
class << self | ||
def kr( gate = 1.0, attackTime = 0.01, susLevel = 1.0, releaseTime = 1.0, doneAction = 0 ) | ||
new( :control, gate, attackTime, susLevel, releaseTime, doneAction ) | ||
end | ||
named_args_for :kr | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.