Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Reciprocating to the perl community

by Ambidangerous (Scribe)
on Jun 02, 2004 at 14:42 UTC ( [id://359467]=note: print w/replies, xml ) Need Help??


in reply to Reciprocating to the perl community

I have been working steadily toward a distant software goal for some time now. I find having a goal focuses your attention on the smaller steps you need to take in order to get there. On the way, you WILL contribute to the community--as you see the opportunity arise.

I am a jazz musician, and I'd like a really simple, non-proprietary way for folks to share leadsheets (the chord changes for a given jazz tune; the lyrics and notes can be copyrighted, but not the chord progression).

In addition, I'd like the program to be able to autogenerate some elementary accompaniment (bass, drums, and chords) so that folks who are learning jazz can play along and 'get' the tune.

Since I'm lazy (which is a virtue for programmers, remember), I want to first look around and see what existing systems are in place to interchange music. So far, I've found MusicXML, MIDI, and ABC file format, to name a few. I also want to see what similar or related programs are out there, so I could possibly interface my project with theirs (make it so I could out documents to lilypond, for instance, or the numerous abc systems).

Additional layers of complication: I want it to be as cross platform as possible (which is why I have three systems on my computer now, WinXP, Cygwin, and dual-boot with Debian).

Right now it looks like I'm about 2-3 years away from having a good product. I've built some elementary alpha versions of the program--Perl scripts that take a chord progression and make a walking bass line, for instance. But the more I learn, the more ideas I come up with for the final project.

And no, none of this is for profit. Truth is, I love jazz, and, as they say, the best way to make a small fortune in jazz is ... start out with a large one ;-)

Once I get some good modules up and running, I'll make em available on CPAN. Until I think they're really worthwhile and innovative, though, I'm keeping em to myself. In the meantime, if I learn something, I can share it, or provide a review of modules I've really found worthwhile (there's already a MIDI to MusicXML module, for instance, though I haven't had time to wrestle with it properly, yet).

I'm still not certain the final form will be in Perl, but there's no doubt--knocking out the code in Perl is about 10x more efficient time wise than doing it in Java or C. Perl gives wings to your algorithms, sometimes, by freeing you from the gravity of interface.

$jPxu=q?@jPxu?;$jPxu^=q?Whats?^q?UpDoc?;print$jPxu;

Replies are listed 'Best First'.
Re: Re: Reciprocating to the perl community
by flyingmoose (Priest) on Jun 02, 2004 at 18:29 UTC
    Computer music stuff is cool... I've had a long running idea in my mind for about 5 years now, on making "computer music that actually sounds good". The idea is that you could turn this thing on, and it would ad-lib and play forever -- in one constantly changing, never ending song. My problem is, I'm actually less musically talented from you, and I can't codify what sounds good until I hear it -- that is, generic rules such as "chord progression X to Y sounds good after a Z, but not after a W", etc. (This isn't the whole idea of course, since that implies a theoretically boring Markov-chain solution, but that's part of it)

    I really don't like the CSound syntax, but it's about as powerful as any Debian package I can find for making instruments, so I may play with that... I don't know. (I'll take suggestions on any other Deb's for batch-mode non-real-time synthesis I might try).

    Anyhow, I'm just rambling, but it does serve one point to the discussion... trying to 'contribute' is never fun unless you are having fun, taking on a project to do something cool without believing in it always ends in failure. Or Microsoft Windows :). Whichever.

    So anyway, I'll need to get working if I want my software to be cranking out something Mountain Jam like anytime soon.

      Actually, getting it to sound 'right' is 90% of the problem. Take the bass lines for instance: you can have a 100% technically correct line, but . . .

      • It's hard to make a synthetic bass sound that sounds like the real thing, especially a doghouse (the big, upright bass you see a lot in jazz).
      • If you are dead on the beat, you sound flat. To swing, you have to play around with the time a bit. (I can't seem to get my current model to swing.) I think it has something to do with anticipating beats 2 and 4 by a smidgeon, but probably more to do with articulation (also hard to do electronically)
      • Ad libbing forever is possible--there's a book by Jerry Coker called 'Elements of the Jazz Language for the Developing Improvisor', where he analyzes thousands of jazz tunes and comes up with 14 to 20 'elements' that make up the vocabulary of jazz. BUT, you program a tune like this, you get . . . the sound of a computer pretending to play jazz. Again, rhythm, articulation, and just plain horse sense are hard to program . . . even in Perl ;-)
      $jPxu=q?@jPxu?;$jPxu^=q?Whats?^q?UpDoc?;print$jPxu;
        I've noticed that sound is a vastly underdeveloped area of Perl. The latency requirements for synthesis and audio editing make Perl a rather poor choice, but I've said before that's changing. What you are talking about Ambidangerous is a sequencer. The various formats you discuss, MusicXML, MIDI, and ABC are representations of multi-channeled time variant signals, the performance parameters and events of the music. The most essential element of a sequencer is a clock, and as a Jazz musician I'm sure you'll agree that timing is most important. Serious music software designers like to work in the sub millisecond range at least. So it doesn't look good for real-time generative Perl programs. However, don't be disheartened. A large part of what you are talking about is music theory, that is combining the relatively simple data structures used to make music in a combinatorial way to make larger data structures (notes to chords to progressions), and this can be done a priori well ahead of the buffering that would connect to a real sequencing engine on a real product. You describe
        "..simple, non-proprietary way for folks to share leadsheets In addition, I'd like the program to be able to autogenerate some elementary accompaniment (bass, drums, and chords) so that folks who are learning jazz can play along and 'get' the tune."

        The sounds you are describing, drums, bass etc are produced by a sampling or synthesis engine elsewhere. All you want to, I think, is to make patterns. Search the literature around Algorithmic Composition. A word about formats. MIDI is the Daddy and all lesser formats are insignificant. Not because MIDI is better, MIDI is an obsolete POS that should have died gracefully 10 years ago. The reason MIDI became, and is, the One music format to rule them all is because it was the first and to date most complete development in music protocols. And because a lot of expensive hardware has been built and sold that uses it. It is both a time variant sequence representation, as a file format, and a transport and physical protocol for transmitting those events over cables (to specialised synthesis hardware and from imput devices). Having said that, there are multitudes of far superior static representations/formats for music, but even when you have theoretically infinite timing resolution within them (by variable length arithmetic etc) you end up shoving it all through MIDI at the end of the day. Sad, but if your going to be Practical write it at the timing resolution of MIDI in the first place.

        Flyingmoose, there is indeed already Markov based Algorithmic composition. I've heard some of the very best of it, (you may guess this is close to my area of expertise) and my sincere advice is to avoid as much as possible. Academic music is proof of concept, no one actually listens to it and algorithmic 'music' sucks by definition.

        I really don't like the CSound syntax, but it's about as powerful as any Debian package I can find for making instruments, so I may play with that...
        Barry Vercoe is a Giant to me. I must have churned out tens of thousands of lines of Csound (don't be impressed DSP is cut n paste programming for the mostpart), it's an old friend. Completely impractical as a composition or performance tool, but the most deadly sound design tool. It's also the best conceptual introduction for programmers to understand DSP frameworks with multiple synchronous levels of execution. If you jump into writing audio applications without a hint of this you will end up with an asynchronous and erratic mess.
        "It's hard to make a synthetic bass sound that sounds like the real thing."
        As a rule it's very hard to make a synthetic anything that sounds the real anything. The art is all about shortcuts and mathematical tricks. Brute force synthesis (just throwing cycles at physmo) is considered inelegant. For your bass sound Karplus-Strong is the kiddie. You need only a white noise source and a delay and you can make VERY realistic string bass sounds.
        "If you are dead on the beat, you sound flat. To swing, you have to play around with the time a bit."
        That's what sequencer software missed for years. If you look at something modern like Logic (the sequencer application) you will see all manner of amazing things like groove templates, swing overlays, extracting tempo and timing from audio and other signals. The logical editor is to _serious_ musicians what regular expressions are to Perl and programming generally. If you want to study a sequencer look at Logic (by Emagic).

        Open Source music and audio is really comming of age now. Lots of development happening. I noticed recently Audacity nicely integrating to an old friend of mine Nyquist (basically Csound in Lisp), which is an awesome combination for intelligent editing, but I digress.. ..Perl..Interesting possible new avenues in music sequencing and AI are things like analysis, recomposition/hybridisation of music on the large scale structural level, and Perl would be just perfect for that.
        Andy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://359467]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-23 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found