Category:SuperCollider

From Rosetta Code
Revision as of 15:32, 21 June 2024 by Music Coder (talk | contribs) (Some additional notes on SuperCollider 2024-06-21)
This page is a stub. It needs more information! You can help Rosetta Code by filling it in!
Language
SuperCollider
This programming language may be used to instruct a computer to perform a task.
Official website
Execution method: Interpreted
Type checking: Dynamic
See Also:


Listed below are all of the tasks on Rosetta Code which have been solved using SuperCollider.

SuperCollider is an environment and programming language for real time audio synthesis and algorithmic composition. It provides an interpreted object-oriented language (often called sclang) which functions as a network client to a state of the art, realtime sound synthesis server. It is used by musicians, artists, and researchers working with sound.

The programming language was originally devised by James McCartney and has been further developed by an interdisciplinary open source community. Its design follows a pure object-oriented design that relies on objects including functions as first-class citizens. It is dynamically typed, and has functions of both lexical and dynamic scope. SuperCollider comes with an interactive programming library for the runtime rewriting of programs, which includes programming as a performance (live coding). There are several purely functional sublanguages embedded in the system. While mostly used for sound, its structure is general purpose.


SuperCollider at GitHub SuperCollider Homepage



Some additional notes on SuperCollider 2024-06-21

From the SuperCollider GitHub website: https://supercollider.github.io/ :
Quote:
A PLATFORM FOR AUDIO SYNTHESIS AND ALGORITHMIC COMPOSITION,
      USED BY MUSICIANS, ARTISTS AND RESEARCHERS WORKING WITH SOUND.

FREE AND OPEN SOURCE SOFTWARE FOR WINDOWS, MACOS AND LINUX.

SuperCollider features three major components:
scsynth – A real-time audio server
sclang – An interpreted programming language
scide – An editor for sclang with an integrated help system
End-Quote.

Some people try to squeeze a musical composition into 140 characters: (but just for the challenge):
Don't judge SuperCollider or the language by these examples, they are just for fun.

f={|t|Pbind(\note,Pseq([-1,1,6,8,9,1,-1,8,6,1,9,8]+5,319),\dur,t)};Ptpar([0,f.(1/6),12,f.(0.1672)],1).play

Listen to the results here: https://supercollider.github.io/assets/audio/sc-140/06_batuhanbozkurt_celesteh.mp3
You can see/hear more at: https://supercollider.github.io/sc-140.html


As of today (2024-06-21) the current version of SuperCollider for all supported platforms is: 3.13.0

While SClang (SuperCollider language) and its companion components are designed for the creation of sounds and music, the language is a full featured programming language.

The language is OO, to the extent that everything is an object, even numbers.
In this snippet: 123 + 456 the 123 is an object, + is a method on the class of that object, and 456 is a parameter to that method.
Even though + is a method the syntax of the addition is what you would typically expect.

The print function in SClang is a method called postln, which first appears in the root of the class tree: Object.

Some examples, showing two possible call formats:

postln("Hello World"); // prints: Hello World
"Hello World".postln;  // prints: Hello World
postln(1001);          // prints: 1001
1001.postln;           // prints: 1001
postln(123 + 456);     // prints: 579
(123 + 456).postln;    // prints: 579

The method postln, adds a new-line after printing the text, if you don't want the new-line, use: post.

... more coming soon ...