Monday, May 17. 2010This sounds like ARSE! How did you do that?
Well, it's not ARSE anymore, but ARSS, but I prefer the maiden name. This post is about a little workflow to create music or noise in an uncommon way, by painting it. The Tools
First you need a paint tool of sorts. I like mypaint for its many different fancy brushes, but you can use whatever you want. In order to process our painting further we need it as a bitmap (.bmp). Mypaint can't save in this format, so you can use something like the 'convert' program from the imagemagick package, but you could also use gimp or something, but I consider this overkill for such a simple task. The centerpiece of this setup is ARSS, The Analysis & Resynthesis Sound Spectrograph. It was formerly abbreviated ARSE (Analysis & Reconstruction Sound Engine), which, as mentioned before, I like way more. Anyway, this little piece of software can convert between images and sounds, and we'll use it for just that. Let's Paint!Well, there's not much to say here, I certainly can't tell you how or what to paint. I know nothing about painting, but I have a few hints that might help you:
You don't necessarily need to paint youself, you could also use your holiday pictures or .. well, anything really. The ARSS homepage has a couple of good examples. Hardly anything comes as a bitmap, so you'll need to convert it to a 24-bit .bmp. This line oughta do it:
Here's my great painting (scaled down), can you see how much love went into it?
Let the ARSE do its Magick!Now cast the following spell:
Don't be scared, you could just call Here's what my great painting from above sounds like, first using -s, then -n (concatenated and converted to vorbis). ARSS has lots of options and they all can make the same picture sound quite different, so experiment, and have fun painting your sounds :) Thanks go to gordonjcp this time who introduced me to ARSS several months ago using a painted amen-break. Thursday, May 13. 2010ALSA and JACK MIDI explained (by a dummy for dummies)
Today I learned a bit about ALSA and JACK MIDI and I think I should share my new knowledge. The whole topic is a bit confusing, so I'll try to bring some light into that jungle from a user point of view. ALSA MIDIWhenever you get midi data from outside your machine it goes through ALSA (there might also be OSS midi but I know nothing about OSS, not even if it supports midi, so I won't mention it again). So ALSA is used to talk to hardware, to shove MIDI data in and out of your machine. But ALSA can do more than that, it can also route the MIDI data to applications that talk ALSA MIDI. This is all just ALSA, no JACK involved. ALSA is for talking to hardware, it's important to understand that ALSA MIDI is totally independent of the JACK options you use. JACK MIDINow let's have a look at JACK MIDI. I'm assuming you know what JACK is, so if you don't know it already, read up on it elsewhere. JACK MIDI can be used to have one JACK MIDI capable application send MIDI data to another one. This works very accurately, there's virtually no jitter, it's sample accurate. JACK MIDI is perfect for what it does, have one piece of MIDI software talk to another one, but JACK MIDI can't talk to hardware. The Two CombinedBoth do a good job at what they do, and they complement each other, but this part is a bit complicated, mainly because there are multiple ways to have them talk to each other. Here's a brief overview: -Xraw
The raw MIDI option in JACK completely bypasses the ALSA sequencer but ALSA is still involved, it's just the ALSA sequencer which does time stamping and takes care of ALSA MIDI software that's bypassed. It only provides real hardware ports as JACK MIDI ports. -XseqThe seq MIDI option has better timing than -Xraw and creates a JACK MIDI port for every ALSA MIDI port, no matter whether it's hardware or software. Here's an example: alsa_pcm:Midi-Through/midi_capture_1 alsa_pcm:Midi-Through/midi_playback_1 alsa_pcm:UA-25/midi_capture_1 alsa_pcm:UA-25/midi_playback_1 alsa_pcm:Portable-Grand/midi_capture_1 alsa_pcm:Portable-Grand/midi_playback_1 The first two are software ports, there's no hardware involved. The other four ports are the ports of my hardware, connected through USB. a2jmididThis is not a JACK option but a bunch of little programs that do the same job, just more accurately than the other methods (less jitter). They can be found here: a2jmidid. The included programs are:
Most important is a2jmidid. It dynamically creates JACK MIDI ports for all your ALSA MIDI ports. By default it does so only for software ports, but with the -e option it exposes the hardware ports too, so The last two, in my opinion, don't offer anything new to the user, a2j is the same as a2jmidid but can only be controlled via DBUS, a2j_control is the corresponding CLI control program. An example for JACK/ALSA MIDI bridging
On this screenshot of patchage you can see a2jmidid in action. JACK was started without MIDI backend (without -X (seq|raw)), then There is one thing you should keep in mind when you bridge between ALSA and JACK MIDI. Due to how JACK works there's always a constant delay of exactly one JACK period added to the midi data, meaning: the data arrives always exactly one JACK period late. This may or may not matter, but you should be aware of it when you say, play an ALSA and a JACK MIDI synthesizer at the same time. I'm don't know whether this applies to the JACK MIDI -> ALSA MIDI process. Recommendation Use JACK MIDI when you sequence, use ALSA MIDI when you play hardware.
Use JACK without a MIDI driver and in combination with As you can see, there's no -X and I don't see any JACK MIDI ports unless I run a2jmidid. You may wonder about the -M256. This is a neat new feature Paul Davis added to the not-yet-released JACK1 0.119 and can at this time only be found in JACK1-svn or the experimental JACK branch "tschack" by Torben Hohn. It allows you to use a different period size for MIDI than for audio, which can be handy. You might want to use a bigger period size for MIDI when you use hundreds of MIDI channels, for example. Rumor has it that a2jmidid might get integrated in JACK, which might make usage a little bit more convenient and spares us the separate installation, but we'll have to see whether that really happens. That's all for now. Please feel free to correct me where I'm wrong. I hope I could make clear how the whole thing fits together and ultimately help someone to create some music. Thanks to Paul Davis for answering all my questions and thanks to you for reading. Late Addition: Where's my MIDI? A little basic troubleshooting guideBy popular demand (by danboid ;->) here's a little troubleshooting section. So you have your keyboard connected to the computer, have it connected via a2jmidid to your arpeggiator, to your sequencer, to your favorite synth and yet, you don't hear a thing. So what's wrong? Where to start? First you should check that everything is powered on and double-check that everything is connected correctly. If you connect your MIDI gear via USB, triple-check that the correct USB cable is plugged in. Now that you've made sure that the hardware is connected you can check whether you get any MIDI data. You can do that without special software, simply by issuing: {N} is the number of the MIDI device. If you have just one, then it's 1, if you have more.. you get the idea, try them all. If there's no output then there's no incoming data. The output in case there is a signal might surprise you, on my terminal emulation it looks like a bunch of questionmarks that get added one by one. Clearly it doesn't know what to make of it. But: If I play something on my keyboard I see some change in the gibberish, we have contact! There are more MIDI devices which you can use the same way, /dev/dmmidi is the same as /dev/midi, both of OSS origin and for compatibility with old devices. /dev/snd/midiC0D0 is the ALSA node. All of them will show you the same gibberish.
Now wouldn't it be nice if we could see something useful instead? For that we need some specialised program. The simplest might be aseqdump, which can be found in alsa-utils, another popular choice is kmidimon, and for JACK MIDI there's at least the scope tool in the epichord sequencer, all of which will show you pretty much the same data. It might be a good idea to look at the ALSA MIDI data first, and I'll use aseqdump for this purpose.
It's quite easy to use, just type Waiting for data at port 129:0. Press Ctrl+C to end.
Source Event Ch Data
0:1 Port subscribed 24:0 -> 129:0
24:0 Active Sensing
24:0 Active Sensing
24:0 Active Sensing
24:0 Active Sensing
24:0 Note on 0, note 62, velocity 41
24:0 Note on 0, note 50, velocity 34
24:0 Control change 0, controller 64, value 48
24:0 Control change 1, controller 64, value 48
24:0 Active Sensing
24:0 Control change 0, controller 64, value 127
24:0 Control change 1, controller 64, value 127
24:0 Active Sensing
24:0 Note on 0, note 53, velocity 38
24:0 Note off 0, note 50
24:0 Active Sensing
24:0 Note on 0, note 64, velocity 53
24:0 Note on 0, note 57, velocity 39
24:0 Note off 0, note 53
24:0 Note off 0, note 62
24:0 Active Sensing
So if everything works fine so far and you still have issues you know at least that you get MIDI data into the computer and the trouble starts elsewhere. Thanks to danboid for the suggestion to add this section and for showing me 'cat /dev/midi' as well as recommending kmidimon. Thanks to gellyfish for recommending aseqdump. As alway, I hope it helps someone :) Tuesday, March 23. 2010May I introduce myself..Hi, my name is Philipp and I'm a bit of a geek. I spend a lot of my time with Linux Audio stuff. Ever heard about it? Nope? Here's a place to read about it, among other stuff. I don't really expect anyone to read the stuff I write but I'll try to make it interesting on occasion by showcasing the one or other odd app and telling you about stuff you might not have heard about. I'll mainly use this blog to write about stuff that has no place in a wiki, like the Arch Linux Wiki. Well, have fun reading :)
Posted by Philipp Überbacher
at
11:46
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: general
(Page 1 of 1, totaling 3 entries)
|
Calendar
Syndicate EverythingBlog AdministrationPowered by |
|||||||||||||||||||||||||||||||||||||||||||||||||
