This is pretty nice... thanks!  I changed 1 thing and added another
method to the external which might be useful for others [updated the
help with that].

First, I figured the external shouldn't try to start the jack server
if it isn't already started.. so i changed the options used for
creating the client to reflect that.

Second, I created a 'locate' method, which lets you set a new location
for the transport [giving it a frame number]..  Most usefully, |locate
0( to put the transport back to the beginning.

I've attached the diff and the updated help file.

-Ale

On Tue, Feb 19, 2008 at 12:11 PM, Andy Farnell
<padawa...@obiwannabe.co.uk> wrote:
> On Tue, 19 Feb 2008 12:31:12 -0600
> "Jacob Lee" <jel...@uiuc.edu> wrote:
>
>> What are you using as the jack transport master? This external doesn't
>> have the capability to act as the master, so something else has to set
>> the tempo and time signature (that's what I'm using klick for). And pd
>> has to be computing audio, since the plugin gets the current transport
>> position during the pd dsp cycle. Those are the two things I would
>> check. (I don't think jackd prints anything in this case, by the way.)
>
>
> qjackctl under linux
>
>
> I think it defaults to 120bpm 4/4
>
> Messages usually  appear in the qjackctl window (with Ardour etc)
>
> Pretty sure audio DSP was running, will check it again tonight,
>
> Andy
>
>
>>
>> On Tue, Feb 19, 2008 at 9:50 AM, Andy Farnell
>> <padawa...@obiwannabe.co.uk> wrote:
>> >
>> >
>> >  Hi Jacob
>> >
>> >  Connects to jack server ok. Reports good connection. Can start and stop
>> >  transport.
>> >
>> >  But;
>> >
>> >  No transport notification message printed by jackd
>> >  Query doesn't work, no data on outlets
>> >
>> >  Haven't had time to debug yet, could be something my end.
>> >
>> >  a.
>> >
>> >
>> >
>> >
>> >  On Sun, 17 Feb 2008 19:51:27 -0600
>> >  "Jacob Lee" <artd...@gmail.com> wrote:
>> >
>> >  > I've added some code to the jack_transport external
>> >  > (tb/jack_transport/ in pd-extended) to show the current bar/beat (and
>> >  > also bpm and tempo) in real time. Messages are only sent out when pd
>> >  > is computing audio, and also no more than once per beat (to avoid
>> >  > floods of messages).
>> >  >
>> >  > I'm not outputting all the available information from the jack
>> >  > transport -- e.g. the current tick within the beat -- either because
>> >  > it updates too quickly or because it's just not useful to me, but it
>> >  > would be trivial to add those.
>> >  >
>> >  > The motivation here is that I'm using klick --
>> >  > http://das.nasophon.de/klick/ -- as the jack transport master (mainly
>> >  > to control sooperlooper), and now it is possible to trigger events
>> >  > within pd at particular beats or bar numbers.
>> >  >
>> >  > The code is available at
>> >  > http://artdent.homelinux.net/svn/jack_transport~/ . The makefile
>> >  > should be suitable for building jack_transport~ from inside a
>> >  > directory that is sibling to the existing jack_transport. I've only
>> >  > tested it on Linux, but it should work anywhere jack_transport does.
>> >  >
>> >  > I hope this external is useful to others. Suggestions for improvements
>> >  > are of course welcome.
>> >  >
>> >  > --
>> >  > Jacob Lee
>> >  > artd...@gmail.com
>> >  >
>> >  > _______________________________________________
>> >  > PD-list@iem.at mailing list
>> >  > UNSUBSCRIBE and account-management -> 
>> > http://lists.puredata.info/listinfo/pd-list
>> >
>> >
>> >  --
>> >  Use the source
>> >
>> >  _______________________________________________
>> >  pd-l...@iem.at mailing list
>> >  UNSUBSCRIBE and account-management -> 
>> > http://lists.puredata.info/listinfo/pd-list
>> >
>>
>>
>>
>> --
>> Jacob Lee
>> artd...@gmail.com
>>
>> _______________________________________________
>> PD-list@iem.at mailing list
>> UNSUBSCRIBE and account-management -> 
>> http://lists.puredata.info/listinfo/pd-list
>
>
> --
> Use the source
>
> _______________________________________________
> PD-list@iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> http://lists.puredata.info/listinfo/pd-list
>
--- jack_transport~-orig.c	2009-05-27 12:29:43.000000000 -0700
+++ jack_transport~.c	2009-05-27 15:55:19.000000000 -0700
@@ -49,7 +49,7 @@
 static void jack_transport_connect(jack_transport_tilde_t * x)
 {
 	x->x_jack_client = jack_client_open("pure_data_jack_transport",
-					    JackNullOption, NULL);
+					    JackNoStartServer, NULL);
 	if (!x->x_jack_client) {
 		post("jack_transport~: can't connect to jack server");
 		return;
@@ -103,6 +103,14 @@
 	jack_transport_stop(x->x_jack_client);
 }
 
+static void jack_transport_locater(jack_transport_tilde_t * x, t_floatarg f)
+{
+	if (!x->x_jack_client)
+		return;
+
+	jack_transport_locate(x->x_jack_client, (jack_nframes_t)f);
+}
+
 t_int *jack_transport_tilde_perform(t_int *w)
 {
 	jack_transport_tilde_t *x = (jack_transport_tilde_t *)(w[1]);
@@ -195,6 +203,9 @@
 	                (t_method)jack_transport_stopper,
 	                gensym("stop"), 0, 0);
 	class_addmethod(jack_transport_tilde_class,
+	                (t_method)jack_transport_locater,
+	                gensym("locate"), A_DEFFLOAT, 0);
+	class_addmethod(jack_transport_tilde_class,
 	                (t_method)jack_transport_tilde_dsp,
 	                gensym("dsp"), 0, 0);
 	class_addbang(jack_transport_tilde_class,

Attachment: jack_transport~-help.pd
Description: application/puredata

_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to