sfplay~

Mar 17, 2006 at 1:26pm

sfplay~

I am using the sfplay~ object. It is possible to use a toggle to start and stop playback of an audio file, but the 0 resets the object so when it receives a 1 it starts playback from the beginning. Once the file is started it is possible to pause playback in two ways:

using the pause/resume messages

or

using the speed $1 message with 0 routed through it (so the playback speed is 0)

I am wondering if it is possible to create one button that starts playback, but once the file is started it then acts as a play/resume button. Then when a 0 is sent from another button, the all-in-one start/pause/resume is reset so that it can begin playback from the beginning again.

#24938
Mar 17, 2006 at 4:25pm

like this ?

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 301 177 77 196617 open , 1 , loop 1;
#P user ezdac~ 283 252 327 285 0;
#P message 234 146 14 196617 1;
#P newex 234 124 45 196617 onebang;
#P newex 283 83 166 196617 if $i1 == 1 then resume else pause;
#P toggle 283 60 15 0;
#P button 269 60 15 0;
#N sfplay~ 1 120960 0 ;
#P newobj 283 210 44 196617 sfplay~;
#P connect 7 0 0 0;
#P connect 0 0 6 0;
#P connect 0 0 6 1;
#P connect 3 0 4 0;
#P connect 3 0 0 0;
#P connect 5 0 0 0;
#P connect 4 0 5 0;
#P connect 1 0 4 1;
#P connect 2 0 3 0;
#P window clipboard copycount 8;

#72810
Mar 17, 2006 at 4:27pm

sorry… like this

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 234 83 32 196617 sel 1;
#P message 301 177 77 196617 open , 1 , loop 1;
#P user ezdac~ 283 252 327 285 0;
#P message 234 146 14 196617 1;
#P newex 234 124 45 196617 onebang;
#P newex 283 83 166 196617 if $i1 == 1 then resume else pause;
#P toggle 283 32 15 0;
#P button 269 32 15 0;
#N sfplay~ 1 120960 0 ;
#P newobj 283 210 44 196617 sfplay~;
#P fasten 2 0 8 0 288 59 239 59;
#P connect 2 0 3 0;
#P connect 8 0 4 0;
#P connect 7 0 0 0;
#P connect 0 0 6 0;
#P connect 0 0 6 1;
#P connect 3 0 0 0;
#P connect 5 0 0 0;
#P connect 4 0 5 0;
#P connect 1 0 4 1;
#P window clipboard copycount 9;

#72811
Mar 17, 2006 at 8:13pm

Jay Simpson wrote:
> I am wondering if it is possible to create one button that starts
> playback, but once the file is started it then acts as a play/resume
> button. Then when a 0 is sent from another button, the all-in-one
> start/pause/resume is reset so that it can begin playback from the
> beginning again.

I made something like that, maybe its time to include it into my
collection. Save this as St.playControl and the second part is the help
file this will need my St.ools.
http://www.cycling74.com/twiki/pub/Share/StefanTiedje/St.ool s.zip

Stefan

St.playControl :

#P inlet 388 52 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 388 93 53 196617 prep open;
#P newex 192 52 109 196617 patcherargs;
#P newex 192 72 109 196617 unpacker 3;
#P newex 24 105 165 196617 route play stop continue 1 0;
#P newex 225 136 30 196617 sel 1;
#P toggle 225 116 15 0;
#P newex 258 136 26 196617 t 0;
#P outlet 74 259 15 0;
#P inlet 24 52 15 0;
#P newex 291 136 37 196617 t 99 1;
#P newex 304 93 82 196617 ttoms 99;
#P inlet 340 52 15 0;
#P inlet 322 52 15 0;
#P newex 138 199 29 196617 pset;
#P outlet 138 259 15 0;
#P newex 192 93 109 196617 keysel p space ret del;
#P newex 86 165 62 196617 t 100 1;
#P newex 74 199 61 196617 snapshot~;
#P window linecount 2;
#P newex 74 221 61 196617 prepend preload 100;
#P window linecount 1;
#P newex 55 165 29 196617 t 0 b;
#P newex 24 165 21 196617 t 1;
#P connect 21 0 20 0;
#P connect 9 0 10 2;
#P connect 8 0 10 1;
#P connect 5 3 11 0;
#P connect 18 3 5 3;
#P connect 5 2 14 0;
#P connect 18 2 5 2;
#P connect 15 0 16 0;
#P connect 7 0 6 0;
#P fasten 7 0 15 0 143 219 216 219 216 113 230 113;
#P connect 5 1 15 0;
#P connect 18 1 5 1;
#P connect 18 0 5 0;
#P connect 19 0 18 0;
#P fasten 1 0 7 0 68 187 143 187;
#P fasten 0 0 13 0 29 255 79 255;
#P fasten 0 0 7 0 37 187 143 187;
#P fasten 11 1 7 0 323 187 143 187;
#P connect 4 1 7 0;
#P connect 17 2 4 0;
#P fasten 16 0 4 0 230 157 91 157;
#P fasten 4 0 13 0 60 203 60 255 79 255;
#P fasten 11 0 13 0 296 255 79 255;
#P connect 2 0 13 0;
#P fasten 10 2 13 0 381 255 79 255;
#P fasten 1 0 13 0 60 255 79 255;
#P fasten 20 0 13 0 393 255 79 255;
#P connect 3 0 2 0;
#P connect 1 1 3 0;
#P fasten 17 5 3 0 184 191 79 191;
#P connect 17 1 1 0;
#P fasten 17 4 1 0 153 134 60 134;
#P fasten 16 1 1 0 250 161 60 161;
#P fasten 14 0 1 0 263 161 60 161;
#P connect 17 0 0 0;
#P fasten 5 0 0 0 197 127 29 127;
#P fasten 17 3 0 0 122 127 29 127;
#P connect 12 0 17 0;
#P window clipboard copycount 22;

Here is St.playControl.help

#P window setfont “Sans Serif” 12.;
#P message 90 168 61 196620;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 90 146 61 196617 St.owtime~;
#P number 91 62 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 53 62 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 39 155 83 188 0;
#P user led 39 37 17 17 1 150;
#P message 130 38 47 196617 continue;
#P message 95 38 32 196617 stop;
#P message 59 38 32 196617 play;
#P newex 39 86 87 196617 St.playControl;
#P message 138 87 31 196617 open;
#N sfplay~ 1 0 1 ;
#P newobj 39 118 112 196617 sfplay~ 1 0 1;
#P window linecount 12;
#P user com 179 39 130 196617 129;
#K set 0 17263 28276 29295 27680 24942 25632 16745 25632 26223 29216
28780 24953 25185 25451 8303 26144 29551 30062 25702 26988 25971 11808
18804 8297 29472 24949 29807 28001 29801 25441 27756 31008 24947 29545
26478 25956 8308 28448 29800 25888 26223 27756 28535 26990 26400 27493
31091 14880 3440 14880 29556 24946 29728 28780 24953 3443 28769 25445
14880 29556 28528 11619 28526 29801 28277 25869 29285 29813 29294 14880
29556 28528 3428 25964 14880 27253 28016 8308 28448 28786 25956 25958
26990 25956 8301 26990 14963 25955 8232 26990 27749 29728 12832 24942
25632 13097 11789 22895 29984 25441;
#K set 100 28192 26473 30309 8304 24946 24941 25972 25970 29472 24947
8294 28530 8299 25977 29541 27680 29807 8291 26721 28263 25888 29800
25971 25888 25455 28276 29295 27763 11776;
#K end;
#P connect 10 0 3 2;
#P connect 11 0 12 0;
#P fasten 1 1 3 0 95 140 28 140 28 81 44 81;
#P connect 1 1 11 0;
#P connect 9 0 3 1;
#P hidden connect 1 0 8 1;
#P hidden connect 1 0 8 0;
#P fasten 2 0 1 0 143 113 44 113;
#P connect 3 0 1 0;
#P hidden connect 7 0 3 0;
#P hidden connect 4 0 3 0;
#P hidden connect 5 0 3 0;
#P hidden connect 6 0 3 0;
#P fasten 3 1 7 0 121 107 128 107 128 31 44 31;
#P window clipboard copycount 13;

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

#72812
Mar 23, 2006 at 10:34pm

Can’t download your externals dude.

#72813

You must be logged in to reply to this topic.