Re: [LAD] Finding ALSA sequencer client/port numbers

2011-04-22 Thread Dominic Sacré
On Friday 22 April 2011 22:45:34 Fons Adriaensen wrote:
 after reading ASLA docs for some hours I've not found an
 answer to the following:
 
 Given the ALSA sequencer client and port _names_, find the
 numbers required to set up a connection (a 'subscription'
 in ALSA lingo).

ALSA client and port names are not required to be unique.

I think the best you can do is query all clients and their ports 
(snd_seq_query_next_client() etc.) until you find one with the name 
you're looking for, and then just hope you got the right one...

By the way, aconnect seems to do the same (badly).


Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Python assistance - threads (my favorite)

2010-10-15 Thread Dominic Sacré
On Fri, Oct 15, 2010 at 12:04 AM, Patrick Shirkey
pshir...@boosthardware.com wrote:
 In a bit of a time crunch. Can anyone tell me how to do this properly?

 I would like to have a threaded timer to run cmd after 5 seconds.
 However cmd is normally triggered like this:

 os.system(cmd)

 But there seems to be an issue with calling os.system(cmd) from
 subprocess.popen.

 ...
 t = threading.Timer(5.0, self.do_popen(cmd))

This line seems to be your problem. You need to give threading.Timer
the function to be called, but instead your *calling* do_popen
immediately. After five seconds the timer then tries to call the
return value of do_popen, which is None.

One possible solution would be:
t = threading.Timer(5.0, functools.partial(self.do_popen, cmd))


Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] detention :)

2010-07-28 Thread Dominic Sacré
2010/7/28 Jörn Nettingsmeier netti...@folkwang-hochschule.de:
 On 07/27/2010 10:45 PM, f...@kokkinizita.net wrote:
 Real detents require force feedback. A mouse doesn't
 provide that. This GTK thing is completely broken.

 i wonder how you'd do it on a computer touchpad? little electric shocks,
 maybe?

Something like that, probably. This seems interesting:
http://www.youtube.com/watch?v=jXITjLurof0

But I won't believe that it works as well as they claim until I've
tried it with my own fingertips...


Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] qjackctl server name

2010-06-16 Thread Dominic Sacré
On Wednesday 16 June 2010 16:23:05 Rui Nuno Capela wrote:
  Doesn't work as expected. Whan 'Start' fails it seems to
  leave qjackctl in an unusable state. Fixing the cause of
  the failed start doesn't help, the only solution seems to
  be to terminate and restrart qjackctl itself.
 
 what you mean by unusable state? does it hang? crash? can't 'Start'
 again? what's the cause for the start failure? are there any error
 messages? does it help increasing the start delay?

Assuming this is the same issue as Fons':
When I try to start JACK the second time (after resolving whatever the 
problem was), JACK actually starts just fine. I can connect other 
clients to it, but QjackCtl itself fails to connect to the server and 
stays in the Starting state forever. Changing the start delay doesn't 
make any difference.


Dominic

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] [OT] Has anyone managed to compile this?

2010-01-15 Thread Dominic Sacré
On Sat, Jan 16, 2010 at 1:08 AM, Victor Lazzarini
victor.lazzar...@nuim.ie wrote:
 Torben's  new project  brought  back to my mind this mind-bending C++
 template example (see attached), which I could not yet get to compile, I
 have been told it has been compiled, but g++ will have none of it. So I
 still have doubts on whether it includes legal C++ code or not. But it is an
 interesting example (even if it does not build) of what (possibly) can be
 done with templates.

 My question to the list is: has anyone managed to compile this code?

Wow, that's insane. But as far as I can tell, it is (almost) valid
C++. What gcc rightly complains about are a couple of missing typename
keywords. That's actually a pretty common mistake, because it's hard
to understand why these are even necessary, and some compilers simply
don't care.
The attached version of the file compiles fine with gcc, and the
program gives the correct answer.


Dominic
//
// A C++ program to test for the primality of the number 13
//
// It has the curious property that it does no arithmetic
// but uses only the template mechanism and class derivation
// to achieve its result. It starts at the most basic axioms
// of arithmetic starting with the definition of zero and
// its successors...
//
// You'll need a good C++ compiler.
//
// (c) D Piponi (But copy it as much as you like if you credit me)
//

//
// First a little trick to find the base class of our
// classes because the template mechanism requires
// exact matches.
//
// Two values are considered equivalent if they have
// the same baseclass. For example 1+1 isn't
// identical to 2 but 1+1 *is* derived from 2.
//
templatetypename V struct Value { typedef V value; };

//
// Define zero
//
struct zero
   : public Valuezero { };

//
// Define the successor of an integer
//
templatetypename C struct S
   : public ValueSC  { typedef C predecessor; };

//
// Now we have the integers. So introduce some convenience
// types.
//
typedef Szero one;
typedef Sone two;
typedef Stwo three;
typedef Sthree four;
typedef Sfour five;
typedef Sfive six;
typedef Ssix seven;
typedef Sseven eight;
typedef Seight nine;
typedef Snine ten;

//
// Define plus,...
//
templatetypename C,typename D struct plus
  : public SplusC,typename D::predecessor  { };

templatetypename C struct plusC,zero
   : public C { };

//
// ...minus...
//
templatetypename C,typename D struct minus
   : public minusC,typename D::predecessor::predecessor { };

templatetypename C struct minusC,zero
   : public C { };

//
// ...and times.
//
templatetypename C,typename D struct times
   : public plusC,typename timesC,typename D::predecessor::value { };

templatetypename C struct timesC,zero
   : public zero { };

//
// Define the usual ordering on the integers.
//
templatetypename C,typename D struct ge
   : public getypename C::predecessor,typename D::predecessor { };

templatetypename C struct geC,zero
   : public one { };

templatetypename C struct gezero,C
   : public zero { };

template struct gezero,zero
   : public one { };

//
// Divisibility testing
//
templatetypename C,typename D,typename E = SSzero   struct Divisible { };

templatetypename C,typename D struct DivisibleC,D,SSzero  
   : public DivisibleC,D,typename geC,D::value { };

//
// The case CD:
// In this case D divides C iff C is zero.
//
templatetypename C,typename D struct DivisibleC,D,zero
   : public zero { };

templatetypename C struct Divisiblezero,C,zero
   : public one { };

//
// The case C=D:
// D divides C iff D divides C-D.
//
templatetypename C,typename D struct DivisibleC,D,Szero 
   : public Divisibletypename minusC,D::value,D { };

//
// Primality testing
//
templatetypename C,typename D = two,typename S = zero,typename E = zero,typename F =
zero struct Prime { };

//
// We use recursion to set up a loop from 2 to one less
// than the integer we are testing. Essentially this is a state machine
// using template parameters to record the current state.
//

// Are we at the end of the recursion?
//
templatetypename C,typename D struct PrimeC,D,zero,zero,zero
   : public PrimeC,D,one,zero,typename geD,C::value { };

//
// Test potential factor D, trying successor on failure.
//
templatetypename C,typename D struct PrimeC,D,one,zero,zero
   : public PrimeC,SD,zero,typename DivisibleC,D::value,zero { };

//
// Found a factor.
//
templatetypename C,typename D struct PrimeC,D,zero,one,zero
   : public zero { };

//
// Reached the end of the loop without finding divisor.
//
templatetypename C,typename D struct PrimeC,D,one,zero,one
   : public one { };

//
// Convenience method for humans allowing input of
// numbers in decimal format.
//
templatetypename C,typename D struct Decimal
   : public plustypename timesten,C::value,D { };

//
// Unfortunately the I/O interface spoils the purity of it all.
//
#include stdio.h

templatetypename C char const *output(C);

template char const 

Re: [LAD] [ANN] aseqmm 0.2.0 released

2009-12-28 Thread Dominic Sacré
On Monday 28 of December 2009 18:33:10 Pedro Lopez-Cabanillas wrote:
 The ending in mm simply means to me something related to C++. Qt
 uses standard C++ in despite of FUD and propaganda that has been
 spread everywhere by zealots.

I don't care much about Qt being not quite standard C++, and even less 
about the naming (though the mm suffix is somewhat misleading).
The simple fact is that for a project that does not use Qt anyway, it 
makes little to no sense to depend on aseqmm. Which is a pity because it 
seems very useful and well written :/


Cheers,

Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


[LAD] Maximum size of SysEx messages in JACK MIDI and ALSA sequencer

2009-12-12 Thread Dominic Sacré
Hi,

I'm wondering what the size limit is for SysEx messages in the JACK MIDI 
and ALSA sequencer APIs. My observations so far:

In JACK MIDI, a SysEx message can be as large as the MIDI port buffer, 
which in turn has the same size as an audio buffer for one period. This 
is assuming that there are no other events transmitted on the same port 
during the same period.
Is this correct? Or are applications somehow expected to handle larger 
SysEx messages split over multiple periods?

In the documentation of the ALSA sequencer API, I couldn't find any 
mention of an upper limit. Some sources suggest that ALSA splits SysEx 
messages into chunks of 256 bytes, but from my own attempts at sending 
larger messages, it seems the limit is actually somewhere around 5500 
bytes. Unfortunately ALSA doesn't seem to report an error when I try to 
send larger chunks, instead the messages just disappear. Can anyone shed 
some light on how to handle larger SysEx messages correctly?


Thanks,

Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] [LAU] Python and MIDI orientation for a project

2009-08-04 Thread Dominic Sacré
On Monday 03 of August 2009 23:06:34 harryhaa...@gmail.com wrote:
 And on the topic for a second, python bindings exist for MidiDings, a
 module that can use both AlsaSeq  Jack Midi.
 I have a very limited amound of experince with it, as i found the
 AlsaSeq python package to be much simpler to use.

Just to clarify, mididings is primarily intended as a standalone MIDI 
processor. Usually its sole input/output is MIDI, and it just happens to 
use Python for its configuration. It's not really a MIDI API to be used 
in larger Python programs, and I'm pretty sure it completely sucks for 
that purpose.

Now... who's going to finally write proper Python bindings for JACK 
MIDI? :)


Dominic


___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] Problem with g++, please please help me

2008-11-22 Thread Dominic Sacré
On Sunday 23 November 2008 00:39:35 Christian wrote:
  Text text( string _name, string _box, int _x, int _y, int _w, int _h,
  string _shortCut, string _caption );

Copypaste? :) You need to remove the type names here. This is obviously 
intended as a local variable, but to gcc it looks like a function 
declaration. It happily compiles it though, until you try to stuff it into 
a list in the next line...


Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] [somewhat OT] semaphores in python

2008-08-26 Thread Dominic Sacré
On Tuesday 26 August 2008 22:01:18 Fons Adriaensen wrote:
 AFAICS, for this reason, whatever happens in threading
 can't be correct, or at least not pre-emption and SMP
 safe.

Is this really an issue in Python? The Python interpreter is not thread safe 
anyway, there's a global interpreter lock that must be held by any thread 
accessing Python objects.
Depending on what you're trying to do, this might be one of Python's biggest 
disadvantages, but as far as I can see, you don't need to worry about true
concurrency, simply because it can't happen.


Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev


Re: [LAD] Re: Audio over Cat5

2007-10-02 Thread Dominic Sacré
On 10/2/07, Tosif Ahmed [EMAIL PROTECTED] wrote:
 Yes...thts exactly wat my question is, a wrt box which can play songs but
 since it doesn't have speakers i want to use cat5 as the transport media.

Does your WRT have USB ports? The usb-audio driver has been ported to
OpenWRT, so you could use a USB audio interface attached directly to
the WRT.

I haven't tried this myself yet, but sooner or later I think I will.
My router already holds my entire music collection on a USB harddisk
(exported via NFS and samba), so this would seem to be the next
logical step :)

Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-dev


[LAD] [ANN] pyliblo 0.6

2007-05-20 Thread Dominic Sacré
pyliblo is a Python wrapper for the liblo OSC library. It supports almost 
the complete functionality of liblo, allowing you to send and receive OSC 
messages using a nice and simple Python API.

New features in version 0.6:

* added support for bundles and timestamps
* support additional OSC data types (midi, timetag, symbol,
  true/false/nil/infinitum)
* alternative way for registering callback methods, using nifty Python
  decorators

Get it here:
http://das.nasophon.de/pyliblo/


Cheers,
Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-dev


[LAD] [ANN] pyliblo 0.5

2007-04-26 Thread Dominic Sacré
pyliblo is a Python wrapper for the liblo OSC library. It does not yet 
wrap all of liblo's functionality, but includes everything you need to 
send and receive almost any kind of OSC message, using a nice and simple 
Python API. OSC can hardly get any easier :)

Also included are two scripts, send_osc and dump_osc, which are similar to 
the well known sendOSC/dumpOSC programs, but much simpler and less 
cumbersome to install.

Get pyliblo 0.5 here:
http://das.nasophon.de/pyliblo/

Cheers,
Dominic
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-dev