Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: ki.ber.kom.uni.st <ki.ber@kom.uni.st>
To: ALSA development <alsa-devel@alsa-project.org>
Subject: Re: problems howto send simple 'noteon' event with pyalsa...
Date: Fri, 14 Mar 2008 00:24:36 +0100	[thread overview]
Message-ID: <95e4e4ce0803131624u811b22cs6f957919d3ade26@mail.gmail.com> (raw)
In-Reply-To: <17eedd8a0803131107n5721d467r3a73e0d3d688e0c8@mail.gmail.com>

i'm happy that gnu world exists ;) aldrin thanx to remind me on that
once again...

On 3/13/08, Aldrin Martoq <amartoq@dcc.uchile.cl> wrote:
> You can send NOTEON events without a queue, but you cannot send NOTE
>  events without a queue. (subtle difference: note_ON_)

clear enough...

>  The following code will work;

worked as charm... many thanx...

> AFAIK, You don't need a port if you are sending events directly.

you are right.. i can send events directly... in my particular case i
like to have ports so i can connect them with other midi ports through
qjackctl or some other graphical app...

>  Now, if you subscribe and connect ports, you don't need to assign them
>  into the event, because a new event is created with
>  snd_seq_ev_set_subs called..

i don't get this one.. what i tried till know is to create in/out
ports (it works...) and then connect them with some existing ones
using seq.connect_ports.. then if i use seq.output_event(event)
drain_output() works fine... i don't get what 'ports assigning into
the event' would be?

>  You can check this and other stuff with the following code:

once more many thanx.. this was very helpful for me.. i'll keep using
pyalsa and i start to call myself happy user of pyalsa from now on ;)

>  I'm planning to move event.set_data() to attributes, like
>  event.note_note, event.note_velocity ... Tell me what you think!

that seems to me more clear and more consistent with event.dest and
probably some other stuff... also it looks more pythonic i would
say... even set_data() is easy to use too..

i use a lot ipython interactive shell so attributes are shown as
result of auto completion + if you would put """documentation
strings""" it will also come out with basic documentation of what is
it for and how to use it...

> Well, that's what asoundlib says... weird, don't you think?

i was pissed but as usually being the lamest in programming i had no
one but myself to blame ;)

> Remember: python is far away of real-time so if you get weirds timings
>  you may reconsider using a queue anyway!

my pyalsa piece of code is part of handling gamepad events in pyqt4
loop so i thought to send events as soon as i get them from
/dev/input/js0 should be handled without any queue and trying to send
them directly.. am i right in this particular set up?

i'll try to get into queues in the later phase of my development...

      reply	other threads:[~2008-03-13 23:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 11:58 problems howto send simple 'noteon' event with pyalsa ki.ber.kom.uni.st
2008-03-13 12:34 ` Jaroslav Kysela
2008-03-13 18:07   ` Aldrin Martoq
2008-03-13 23:24     ` ki.ber.kom.uni.st [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95e4e4ce0803131624u811b22cs6f957919d3ade26@mail.gmail.com \
    --to=ki.ber@kom.uni.st \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox