Diff from Re: Load and play samples from GUI (Qt GUI only), adapted to use SoundFile:cue by LFSaw (30 Apr'12 15:07) to Load and play samples from GUI (Qt GUI only) by rukano (22 Apr'12 02:14)

name
Re: Load and play samples from GUI (Qt GUI only), adapted to use SoundFile:cue
description
*NeedsPretty Qtsimple GUI (VLayout)* ----- Basicbutton GUIper sample) for loading samples into buffers and playing them viafrom buttonGUI pressesbuttons. Differences to the original version by rukano: +!!! adaptedNeeds toQt useGUI SoundFile:cue +!!! you can start and stop playing the samples(VLayout)
code
//samplePlayerGUI var make; var dialog = Dialog.openPanel({ |list| make.(list) }, nil, true); var win = Window("Sample Player 30013000").front; var samples = (); var buttons = (); var players = (); make = { |paths| { paths.do{ |path| [\loaded, path.basename].postln; samples[path] = SoundFileBuffer.collectread(Server.default, path); s.firstsync; buttons[path] = Button() .states_([[path.basename], [path.basename, Color.red]]) .action_{|me| (me.value == 1).if({ players[path] = samples[path].cue((amp:play 1, server: Server.default), true) }, { players[path].release; }); }; }; win.layout = VLayout(*buttons.asArray); win.onClose_{ samples.do{ |playerbuf| playerbuf.releaseclose; buf.free }; }; }.fork(AppClock); };
category tags
gui, sampler, code forkgui, loader, sound file
ancestors
1-3CI