Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions HelpSource/Classes/Spectrogram.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,22 @@ Specify the range of frequencies you want to visualise.
DISCUSSION::
code::
s.boot;

(
// the spectrogram in a window
w = Window.new("testing spectrogram", Rect(10,10, 600, 300)).front;
a = Spectrogram.new(w, Rect(10, 10, 580, 280));
a.start;
{Saw.ar(LFNoise1.kr(1).range(20,2250))}.play;
a = Spectrogram.new(w, Rect(10, 10, 580, 280))
)

a.start

a.isRunning

{Saw.ar(LFNoise1.kr(1).range(20,2250))}.play

a.stop

a.isRunning
::


Expand All @@ -62,6 +73,9 @@ Starts analysis and drawing.
METHOD:: stop
Stop analysis and drawing.

METHOD:: isRunning
A Boolean, true if the spectrogram is active or false if the spectrogram has been stopped.

METHOD:: setBufSize
Set the buffer size of the fft window.

Expand Down
5 changes: 3 additions & 2 deletions Spectrogram.sc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Spectrogram {
this.setUserView(window, bounds);
window.onClose_({
image.free;
this.stopruntask;
if(this.isRunning) { this.stopruntask };
fftbuf.free;
}).front;
}
Expand Down Expand Up @@ -216,6 +216,7 @@ Spectrogram {

stop { this.stopruntask }

isRunning { ^running }
}

SpectrogramWindow : Spectrogram {
Expand Down Expand Up @@ -371,7 +372,7 @@ SpectrogramWindow : Spectrogram {
try{ fftSynth.free };
try{ fftbuf.free };
scopeOpen = false;
this.stopruntask;
if(this.isRunning) { this.stopruntask };
CmdPeriod.remove(cper);
}).front;
}
Expand Down