Skip to content

Commit

Permalink
Merge branch 'master' of github.com:supercollider/supercollider into …
Browse files Browse the repository at this point in the history
…qt5-clean
  • Loading branch information
scztt committed Jun 13, 2014
2 parents e8c9180 + f19a8bb commit 0706bf8
Show file tree
Hide file tree
Showing 129 changed files with 8,447 additions and 3,313 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -4,3 +4,6 @@
[submodule "external_libraries/nova-tt"]
path = external_libraries/nova-tt
url = git://github.com/timblechmann/nova-tt.git
[submodule "external_libraries/hidapi"]
path = external_libraries/hidapi
url = git://github.com/sensestage/hidapi.git
13 changes: 13 additions & 0 deletions CMakeLists.txt
Expand Up @@ -50,6 +50,10 @@ if (${CMAKE_COMPILER_IS_GNUCXX})

add_definitions("-Wreturn-type")

if(${_gcc_version} VERSION_LESS 4.7)
message(FATAL_ERROR "SuperCollider requires at least gcc-4.7 when compiled with gcc.")
endif()

# disabled for now: -ffast-math breaks avx intrinsics and -fsigned-zeros/-fno-associative-math are not available in some versions
# if (${_gcc_version} VERSION_GREATER 4.0.99)
# add_definitions("-ffast-math -fsigned-zeros -fno-associative-math")
Expand Down Expand Up @@ -426,6 +430,15 @@ if(INSTALL_HELP)
endif()
endif()


#hid resources directory:
set(HID_HUT_PATH ${auxresourcesdir}/SCClassLibrary/Common/Control/HID_support)

install(DIRECTORY external_libraries/hidapi/hut
DESTINATION ${HID_HUT_PATH}
FILES_MATCHING PATTERN "*.yaml"
)

#############################################
#
# build scdoc help files
Expand Down
161 changes: 148 additions & 13 deletions HelpSource/Classes/BusPlug.schelp
@@ -1,72 +1,207 @@
class:: BusPlug
summary:: a listener on a bus
categories:: Libraries>JITLib>NodeProxy, Live Coding
related:: Classes/Bus
related:: Classes/Bus, Classes/Monitor, Classes/InBus, Classes/NodeProxy, Classes/Ndef

description::
BusPlug is mainly in use as a basic superclass of NodeProxy, but it can be applied for other things as well. Most methods are documented in the link::Classes/NodeProxy:: helpfile.
A BusPlug is represents a listener on a private link::Classes/Bus:: that makes it easy to play back to multiple channels. It is mainly in use as a superclass of NodeProxy, but it can be used for general channel routings as well. Most methods are documented in the link::Classes/NodeProxy:: helpfile.

code::
s.boot;
z = Bus.control(s, 16);
z.setn({ |i| (i * 5).nthPrime } ! 16 * 5 + 100);
a = BusPlug.for(z);
{ Splay.ar(SinOsc.ar(a.kr(3, MouseX.kr(0, 25)))) * 0.1 }.play; // selectively play 3 channel of the 16, modulate offset
::

ClassMethods::



method::new
Create a new (neutral) instance on the given server

method::for
Create an instance with a given link::Classes/Bus::.

method::audio
Create a new audio rate instance on the given server

method::control
Create a new audio rate instance on the given server

method::defaultNumAudio
Default number of channels when initializing in audio rate and no specific number is given (default: 2).

method::defaultNumControl
Default number of channels when initializing in control rate and no specific number is given (default: 1).

method::defaultReshaping
default reshaping behaviour for BusPlug and its sublass NodeProxy. See: link::#reshaping::

InstanceMethods::

private::makeBusArg, prepareForProxySynthDef, wakeUpToBundle, playNToBundle, playToBundle, newMonitorToBundle, clock

method::server
Return the server that the BusPlug runs on.

method::clear
Free the bus, end the monitor

method::reshaping
Determines how to behave when link::#initBus:: is called.
Current options:
list::
## nil Once initialized, keep the same bus - this is the default
## \elastic On a change, shrink and grow according to need, replace bus. Monitoring is adjusted.
## \expanding On a change, only grow according to need, replace bus. Monitoring is adjusted.
::

subsection::In UGen graphs and Patterns

method::ar, kr
Return a link to my output, which is limited by strong::numChannels::. If uninitialized, creates a matching bus. Normally, strong::ar defaults to stereo, kr to mono::. This can be set in the classvars: link::#*defaultNumAudio::, link::#*defaultNumControl::
Return a link to numChannels of my output. If uninitialized, creates a matching bus. Normally, strong::ar defaults to stereo, kr to mono::. This can be set in the classvars: link::#*defaultNumAudio::, link::#*defaultNumControl::

For consistency, it always returns an array of signals when no numChannels are given. To make it a single ugen output, use code::cumChannels = 1:: . See also: link::Classes/InBus::.

argument::numChannels
Number of channels returned. If the receiver is neutral or reshaping is elastic, initialize it to this number. If this is more than the available channels, use the clip behaviour (below). If set to code::1::, it will return an instance of link::Classes/InBus::, otherwise an Array of one or more instances of InBus.

argument::offset
Channel offset when reading a bus that has more channels than numChannels, cross fading between adjacent channels.
"/Users/wanninger/Library/Application Support/SuperCollider/Help/Overviews/Methods.html"
argument::clip
If set to 'wrap', exceeding channels will wrap around, if set to 'clip', repeat the last one.


method::asUGenInput
Returns the appropriate output to read from the BusPlug bus (an link::Classes/InBus:: UGen)
code::
b = BusPlug.new;
{ Blip.ar(b + 5) }.play;
b.bus.set(12);
::

method::embedInStream
Returns the map argument for the bus, if the bus has multiple channels, it will return an array of map args.
code::
b = BusPlug.new;
x = Pbind(\z, b).asStream;
x.next(()); // returns the map argument for the bus
b.defineBus(\audio, 3);
x.next(()); // returns map arguments for the audio rate bus
::

method::asControlInput
Returns the map argument for the bus, just like link::#-embedInStream::

subsection::Monitoring and Routing

method::isPlaying
Returns true if server is running and bus not nil. link::Classes/NodeProxy:: this returns true if the group is playing.

method::isMonitoring
Returns true if monitor is playing

method::play
Plays from a bus index ( strong::out:: ) with a number of channels to another index with a number of channels, within a strong::group:: (ie a target group or server).
Play from a bus index with a number of channels to another index with a number of channels, within a link::Classes/Group:: (i.e. a target group or server).

argument::out
bus index

argument::numChannels
an link::Classes/Integer::
number of channels to output. If BusPlug is neutral or reshaping is elastic, initialize it to this number. If this is more than the available channels, wrap around. If this is not given, and reshaping is elastic, it will automatically expand.

argument::group
target link::Classes/Group:: or link::Classes/Server::
target link::Classes/Group:: or link::Classes/Server:: in which to play the monitor synths.

argument::multi
keep old links and add new one
keep old playback links and add new one

argument::vol
volume at which to monitor
overall volume at which to monitor

argument::fadeTime
fade in fade out time
fade in / fade out time

argument:: addAction
Where in the node tree to play the monitor synths




method::playN
Play back on non-contiguous channels. See: link::Classes/Monitor:: and link::Reference/playN::

argument::outs
array of destination channels
array of destination channels (or single value)


argument::amps
array of amplitudes for each channel
array of amplitudes for each channel (or single value)

argument::ins
array of source channels
array of source channel offsets within the bus (or single value)

argument:: vol
argument:: fadetime
Overall volume (multiplied by amps)

argument:: fadeTime
array of fadeTimes (or single value) for fade in / fade out

argument:: group
target link::Classes/Group:: or link::Classes/Server:: in which to play the monitor synths.

argument:: addAction
Where in the node tree to play the monitor synths



method::stop
stop to play out public channels.

argument::fadeTime
decay time for this action

argument::reset
if set to true, reset all monitor state. Otherwise, the previous play arguments are kept.


method::monitor
returns the current monitor (see link::Classes/Monitor::)




subsection::Bus changes
These methods are a little numerous, because they are important for implementing link::Classes/NodeProxy:: behavior. Mostly the methods link::#-bus:: and link::#-initBus:: will be sufficient in normal use.

note::The old bus is freed when a new bus is made.::

method::isNeutral
Returns true if no bus has been initialized so far.

method::bus
Set or get the bus. If BusPlug monitor is playing, restart the monitor to adequately play back the new bus.

method::setBus
set the bus object by passing a link::Classes/Bus::.
note::you have to stop and play explicitly::

method::defineBus
make a new bus for the BusPlug with a given rate and number of channels.

method::initBus
Make a new bus only if necessary. This depends on the current bus and the link::#-reshaping:: mode.

returns::Boolean (true if successful).






Examples::

code::
Expand Down
7 changes: 6 additions & 1 deletion HelpSource/Classes/Convolution.schelp
Expand Up @@ -31,7 +31,12 @@ Processing kernel.

argument::framesize

Size of FFT frame, must be a power of 2.
Size of FFT frame, must be a power of two (512, 1024, 2048, 4096 are standard choices).
Convolution uses twice this number internally.
Note that the convolution gets progressively more expensive to run for higher powers!
The maximum value you can use is 2^16=16384.
(This upper limit is half of "SC_FFT_MAXSIZE" defined in the SC source code.)
Larger convolutions than this can be done using link::Classes/PartConv::.


argument::mul
Expand Down
11 changes: 5 additions & 6 deletions HelpSource/Classes/Convolution2.schelp
Expand Up @@ -13,7 +13,7 @@ Internally, this unit uses FFT to accelerate the calculation, which means that
(a) you must specify a "framesize", and
(b) if the kernel is longer than this framesize, the end of it will be ignored.

See also link::http://www.dspguide.com/ch18.htm:: by Steven W.
See also link::http://www.dspguide.com/ch18.htm:: by Steven W.
Smith.


Expand All @@ -40,11 +40,10 @@ value.

argument::framesize

Size of FFT frame, must be a power of two. Convolution uses twice
this number internally:
512, 1024, 2048, 4096 are standard choices.
Note that it gets progressively more expensive to run for higher powers!
The maximum value you can use is 16384.
Size of FFT frame, must be a power of two (512, 1024, 2048, 4096 are standard choices).
Convolution uses twice this number internally.
Note that the convolution gets progressively more expensive to run for higher powers!
The maximum value you can use is 2^16=16384.
(This upper limit is half of "SC_FFT_MAXSIZE" defined in the SC source code.)
Larger convolutions than this can be done using link::Classes/PartConv::.

Expand Down
8 changes: 7 additions & 1 deletion HelpSource/Classes/Convolution2L.schelp
Expand Up @@ -24,7 +24,13 @@ argument::trigger
update the kernel on a change from <=0 to >0

argument::framesize
size of FFT frame, must be a power of two. Convolution uses twice this number internally, maximum value you can give this argument is 2^16=65536. Note that it gets progressively more expensive to run for higher powers! 512, 1024, 2048, 4096 standard.
size of FFT frame, must be a power of two (512, 1024, 2048, 4096 are standard choices).
Convolution uses twice this number internally.
Note that the convolution gets progressively more expensive to run for higher powers!
The maximum value you can use is 2^16=16384.
(This upper limit is half of "SC_FFT_MAXSIZE" defined in the SC source code.)
Larger convolutions than this can be done using link::Classes/PartConv::.


argument::crossfade
The number of periods over which a crossfade is made. The default is 1. This must be an integer.
Expand Down
6 changes: 5 additions & 1 deletion HelpSource/Classes/Convolution3.schelp
Expand Up @@ -4,9 +4,13 @@ related:: Classes/Convolution, Classes/Convolution2, Classes/Convolution2L
categories:: UGens>Convolution

Description::
Strict convolution with fixed kernel which can be updated using a trigger signal. The convolution is performed in the time domain, which is highly inefficient, and probably only useful for either very short kernel sizes, or for control rate signals.
Strict convolution with fixed kernel which can be updated using a trigger signal. The convolution is performed in the time domain.


note::
Doing conmvolution in time domain is highly inefficient, and probably only useful for either very short kernel sizes, or for control rate signals.
See link::Classes/Convolution2:: and link::Classes/Convolution2L:: for more efficient convolution UGens.
::

classmethods::
private:: categories
Expand Down
55 changes: 36 additions & 19 deletions HelpSource/Classes/Dictionary.schelp
Expand Up @@ -292,9 +292,43 @@ d.asKeyValuePairs;
::

method::embedInStream
If the event is not nil, yields a copy, with all the elements of the receiver. See also link::Classes/Event::.

argument::event
The inval, usually in an event stream. See also link::Classes/Event::.

If the event is not nil, yields a copy, adding all the elements of the receiver event (this leaves the receiver unchanged). If it is nil, return the receiver.

code::
a = (note: 2);
b = (note: [3, 5]);
Pseq([a, b]).play;
::

If a key "embedInStream" is given, use this function instead. The behaviour of the event can be configured easily this way.

The arguments event (the reciever) and inevent (the inevent) are passed to the function. note::In infinite patterns, you strong::must:: call yield or embedInStream in the function, otherwise it will loop forever.::


code::
(
a = (
pattern: Pbind(\note, Pgeom(1, 1.1, { 20.rand }), \dur, 0.05),
embedInStream: { |event, inevent| event[\pattern].embedInStream(inevent) }
);
b = (note: [3, 5]);
c = (freq: 402, dur: 0.3);
Prand([a, b, c], inf).trace.play;
)

// change the events while playing
c[\freq] = [900, 1002, 1102];
c[\freq] = [200, 101, 1102];
::


A generator for dictionaries:

code::
// write a generator for dictionaries
(
d = (
a: 5, b: 7, c: 1,
Expand All @@ -311,23 +345,6 @@ d = (
d.rout.((z:999));
d.rout.((z:1, a:0));
d.rout.(());

// sound example
// this also allows to use events or dictionaries in patterns directly:
(
d = (freq: 402, dur: 0.3);
Pseq([
d,
(freq: 300, dur: 0.3),
d,
(freq: [400, 770, 800], dur: 1),
d,
(freq: 451, dur: 0.33)
], inf).play;
);

d[\freq] = [900, 1002, 1102];
d[\freq] = [200, 101, 1102];
::

SECTION::Overview
Expand Down

0 comments on commit 0706bf8

Please sign in to comment.