Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-10 Thread Jay R. Ashworth
On Mon, Apr 10, 2006 at 11:35:30PM +0100, Kelvin Lawson wrote:
> >>I'd need to rewrite it in C but it should translate fairly easily, 
> >>especially given what we now know about CD+G.
> >
> >Which, presumably, is more than you did before the first cut.  :-)
> 
> Yeah, it was easy enough to knock something up that worked on my small 
> collection of tracks, but since then I've had a few people (you 
> included) send me CD+Gs that interpreted the spec differently. It's been 
> all quiet for some time now, so it must be perfect .

/me swings

:-)

> >Hmmm... Is there a standardized way to get raw tracks off a Redbook CD
> >in Linux?  Doesn't XMMS do some of this?
> 
> Pass. When I wrote cdgtools, the only useful tool I could find for 
> reading subchannel data was cdrdao. We can presumably package up ATAPI 
> commands and pass them to the relevant Linux driver, but cdrdao might 
> take away the pain of handling a range of drives with different 
> supported commands etc.

Yeah; I've been hearing you imply that the CDRDAO people abstracted
their stuff into a library; I hadn't realized that.

> >>rip just the CD+G data without any MP3 encoding. You can then play this 
> >>back as usual with pycdg.py while the CD track plays. Should be 
> >>relatively quick to implement but you pay the price of the time spent 
> >>doing the rip before playback.
> >
> >Could you sync it, though?
> 
> Well there's the new "no audio" option in pycdg. This uses the system 
> clock to play the CD+G in real time. It would need to know if you had 
> paused or rewound etc, but it could probably do the job. You can also 
> poll the pygame CD playback to find out the current playtime but it's 
> only one second accuracy.

Hmmm.  Maybe we're better off where we are.  :-)

Cheers,
-- jra
-- 
Jay R. Ashworth[EMAIL PROTECTED]
Designer  Baylink RFC 2100
Ashworth & AssociatesThe Things I Think'87 e24
St Petersburg FL USA  http://baylink.pitas.com +1 727 647 1274

 A: Because it messes up the order in which people normally read text.
 Q: Why is top-posting such a bad thing? 
 
 A: Top-posting.
 Q: What is the most annoying thing on Usenet and in e-mail?


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss


Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-10 Thread Kelvin Lawson
I'd need to rewrite it in C but it should translate fairly easily, 
especially given what we now know about CD+G.


Which, presumably, is more than you did before the first cut.  :-)


Yeah, it was easy enough to knock something up that worked on my small 
collection of tracks, but since then I've had a few people (you 
included) send me CD+Gs that interpreted the spec differently. It's been 
all quiet for some time now, so it must be perfect .



Hmmm... Is there a standardized way to get raw tracks off a Redbook CD
in Linux?  Doesn't XMMS do some of this?


Pass. When I wrote cdgtools, the only useful tool I could find for 
reading subchannel data was cdrdao. We can presumably package up ATAPI 
commands and pass them to the relevant Linux driver, but cdrdao might 
take away the pain of handling a range of drives with different 
supported commands etc.


rip just the CD+G data without any MP3 encoding. You can then play this 
back as usual with pycdg.py while the CD track plays. Should be 
relatively quick to implement but you pay the price of the time spent 
doing the rip before playback.


Could you sync it, though?


Well there's the new "no audio" option in pycdg. This uses the system 
clock to play the CD+G in real time. It would need to know if you had 
paused or rewound etc, but it could probably do the job. You can also 
poll the pygame CD playback to find out the current playtime but it's 
only one second accuracy.


Cheers,
Kelvin.


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss


Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-10 Thread Jay R. Ashworth
On Mon, Apr 10, 2006 at 09:34:00PM +0100, Kelvin Lawson wrote:
[ I said: ]
> >Here's a curious idea: I wonder how hard it would be to recast Kelvin's
> >rendering code as an Mplayer codec?  Did we already talk about this?
> 
> I've fancied doing this for some time but haven't got round to it yet. 
> Making an mplayer/ffmpeg codec would give you CD+G for free with a whole 
> bunch of video players, as well as those commercial DVD players and 
> other devices that use ffmpeg.

Good point; I hadn't thought about shoving it down the extra layer.

Removing all the SDL glue would probably make my integration work
easier, too...

> I'd need to rewrite it in C but it should translate fairly easily, 
> especially given what we now know about CD+G.

Which, presumably, is more than you did before the first cut.  :-)

> >In fact the only missing piece apart from digital mixing is a lack of
> >straight-from-CD CD+G player, which is something I'm interested in
> >doing anyway, and I think Python can do it. Any hints or thoughts,
> >Kelvin?
> 
> I've given it some consideration in the past but not in great detail. 
> Pygame can play audio tracks on a CD but (unsurprisingly) there is no 
> facility to read the subchannel data.

Hmmm... Is there a standardized way to get raw tracks off a Redbook CD
in Linux?  Doesn't XMMS do some of this?

> Initial thoughts on the simplest thing to implement would be to combine 
> a cdrdao/cdgrip pass with pygame's CD playback. It's just a hack but it 
> buys you something. After selecting a track, you spawn off a process to 
> rip just the CD+G data without any MP3 encoding. You can then play this 
> back as usual with pycdg.py while the CD track plays. Should be 
> relatively quick to implement but you pay the price of the time spent 
> doing the rip before playback.

Could you sync it, though?

> Doing it *properly*.. that's a different thing. I don't know, for 
> instance, what the usual method would be for extracting the subchannel 
> data on Linux. Whether you'd need to use a library like cdrdao, or 
> whether it's just as easy to get what you need straight from the OS. I'm 
> thinking something like Python bindings for cdrdao to read the 
> subchannel data - and if you're doing this in real time then presumably 
> you'd want to read the audio data at the same time, rather than have two 
> proceses seeking around the disk. I'd need a deeper look into the likes 
> of cdrdao to comment any further than that.

That sounds like a higher-difficulty task than the first one.  :-)

> >The link is Coral Cache-ified by the way because I'm expecting heavy
> >traffic in a few days; a not-so-friendly company is threatening to sue
> >me because I posted my experience with them on my site, and
> >negotiations broke down recently. I went public with the details, and
> >Tom Martino (the "Troubleshooter") is going to have me on his radio
> >program Monday to hash this stuff out. Heh. This should get
> >interesting fast :)
> 
> Itching to hear how this pans out.



Cheers,
-- jra
-- 
Jay R. Ashworth[EMAIL PROTECTED]
Designer  Baylink RFC 2100
Ashworth & AssociatesThe Things I Think'87 e24
St Petersburg FL USA  http://baylink.pitas.com +1 727 647 1274

 A: Because it messes up the order in which people normally read text.
 Q: Why is top-posting such a bad thing? 
 
 A: Top-posting.
 Q: What is the most annoying thing on Usenet and in e-mail?


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss


Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-10 Thread Kelvin Lawson

In fact the only missing piece apart from digital mixing is a lack of
straight-from-CD CD+G player, which is something I'm interested in
doing anyway, and I think Python can do it. Any hints or thoughts,
Kelvin?


I've given it some consideration in the past but not in great detail. 
Pygame can play audio tracks on a CD but (unsurprisingly) there is no 
facility to read the subchannel data.


Initial thoughts on the simplest thing to implement would be to combine 
a cdrdao/cdgrip pass with pygame's CD playback. It's just a hack but it 
buys you something. After selecting a track, you spawn off a process to 
rip just the CD+G data without any MP3 encoding. You can then play this 
back as usual with pycdg.py while the CD track plays. Should be 
relatively quick to implement but you pay the price of the time spent 
doing the rip before playback.


Doing it *properly*.. that's a different thing. I don't know, for 
instance, what the usual method would be for extracting the subchannel 
data on Linux. Whether you'd need to use a library like cdrdao, or 
whether it's just as easy to get what you need straight from the OS. I'm 
thinking something like Python bindings for cdrdao to read the 
subchannel data - and if you're doing this in real time then presumably 
you'd want to read the audio data at the same time, rather than have two 
proceses seeking around the disk. I'd need a deeper look into the likes 
of cdrdao to comment any further than that.



The link is Coral Cache-ified by the way because I'm expecting heavy
traffic in a few days; a not-so-friendly company is threatening to sue
me because I posted my experience with them on my site, and
negotiations broke down recently. I went public with the details, and
Tom Martino (the "Troubleshooter") is going to have me on his radio
program Monday to hash this stuff out. Heh. This should get
interesting fast :)


Itching to hear how this pans out.

Kelvin.


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss


Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-10 Thread Kelvin Lawson

Here's a curious idea: I wonder how hard it would be to recast Kelvin's
rendering code as an Mplayer codec?  Did we already talk about this?


I've fancied doing this for some time but haven't got round to it yet. 
Making an mplayer/ffmpeg codec would give you CD+G for free with a whole 
bunch of video players, as well as those commercial DVD players and 
other devices that use ffmpeg.


I'd need to rewrite it in C but it should translate fairly easily, 
especially given what we now know about CD+G.


Kelvin.


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss


Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-10 Thread Kelvin Lawson

PyKaraoke doesn't currently support pitch-shifting natively during
song playback, and this is about the only missing feature that
prevents PyKaraoke from being a complete digital replacement for the
traditional analog CD+G player.


Thanks Will, excellent HOWTO. Will put a link on the PyKaraoke web site.

Kelvin.


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss


Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-10 Thread Jay R. Ashworth
On Sat, Apr 08, 2006 at 11:19:22AM -0600, William Ferrell wrote:
> > [ lost address; pressed for time; please reply back onto list? ]
> 
> Not a problem :) I've done that before ;)

Tnx.

> > On Fri, Apr 07, 2006 at 08:06:06PM -0600, William Ferrell wrote:
> > > On 4/7/06, Jay R. Ashworth <[EMAIL PROTECTED]> wrote:
> > > > On Fri, Apr 07, 2006 at 12:29:58PM -0600, William Ferrell wrote:
> > > > > This HOWTO attempts to document how the whole thing fits together, how
> > > > > to implement it on your own system, and how to use it in production at
> > > > > a karaoke (or really any DJ'ed) show.
> > > >
> > > > This is really spiffy.  I'm not sure how easily I'm going to be able to
> > > > integrate it with the control-top I want to construct (which I've
> > > > finally, at least, sketched out, and am trying to learn Glade to mock
> > > > up), but...
> > >
> > > Yeah, I'm still trying to get some of the interface elements down
> > > better. It's usable right now thanks to Enlightenment but it could
> > > definitely be better.
> >
> > I will Try Really Hard to get a mock up of my design into a format you
> > can look at, this week.
> 
> Excellent, thank you!

Even if I have to do it in CorelDraw.  :-)

Are there any good interface mockup programs?

> > > > Specifically, it can talk to my Phase 26 USB box, with 3 stereo outputs
> > > > (I'm very much a "real mixing board" kind of guy).
> > >
> > > Ooooh, spiffy :) I likey :)
> >
> > Terratec, specifically.  Has a simultaneous input as well, with a mic
> > pre.
> 
> I need to dig around and find one of these; this takes me a step
> closer to an all-digital show.

I got mine from J&B on eBay; $150, I think.

> > > The site claims it can be controlled via the ALSA sequencer, though,
> > > so it looks like it's possible.
> >
> > Ok.  In my case, again, it's because I want the control surface to be
> > all-encompassing; I'm planning on a 17" touchscreen (with a
> > micro-keyboard for entering search terms, optionally -- you could do it
> > with a popup keyboard).
> 
> [droolification]

You've been watching Wicked too much... :-)

> > > > And, BTW; kudos on the site; blogging with MW isn't easy.
> > >
> > > Thanks, and you're right, it's a pain in the ass. I had to modify code
> > > to make that work. I'm tempted to switch it to Plone instead.
> >
> > I was looking at using Category tags, and a custom extension based on
> > DPL 2, to do it myself.  Cause having each entry be a first-class
> > article is useful as hell.
> 
> http://willfe.com.nyud.net:8080/index.php/My_MediaWiki_Hacks
> 
> Go read that -- it describes what I did to implement exactly what you
> describe. And I hacked DPL2 ;) so that's exactly what you want. I'm
> using Categories to tag things, too, and all entries are first-class
> articles.

Spiffy cool.

> The link is Coral Cache-ified by the way because I'm expecting heavy
> traffic in a few days; a not-so-friendly company is threatening to sue
> me because I posted my experience with them on my site, and
> negotiations broke down recently. I went public with the details, and
> Tom Martino (the "Troubleshooter") is going to have me on his radio
> program Monday to hash this stuff out. Heh. This should get
> interesting fast :)

Can't wait to hear how *that* goes...

Cheers,
-- jra
-- 
Jay R. Ashworth[EMAIL PROTECTED]
Designer  Baylink RFC 2100
Ashworth & AssociatesThe Things I Think'87 e24
St Petersburg FL USA  http://baylink.pitas.com +1 727 647 1274

 A: Because it messes up the order in which people normally read text.
 Q: Why is top-posting such a bad thing? 
 
 A: Top-posting.
 Q: What is the most annoying thing on Usenet and in e-mail?


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss


Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-08 Thread William Ferrell
On 4/8/06, Jay R. Ashworth <[EMAIL PROTECTED]> wrote:
> [ lost address; pressed for time; please reply back onto list? ]

Not a problem :) I've done that before ;)

> On Fri, Apr 07, 2006 at 08:06:06PM -0600, William Ferrell wrote:
> > On 4/7/06, Jay R. Ashworth <[EMAIL PROTECTED]> wrote:
> > > On Fri, Apr 07, 2006 at 12:29:58PM -0600, William Ferrell wrote:
> > > > This HOWTO attempts to document how the whole thing fits together, how
> > > > to implement it on your own system, and how to use it in production at
> > > > a karaoke (or really any DJ'ed) show.
> > >
> > > This is really spiffy.  I'm not sure how easily I'm going to be able to
> > > integrate it with the control-top I want to construct (which I've
> > > finally, at least, sketched out, and am trying to learn Glade to mock
> > > up), but...
> >
> > Yeah, I'm still trying to get some of the interface elements down
> > better. It's usable right now thanks to Enlightenment but it could
> > definitely be better.
>
> I will Try Really Hard to get a mock up of my design into a format you
> can look at, this week.

Excellent, thank you!

> > > Specifically, it can talk to my Phase 26 USB box, with 3 stereo outputs
> > > (I'm very much a "real mixing board" kind of guy).
> >
> > Ooooh, spiffy :) I likey :)
>
> Terratec, specifically.  Has a simultaneous input as well, with a mic
> pre.

I need to dig around and find one of these; this takes me a step
closer to an all-digital show.

In fact the only missing piece apart from digital mixing is a lack of
straight-from-CD CD+G player, which is something I'm interested in
doing anyway, and I think Python can do it. Any hints or thoughts,
Kelvin?

> > The site claims it can be controlled via the ALSA sequencer, though,
> > so it looks like it's possible.
>
> Ok.  In my case, again, it's because I want the control surface to be
> all-encompassing; I'm planning on a 17" touchscreen (with a
> micro-keyboard for entering search terms, optionally -- you could do it
> with a popup keyboard).

[droolification]

> > > And, BTW; kudos on the site; blogging with MW isn't easy.
> >
> > Thanks, and you're right, it's a pain in the ass. I had to modify code
> > to make that work. I'm tempted to switch it to Plone instead.
>
> I was looking at using Category tags, and a custom extension based on
> DPL 2, to do it myself.  Cause having each entry be a first-class
> article is useful as hell.

http://willfe.com.nyud.net:8080/index.php/My_MediaWiki_Hacks

Go read that -- it describes what I did to implement exactly what you
describe. And I hacked DPL2 ;) so that's exactly what you want. I'm
using Categories to tag things, too, and all entries are first-class
articles.

Hehehe.

The link is Coral Cache-ified by the way because I'm expecting heavy
traffic in a few days; a not-so-friendly company is threatening to sue
me because I posted my experience with them on my site, and
negotiations broke down recently. I went public with the details, and
Tom Martino (the "Troubleshooter") is going to have me on his radio
program Monday to hash this stuff out. Heh. This should get
interesting fast :)

--
Looking for something to read? Visit http://willfe.com/ ... it's easy,
safe, and fun for the whole family!


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
___
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss


Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-07 Thread William Ferrell
On 4/7/06, Jay R. Ashworth <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 07, 2006 at 12:29:58PM -0600, William Ferrell wrote:
> > This HOWTO attempts to document how the whole thing fits together, how
> > to implement it on your own system, and how to use it in production at
> > a karaoke (or really any DJ'ed) show.
>
> This is really spiffy.  I'm not sure how easily I'm going to be able to
> integrate it with the control-top I want to construct (which I've
> finally, at least, sketched out, and am trying to learn Glade to mock
> up), but...

Yeah, I'm still trying to get some of the interface elements down
better. It's usable right now thanks to Enlightenment but it could
definitely be better.

> > The JACK Audio Connection Kit is a real-time virtual mixing board for
> > Linux (and possibly other platforms; I haven't yet investigated this)
>
> I understand JACK has been ported successfully to OS/X now, which
> probably isn't too surprising.

Yeah, that's spiffy. I haven't got a Mac to test it with though :(

> > that uses a low-latency server and protocol to connect sound
> > applications and devices to each other. It can control all sorts of
> > real hardware (sound cards, MIDI controllers, etc.) and can accept
> > inputs from just about anything (media players, MIDI controllers,
> > etc.) for both audio and control.
>
> Specifically, it can talk to my Phase 26 USB box, with 3 stereo outputs
> (I'm very much a "real mixing board" kind of guy).

Ooooh, spiffy :) I likey :)

> > JACK includes a useful tool, qjackctl, that will be used in this HOWTO
> > to configure JACK and to automate patching our different tools
> > together.
>
> You do *not* want to try to play with JACK without qj; take my word on
> this.

Oh I learned that the hard way :)

> > This HOWTO uses JACK Rack for two things: first, it is used to perform
> > the actual pitch-shifting work when needed (audio from PyKaraoke is
> > passed to JACK Rack instead of straight ot the sound card). Second, it
> > performs crossfading work; I use different audio sources
> > (specifically, XMMS and MPlayer) during my shows, and smoothly
> > transitioning from them to CD+G music and back is important. JACK Rack
> > is, in this configuration, the only piece of software on the chain
> > that is connected to the sound card. All audio playback runs through
> > JACK Rack whether it is doing anything to the sound or not.
>
> Can JR, or the modules it encases, be controlled by DBus (or any other
> message passing facility)?

I don't know yet; I need to test some more things. I sure hope it can
-- I'd love to be able to control the crossfader with a real slider,
for example.

The site claims it can be controlled via the ALSA sequencer, though,
so it looks like it's possible.

> > It supports MP3, Ogg Vorbis, WAV, FLAC, and all sorts of other audio
> > formats. It can play video (via MPlayer, actually), but we want manual
> > control over that kind of thing so we'll only be using XMMS for audio.
>
> Mplayer is sort of ungainly for playing audio directly, isn't it?

Absolutely; I only play videos with it. It overlays the normal display
while it plays.

> > MPlayer is a multimedia player for Linux. It supports audio and video
> > playback, tons of media formats, lots of output devices and types, and
> > has more features than I can adequately count here.
>
> Here's a curious idea: I wonder how hard it would be to recast Kelvin's
> rendering code as an Mplayer codec?  Did we already talk about this?

Hmmm... that'd be interesting; Mplayer is good at dealing with
scaling. We could just feed it the unscaled bitmap and let it handle
scaling.

> > For our purposes, we'll simply be chaining it to JACK as an audio
> > source (letting it do its own thing for video, if needed) so we can
> > crossfade between it and the filler music XMMS provides.
>
> How *are* you deconflicting video output sources, anyway?

Mplayer uses SDL for video *and* audio on this machine since OpenGL
and XV support broke a few months ago (the bastards :).

I don't run Mplayer and PyKaraoke simultaneously, though they can do
so without breaking. The Patchbay thing figures it out properly.

> Note: SuSE, in particular, tends to have an out of date JACK; I
> wouldn't be surprised to find that other distros do as well -- Will?
> Could you document the version numbers of all your components?

Absolutely, I'll update the writeup tonight or tomorrow with numbers.

> This is *nice* detail, Will.

Thanks :)

> > 2.2. Setting Up the Sound Processor (JACK Rack)
> >
> > Start up JACK Rack (the command is "jack-rack"). It will start with an
> > empty effects stack, which is what we want.
>
> Do you mention where is the best place to start all this stuff?
> .profile for the login account?  /etc/rc.*?

Heh. Crap. I totally forgot to include my script that initializes
everything for me. I'll include that with the version number update.

> > PyKaraoke needs no modifications because it uses SDL, which honors
> > .asoundrc. 

Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-07 Thread Jay R. Ashworth
On Fri, Apr 07, 2006 at 12:29:58PM -0600, William Ferrell wrote:
> This HOWTO attempts to document how the whole thing fits together, how
> to implement it on your own system, and how to use it in production at
> a karaoke (or really any DJ'ed) show.

This is really spiffy.  I'm not sure how easily I'm going to be able to
integrate it with the control-top I want to construct (which I've
finally, at least, sketched out, and am trying to learn Glade to mock
up), but...

> The JACK Audio Connection Kit is a real-time virtual mixing board for
> Linux (and possibly other platforms; I haven't yet investigated this)

I understand JACK has been ported successfully to OS/X now, which
probably isn't too surprising.

> that uses a low-latency server and protocol to connect sound
> applications and devices to each other. It can control all sorts of
> real hardware (sound cards, MIDI controllers, etc.) and can accept
> inputs from just about anything (media players, MIDI controllers,
> etc.) for both audio and control.

Specifically, it can talk to my Phase 26 USB box, with 3 stereo outputs
(I'm very much a "real mixing board" kind of guy).

> JACK includes a useful tool, qjackctl, that will be used in this HOWTO
> to configure JACK and to automate patching our different tools
> together.

You do *not* want to try to play with JACK without qj; take my word on
this.

> This HOWTO uses JACK Rack for two things: first, it is used to perform
> the actual pitch-shifting work when needed (audio from PyKaraoke is
> passed to JACK Rack instead of straight ot the sound card). Second, it
> performs crossfading work; I use different audio sources
> (specifically, XMMS and MPlayer) during my shows, and smoothly
> transitioning from them to CD+G music and back is important. JACK Rack
> is, in this configuration, the only piece of software on the chain
> that is connected to the sound card. All audio playback runs through
> JACK Rack whether it is doing anything to the sound or not.

Can JR, or the modules it encases, be controlled by DBus (or any other
message passing facility)?

> It supports MP3, Ogg Vorbis, WAV, FLAC, and all sorts of other audio
> formats. It can play video (via MPlayer, actually), but we want manual
> control over that kind of thing so we'll only be using XMMS for audio.

Mplayer is sort of ungainly for playing audio directly, isn't it?

> MPlayer is a multimedia player for Linux. It supports audio and video
> playback, tons of media formats, lots of output devices and types, and
> has more features than I can adequately count here.

Here's a curious idea: I wonder how hard it would be to recast Kelvin's
rendering code as an Mplayer codec?  Did we already talk about this?

> For our purposes, we'll simply be chaining it to JACK as an audio
> source (letting it do its own thing for video, if needed) so we can
> crossfade between it and the filler music XMMS provides.

How *are* you deconflicting video output sources, anyway?

> 1.5 Tom's Audio Processing LADSPA Plugins
> 
> http://tap-plugins.sourceforge.net/
> 
> This set of plugins, compatible with JACK Rack, includes the one we
> want: pitch shifting. This is what will provide us with digital
> pitch-shifting for CD+G playback. Really, it can affect all sound, but
> we just want it to affect CD+G.

Ah; it's TAP that's doing it.

> 2. Setting Up the Parts
> 
> It's beyond the scope of this HOWTO to document the
> installation/configuration procedure for the software used; if you're
> using a modern Linux distribution (like Debian, Ubuntu, or Gentoo),
> its package management system should already have these packages
> available.

Note: SuSE, in particular, tends to have an out of date JACK; I
wouldn't be surprised to find that other distros do as well -- Will?
Could you document the version numbers of all your components?

> 2.1. Configuring ALSA to Talk to JACK
> 
> By default, ALSA just talks to your real sound device. We want it to
> default to connecting to JACK instead, though, so it's necessary to
> create a .asoundrc file. It belongs in the home directory of the
> account you're using for production shows. Just edit ~/.asoundrc and
> you should be fine. Its contents should be:
> 
> pcm.!default {
> type plug
> slave { pcm "jack" }
> }
> 
> pcm.jack {
> type jack
> playback_ports {
> 0 alsa_pcm:playback_1
> 1 alsa_pcm:playback_2
> }
> capture_ports {
> 0 alsa_pcm:capture_1
> 1 alsa_pcm:capture_2
> }
> }
> 
> Test that this is working properly by starting JACK (run qjackctl and
> start a JACK server), then watch the "Connections" bay as you run
> "aplay somefile.mp3" -- you should see a new client appear, and it
> will probably automatically connect to the sound card (this is JACK's
> default behavior).

This is *nice* detail, Will.

> 2.2. Setting Up the Sound Processor (JACK Rack)
> 
> Start up JACK Rack (the command is "jack-rack"). It will start with an
> empty effects stack, which is what w

[Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK

2006-04-07 Thread William Ferrell
PyKaraoke doesn't currently support pitch-shifting natively during
song playback, and this is about the only missing feature that
prevents PyKaraoke from being a complete digital replacement for the
traditional analog CD+G player.

This is the case because PyKaraoke relies on Pygame's MP3/Ogg/WAV
playback engine, which does not (currently) provide any means of
applying effects filters to the sound before it hits the sound device.
It would be possible to replace this with our own threaded MP3/Ogg/WAV
player, and use libsoundtouch to perform pitch-shifting (it is a very
high quality, faster-than-realtime pitch shifter and time
compressor/expander), but that's a significant undertaking. There are
no Python bindings for libsoundtouch, so using it would mean mucking
with SWIG, which has always given me fits.

On Linux at least, there is an alternative solution that ultimately
provides more flexibility anyway in building a sound layer that
permits all sorts of cool sound effect possibilities.

This HOWTO attempts to document how the whole thing fits together, how
to implement it on your own system, and how to use it in production at
a karaoke (or really any DJ'ed) show.

1. The Architecture.

The system we'll be building uses JACK to connect different sound
applications together and to the machine's sound card. PyKaraoke will
provide the CD+G audio source that we'll be applying pitch-shifting
effects to. XMMS will provide filler audio in this example, simply
because it has a JACK output driver and is easy to work with. It also
has a high-quality crossfader plugin that produces outstanding audio
results. JACK Rack, with Tom's Audio Processing LADSPA plugins
providing pitch-shifting. As an added bonus, I'll demonstrate how to
get MPlayer into the mix as well, to provide multimedia clips at shows
where a television or projector is available.

1.1 JACK

http://jackit.sourceforge.net/

The JACK Audio Connection Kit is a real-time virtual mixing board for
Linux (and possibly other platforms; I haven't yet investigated this)
that uses a low-latency server and protocol to connect sound
applications and devices to each other. It can control all sorts of
real hardware (sound cards, MIDI controllers, etc.) and can accept
inputs from just about anything (media players, MIDI controllers,
etc.) for both audio and control.

It can make use of a stock Linux kernel, or one that has been
configured with preempting and real-time features to ensure no pops or
gaps in audio playback even when many different tools are in active
use on the chain.

JACK includes a useful tool, qjackctl, that will be used in this HOWTO
to configure JACK and to automate patching our different tools
together.

1.2 JACK Rack

http://jack-rack.sourceforge.net/

JACK Rack is a sound processor designed for use with JACK exclusively;
it presents a configurable number of "default" channels to JACK and
can load effects modules (like "echo," "pitch shift," "reverb," etc.)
in any order. Sound flows through the modules top-to-bottom as they're
shown in the interface. Modules can be enabled or disabled (when
disabled, they do nothing to the sound; it simply flows through them
to the next module), and moved up and down in the stack.

This HOWTO uses JACK Rack for two things: first, it is used to perform
the actual pitch-shifting work when needed (audio from PyKaraoke is
passed to JACK Rack instead of straight ot the sound card). Second, it
performs crossfading work; I use different audio sources
(specifically, XMMS and MPlayer) during my shows, and smoothly
transitioning from them to CD+G music and back is important. JACK Rack
is, in this configuration, the only piece of software on the chain
that is connected to the sound card. All audio playback runs through
JACK Rack whether it is doing anything to the sound or not.

1.3 XMMS

http://www.xmms.org/

XMMS is a multimedia player for Linux. It is an older piece of
software (not actively maintained anymore; its developers are focusing
on a new 2.0 release), but assuming it'll start up and run on your
system, it's very reliable and useful for this purpose.

It supports MP3, Ogg Vorbis, WAV, FLAC, and all sorts of other audio
formats. It can play video (via MPlayer, actually), but we want manual
control over that kind of thing so we'll only be using XMMS for audio.

XMMS' plugin system means we can get automated crossfading between
songs XMMS plays *and* connect the whole thing to JACK as just another
audio source.

1.4 MPlayer

http://www.mplayerhq.hu/

MPlayer is a multimedia player for Linux. It supports audio and video
playback, tons of media formats, lots of output devices and types, and
has more features than I can adequately count here.

For our purposes, we'll simply be chaining it to JACK as an audio
source (letting it do its own thing for video, if needed) so we can
crossfade between it and the filler music XMMS provides.

1.5 Tom's Audio Processing LADSPA Plugins

http://tap-plugins.sourceforge.net/

This set