Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The method isRunning is added #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 17 additions & 3 deletions HelpSource/Classes/Spectrogram.schelp
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
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