6 ms·
Show HN: Computer Music with Python
- karlp 6y agoThis is amazing, it looks really useful to easily code new sounds, but it seems not in real time? I would change the name though, with pypy, pypi and pip it seems it will lead to confusion.
- djaychela 6y agoI haven't found a library for Python that does real time sounds in the way that old home computers (BBC micro etc) used to do. I got loads of pleasure when I was a teenager making sounds on my computer and hearing them back in real time, and I'd like to get that immediacy back (I have a theory that fewer kids are interested in programming than might otherwise be as it's much less immediate and accessible than it used to be). If anyone knows of one, I'd love to know about it.
- andi999 6y agoCan you elaborate what you mean with real time sounds
- djaychela 6y agoThe other day I was looking at an old BBC micro demo (cold tea) and thought about porting it to python for fun. In BBC basic there is a sound command which has 4 parameters, allowing you to play a sound straight away -not play back a wav file (a la pygame etc), but generate musical pitches easily with a single command. Other older era systems had similar commands, and that immediacy (both literally in terms of command leads directly to an audio output, as well as the command being a single line and easy to understand even for 11 year old me) is what I'm looking for.
- hnick 6y agoAs an example, DOS machines came with a form of BASIC and you had these: https://en.wikibooks.org/wiki/QBasic/Sound https://en.wikibooks.org/wiki/QBasic/Sound We had fun in school putting the SOUND command in a loop and either increasing or reducing the Hz to test our hearing and prove that yes, "old people" (such as our teachers who probably weren't much past 30) have terrible ears for higher pitched sounds.
- erikschoster 6y agoPyo might fit the bill for you! http://ajaxsoundstudio.com/software/pyo/ http://ajaxsoundstudio.com/software/pyo/
- IdiocyInAction 6y agoProgramming is way more accessible than it's ever been.
- djaychela 6y agoI disagree. 80s home computers camev with an interpreted language built in, and you were 5 seconds from power on to writing code. In addition, everything was accessible easily via comprehensible commands, directly. I don't think that's the case today, and in addition the bar is immensely higher than it was in the past. Commercial games in the early 80s looked like the kind of things you programmed yourself, whereas I think any title my kids play now looks like a cgi movie, and is the product of hundreds or thousands of people.
- labbeth 6y agoRemembering me when I was retyping Basic listings from mid 80's magazines...
- erikschoster 6y agoThanks! I’ve been performing with what I like to call a “just-in-real-time” approach with pippi now called Astrid, which allows for live coding (instrument modules reload when the file is saved) MIDI input, etc. It is in a works-for-me state though, and probably won’t be documented and packaged for others until after pippi itself is out of beta... if you are curious though it is here: https://github.com/luvsound/astrid https://github.com/luvsound/astrid Edit: but to clarify yes pippi is meant primarily to facilitate writing generative musical scores in python. (Scores which produce sounds, not notation.) I have used it to perform from early on in its development, and IMHO it works fine for this, but the main use case is to render offline audio.
- aldanor 6y agoOP surely already knows this, but for everyone else in this thread - for live music coding, got to mention Sonic Pi (https://sonic-pi.net https://sonic-pi.net and https://github.com/sonic-pi-net/sonic-pi https://github.com/sonic-pi-net/sonic-pi) which is absolutely amazing at what it does; it's Ruby and not Python, but some ideas are quite brilliant.
- grecht 6y agoAn unfortunate name since "Pippi" means pee in German. But then again, there probably are many names that are unfortunate in some language.
- erikschoster 6y agoThat made my day, I had no idea. :-) (It is named after Pippi Longstocking FWIW.)
- jwandborg 6y agoA fortunate name since Pippi is an actual name in swedish.
- photon-torpedo 6y agoActually the German word is "Pipi".
- sgt3pr 6y agoSecond this
- mhugo 6y agoSame in French ("pipi")
- whatch 6y agoTo avoid this, there is wordsafety.com, recently mentioned on HN[0] [0]: https://news.ycombinator.com/item?id=24006618 https://news.ycombinator.com/item?id=24006618
- aldanor 6y agoLooks quite awesome, will surely check it out. Wonder if there's any complex end-to-end examples or videos?
- erikschoster 6y agoThe closest thing I have right now are the first two tutorials in the docs: https://pippi.world/docs/tutorials/ https://pippi.world/docs/tutorials/ These are meant to build toward a final example mixing aspects of all the tutorials into a more realistic project. Having used pippi for my own music for about 9 years now I try to only move structures and patterns into pippi itself when I find myself writing the same things over and over in scores. In general each score tends to be structured very differently, depending on what it does. Hopefully I can communicate that in the tutorials by showing a variety of approaches, but it’s a work in progress!
- puranjay 6y agoIf you're interested in this, I highly encourage checking out Sonic Pi [0]. It's an open source music programming language. Also works very well as a tool to teach coding. [0]: https://sonic-pi.net/ https://sonic-pi.net/
- sramsay 6y agoThis is very, very cool. My problem with most music programming environments (in my humble, but very informed opinion) is that . . . they don't sound very good. That is, the oscillators, filters, envelopes, etc. don't sound anywhere near as good as what you can buy from UAD, SoftTube, PSP, U-he, etc. The OP may be a DSP genius for all I know, and maybe it sounds incredible. I haven't tried it yet. But it seems (just glancing over it) that there's an emphasis on manipulating existing audio files. This is actually huge. It's true that you can do that things like ChuCK and csound and whatever, but they never felt focused on that to me. The biggest player in this "let's mess with audio files" space was the Composer's Desktop Project. That thing was amazing, but it seems slightly moribund, and I haven't been able to get it to compile for years. Anyway: I can't wait to dig in!
- indigochill 6y agoIs the problem of the oscillators not sounding very good a fundamental problem of these programming environments? I'm mostly ignorant of their specifics, but my assumption is that someone who understands the fundamentals of synth programming could patch oscs and filters into combinations that do sound nice just as well as they could in commercial synth software. Is there something preventing that from being the case? Or are you just referring to available presets?
- djaychela 6y agoMost good sounding vintage synth oscillators have waveforms that are far from the mathematical "ideal" that they are named after. This gives them extra harmonics and therefore character that vanilla DSP creations generally lack. Same goes for filters, too. When they are meticulously modelled on these originals, then they can sound very good, but otherwise tend to lack the character of the sounds many of us have grown up with.
- TheOtherHobbes 6y agoIt's not the combinations, it's the tasteful application of oversampling, waveshape control, and distortion. Moog's iPad apps and the new UAD Minimoog both sound pretty good, so there's no practical reason why DSP synthesis should sound bad. The only thing preventing that being used here is the complexity of the models and the fact they tend to be proprietary. Supercollider, Max, Csound, PD, and ChucK all use the simplest possible public domain models, and even the best of the simple models aren't good enough to generate sounds with the production values you'll hear in a commercial recording. Generally the computer music community doesn't pay attention to production values at all. They're happy with a workable basic implementation of $effect or $synthesis_element, and they lose interest in the rest. That's partly because DSP with high production values takes a long time and work. There's a story that gets told about the TC Electronic 6000 system, which has a gold standard reverb you'll hear in most movies [1] - which is that it was the work of a team of more than ten people working for years. It's not hard to hack together a basic reverb algo from public sources. But it is not going to sound that good. [1] You know the ambient piano sound some movies have in their scores? That. If you want to buy that reverb the hardware costs nearly $17,000.
- intrepidhero 6y agoThis is really excellent! I've played around with Sonic Pi but always wished for something with more Python. I will definitely be playing with this. I'm curious if anyone can point to a free library of samples or synths that would be good to pair with this? I can do without Sonic Pi's GUI but the included sample/synth library is a great jumping off point.
- person_of_color 6y agoIs there anyone making music with programming that sounds like it could be a pop song? i.e "good" - not glitchy, or experimental.
- sleazy_b 6y agoI’ve been really interested in dsp for music and computer music for a while now but am kind of at a loss as to where to learn more after having gone through Xavier Serra’s excellent Coursers class. Can anyone recommend further resources for learning about the subject?
- mhh__ 6y agoFor nitty-gritty DSP I would sit down and read a book like Proakis. It's quite dry but ultimately if you are able to handle the math it's worth it (for me at least, learning mathematical topics through the medium of python or similar is a distraction)
- Abishek_Muthian 6y agoAwesome project OP! Tangentially, Are you interested in music identification, especially musical instrument identification? If so, You might be interested in looking at a need gap - 'Display musical instruments used in a song'[1] which was recently posted on my problem validation platform. [1]https://needgap.com/problems/151-display-musical-instruments-used-in-a-song-visualization-music https://needgap.com/problems/151-display-musical-instruments...