Re: [Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK
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 JB 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=lnkkid=110944bid=241720dat=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
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=lnkkid=110944bid=241720dat=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
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=lnkkid=110944bid=241720dat=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
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. aol 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=lnkkid=110944bid=241720dat=121642 ___ Pykaraoke-discuss mailing list Pykaraoke-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss
[Pykaraoke-discuss] [HOWTO] Implementing pitch-shifting and crossfading (for filler music/other sources) for PyKaraoke on Linux with JACK
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 of