Skip to content

Instantly share code, notes, and snippets.

@kn1kn1
Created January 9, 2026 13:21
Show Gist options
  • Select an option

  • Save kn1kn1/c2751e343661ff58ff806b3de0ad9b44 to your computer and use it in GitHub Desktop.

Select an option

Save kn1kn1/c2751e343661ff58ff806b3de0ad9b44 to your computer and use it in GitHub Desktop.

波形の表示

基本的には{}で括って.plot

  • 音の再生
{LFSaw.ar(4, 3pi/2).range(0, 3000)}.play
  • 波形の表示(引数はx軸の長さ(秒数))
{LFSaw.ar(4, 3pi/2).range(0, 3000)}.plot(0.5)
  • 音の再生と波形の表示
{LFSaw.ar(4, 3pi/2).range(0, 3000)}.scope
  • スペクトルの表示
{LFSaw.ar(4, 3pi/2).range(0, 3000)}.freqscope
  • References
    • 田所淳(2025)『共鳴するコード、SuperColliderで創る音の世界』ビー・エヌ・エヌ, pp.69, 73.
    • Fieldsteel, E. (2024). SuperCollider for the Creative Musician: A Practical Guide. Oxford University Press, p.74.

値のprint

pollを使う。Post windowに出力される。

// Code Example 2.35
(
x = {
	var sig, freq;
	freq = SinOsc.kr(0.2).exprange(200,800).poll(20);
	sig = SinOsc.ar(freq);
	sig = sig * 0.2;
	sig = sig ! 2;
}.play;
)

pollの引数は周波数。20より大きい数字を使うことは稀だそう。SCのヘルプによるとデフォルトは10。

The default trig is 10, which converts to 10 triggers per second (or every 0.1 seconds)

postlnではないで注意。

// Code Example 2.35
(
x = {
	var sig, freq;
	freq = SinOsc.kr(0.2).exprange(200,800).postln;
	sig = SinOsc.ar(freq);
	sig = sig * 0.2;
	sig = sig ! 2;
}.play;
)

以下のように、オブジェクトをprintするだけになってしまう。

a LinExp
-> Synth('temp__10' : 6450)
  • References
    • Fieldsteel, E. (2024). SuperCollider for the Creative Musician: A Practical Guide. Oxford University Press, p.72.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment