Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Re: Load and play samples from GUI (Qt GUI only), adapted to use SoundFile:cue
name
code content
//samplePlayerGUI var make; var dialog = Dialog.openPanel({ |list| make.(list) }, nil, true); var win = Window("Sample Player 3001").front; var samples = (); var buttons = (); var players = (); make = { |paths| { paths.do{ |path| [\loaded, path.basename].postln; samples[path] = SoundFile.collect(path).first; buttons[path] = Button() .states_([[path.basename], [path.basename, Color.red]]) .action_{|me| (me.value == 1).if({ players[path] = samples[path].cue((amp: 1, server: Server.default), true) }, { players[path].release; }); }; }; win.layout = VLayout(*buttons.asArray); win.onClose_{ samples.do{ |player| player.release; }; }; }.fork(AppClock); };
code description
*Needs Qt GUI (VLayout)* ----- Basic GUI for loading samples and playing them via button presses. Differences to the original version by rukano: + adapted to use SoundFile:cue + you can start and stop playing the samples
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change