Yes, there's a really cool music programming language called ChucK that explicitly deals with time as a way to synchronize its musical elements. Check it out:
SinOsc s => dac; // connects a sine wave generator to the soundcard 2::second => now; // causes 2 seconds to elapse
this has the effect of playing a sine wave sound for 2 seconds.
chuck may be of interest. Maybe also IBNIZ
This might also be some help: How to Create Original Drum Tracks Fast and Furious. It's possible the ideas in that article might be amenable to some amount of automation.
I haven't spent a lot of time with the various music languages but I do enjoy using Chuck, which is easy to learn, purely text-based and geared towards on-the-fly composition and experimentation.
There are plenty of examples and some solid documentation on the site, and it's very easy to set up and get going with - definitely worth a look.
Awesome, I really dig this kind of stuff. I'm impressed that you did this after only a few days of coding. You might wanna look into doing some algorithmic composition! There are languages out there, like Csound, ChucK, SuperCollider, PureData, and others that are built expressly for music composition and performance. I think ChucK is probably the easiest of them to learn. Coursera hosted a good class on ChucK a few months ago, from CalArts. Maybe they'll run it again.
In any case, I think the best way to learn to code (or to learn any skill, for that matter) is to find ways to apply what you're learning to what you're passionate about.
I really like your blog, by the way :) .
This is kinda a long shot, but if you are interested in music for games and have a programming background, you may find a more programmatic approach to music to be more successful. There's been a lot of work recently on languages for programmatic sound synthesis: in particular ChucK is very good. You can use it to actually write songs as programs (and there's support for integrating them into games), and possibly this would allow you to transfer some of your existing intuition about programming into music.
Download the installer from http://chuck.cs.princeton.edu/. Once installed you can use MiniAudicle (kinda like the processing ide) to run code. Click the 'Start Virtual Machine' button to wake up the sound server, then click the 'Add Shred' button to play the file.
If you are on the command line you can also just 'chuck file.ck' assuming everything is installed correctly.
The Synthesis Toolkit: https://ccrma.stanford.edu/software/stk/usage.html
I put together a synthesiser with JUCE and STK which I thought was on GitHub, I'll see if I can dig it up and see what happened to it.
I'm working on a STK engine which has C like interface (so it can go into a DLL) with a JavaScript engine hooked into it. Gives me the flexibility but works like you say.
Another consideration is ChucK: http://chuck.cs.princeton.edu/, I believe it is based on STK. Another language on top of a synthesis engine.
What are your thoughts on languages or dialects developed for specific interests, such as Processing for visual art, or ChucK for music?
And are narrow-scope languages like those valuable learning tools for exposing programming to artists and other creatives who might not have considered learning to code? Or should there be more of a push towards the more popular languages in those areas?
Good procedurally generated music is good. All else is awful.
I think we're at a point where PG can make for great riffing within a framework that is more explicitly designed by a person. Frankly, the vast majority of what passes for pop music is mostly procedurally generated, there's just a producer guiding the process and applying effects and transitions to give it some flavor.
Brian Eno developed a concept of Generative Music (http://en.wikipedia.org/wiki/Generative_music) and had worked with some developers to create software around it. It's interesting work, but it hasn't had quite the impact I think people expected.
I've done some limited work with using computer systems to perform live music, stuff like ChucK (http://chuck.cs.princeton.edu/) or digital drum machine programs of my own design. There's a lot to be said for the concept that it's just another instrument.
So what's the reason for the research? Why not? It's fun. It helps us understand the world around us. If you can write an algorithm that replicates a certain component of music, then you're probably very close to understanding why the music works. That doesn't mean you're trying to kill music or musicians, just peal back the covers and see how it all ticks.
mplayer has nice keyboard controls, but I'm not sure it'll do exactly what you want. Your best bet might be writing something yourself. I've considered using ChucK (http://chuck.cs.princeton.edu/) for something similar but haven't gotten around to it.
If you're not set on your choice of music programming software, then I recommend trying ChucK..
The software is simple, the language is easy to learn, and the documentation is all there (tutorial, examples, API spec, language ref, etc.)
> (Typo? 'strongly timed')
Actually no ;-)
One needs time to pass in order to experiment sound/music, so the language has a strong binding to time builtin
cpp
// let one second pass
second => now;
This is inherited from chuck
Typing is quite strong, I'd say: you're supposed to declare types of variables, but there are a few places where there is type inference and some member function calls (also some template calls) are resolved at runtime. Hope I'm clear.
I understand the cons of cryptic symbols, but as you said, most of my language is constructed this way, and most of that is inherited from chuck. I don't find it this hard as syntactic coloration (in nano and vim) is of great help in those cases.
So I won't probably go for another keyword.
Right now I'm thinking of a Tuple
type, inheriting from Object
, with variable number
of types. Like:
cpp
Tuple<~ int, string, float ~> my_tuple;
I'm just taking some time to figure it correctly.
Thanks for your advice.
This is vaguely interesting; although for coding music I recommend one of the dedicated languages for that like Csound or SuperCollider or ChucK.
I don't get how this is "programmer humor", though.
Not that I can immediately think of.
What programming language are you using? You may be better off just using MIDI note numbers, especially if you eventually use MIDI for playback of what the AI composes anyway.
Also, look at ChucK, a programming language built for doing music.
I don't know what sort of sonification rules you're looking to apply, or how much you'd want to get into programming, but Csound and ChucK are both reasonably good bets.
Csound compositions have two parts, an orchestra and a score. The score defines note events that are played by the instruments. If you are looking to trigger a note for each point in your data, this would work well: you'd steal or minimally modify an orchestra from one of the many examples, then write some sort of processor to produce the score from your data.
ChucK I'm just starting to learn myself, and would probably take more coding skills, but you can read arbitrary data into a ChucK program and do any number of things with it, not just trigger notes. (To be fair, in Csound a note event wouldn't have to literally trigger a note, because the "instruments" can do other things, but that's starting to get into some complicated coding territory.)
Interesting about the ALSA MIDI tools, I wasn't aware of those. By any chance did you take a look at ChucK? It's kind of terse as a language but it has quite a lot of neat audio and MIDI features.
I've had an armchair interest in this sort of avenue but i never imagined i could makea a living doing it. Synth software is probably where it's at. Analog synths are in vogue and i see them migrating to laptops.
Hey check this out, programming language for music http://chuck.cs.princeton.edu/
It may be the case you can't find anything and the best odds you have is to come up with a cute website to get your name out and the money in.
Welcome to the world of 1s and 0s. First let me preface by saying I don't recommend trying audio programming in C++ without learning the basic structure of the language first, you will get confused. You can make the terminal beep but don't limit yourself to that, it's a rather trivial and useless beginner exercise IMO as you can't change the duration or frequency etc, just annoying continuous beeps.
Instead I would recommend that you try Chuck, it's a musical programming language and very easy for a beginner to pickup. You will still learn basic constructs such as variables and loops and have even more fun with Sine Oscillators than a dull terminal beeping at you. Its syntax is C like so it will prepare you for C++ when you have had your fill. Here is a full course dedicated to it (it's closed atm but you can add it to your watchlist). Here is a beginners tutorial, you can make a simple melody after this and the internet is huge, search around (one of the most valuable skills you will ever learn) for other resources. Have fun!
Elite, thanks! Here are the first two EDF files that I created, recorded at midnight and one AM while asleep, with a single channel OpenEEG device:
Definitely open for some collabortation... been playing with Chuck - a music programming language... sounds like something that could be useful for visualization!
EDIT: Had to update the server's web.config to serve EDF files!