Hacker News new | past | comments | ask | show | jobs | submit login
Music Mouse (teropa.info)
387 points by raldu on Nov 21, 2022 | hide | past | favorite | 57 comments



It's a modern Web Audio implementation of this Mac software from 1986 (last updated in 2004).

Music Mouse - An Intelligent Instrument - https://web.archive.org/web/20220629172536fw_/http://retiary... (Archived because the original site is quite slow: http://retiary.org/ls/programs.html)

It was written by Laurie Spiegel, a composer and early pioneer in electronic music.

> Music Mouse is an algorithmic musical composition software developed by Laurie Spiegel. The "intelligent instrument" name refers to the program's built-in knowledge of chord and scale convention and stylistic constraints. Automating these processes allows the user to focus on other aspects of the music in real time.

> In addition to improvisations using this software, Spiegel composed several works for "Music Mouse", including Cavis muris in 1986, Three Sonic Spaces in 1989, and Sound Zones in 1990. She continued to update the program through Macintosh OS 9 and, as of 2021, it remained available for purchase or demo download from her website.

https://en.wikipedia.org/wiki/Laurie_Spiegel

She was featured in the documentary, Sisters with Transistors. https://sisterswithtransistors.com/


> To enable MIDI output, please use a Web MIDI capable web browser. (Chrome or Opera)

It took 10 years, but Firefox finally has Web MIDI!

Bugzilla: Implement the WebMIDI API - https://bugzilla.mozilla.org/show_bug.cgi?id=836897


Laurie Spiegel is a Bell Labs alum. Bell Labs is the nexus for so many remarkable people.

A bit off-topic, but does anyone know of a book that touches on how Bell Labs managed to recruit and foster so many great minds?


“UNIX: A History and a Memoir” by Kernighan is a really fun read. Just publushed a few years ago as well.

https://www.amazon.com/UNIX-History-Memoir-Brian-Kernighan/d...


It's somewhat covered in John Gartner's "The Idea Factory: A History of Bell Labs"


Key takeaways from that book are mostly about money: 1) science is expensive 2) having a gigantic hose of money helps 3) scientists should not be the same people acquiring and managing money and programs

Very disappointing that our current academic science system operates with almost an identically opposite model to Bell labs.


Love that website. Was this sold in stores?


Wow, this is probably the most intuitively enjoyable music tool I've ever used.

I'm not a musician and I know very little about what makes music good, but playing with this tool felt like I was hearing a better version of my own imagination. Like those scenes in movies where people can suddenly play music and have no idea how they're doing it.


PG Music's Band-in-a-Box still exists, but way back in the Windows 3.1 era it already had a "snap to pleasant notes" feature if you wanted to play along a set of chords on a MIDI piano. It could also play chords in the style of famous musicians along with your never-ever-bad notes! I always switched it to the "Erroll Garner" preset and hammered away.

https://en.wikipedia.org/wiki/Band-in-a-Box


It's rare to have an instrument where anything you do sounds good!


That's the magic of music theory: it constraints the space of all possible invocations of an instrument to those that are theoretically correct. Our 'random input' is fit upon the closest match that yields a music-theoretical correct outcome.


Western music has certain "rules" that our ears are used to. If the computer limits variation/random-ness to stay within those rules, it will sound at least "pleasant", as the bot won't let you drive outside the lines. However, the real artistry is knowing when and where to break the rules. A tune that sticks to all the rules risks sounding stale or ordinary. You gotta know where to spice and spike it to move to the next level.


By total chance, this revealed a flaw with my mouse that's been haunting me for months.

My right mouse button intermittently doesn't bring up context menus, which I seemingly confirmed by recording the screen and visualizing click events in a presentation mode. It would show what looked like one right click, but no context menu, or a context menu that appeared and was immediately dismissed.

But this revealed that it's actually rapidly sending multiple logical clicks per physical click. The logical clicks are fast enough that the screen recordings didn't differentiate them as separate events - which sent me in the wrong direction, making me think the OS was disregarding clicks. But here, the multiple clicks are clearly audible.

So thanks!


I've had this problem on so many mice over the years, going back to the Amiga days. Often it can be fixed by opening the mouse and gluing a tiny bit of thin card to the nub which presses on the microswitch. (Usually the problem is just that the plastic has worn down over the years and no longer pushes the button quite far enough to make a clean contact.)


I've fixed some of mine by opening the switches themselves and bending the metal spring a bit. Of course that only lasts for so long before you need to re-do the fix.

The middle mouse button seems to be the one to fail the most - I guess manufacturers cheap out on it even more than others since it isn't used by normal people that don't use X11 (middle click paste for selections) or know that it opens links in new tabs (in FF at least).


Interesting, I’d expect mice to come with hardware debounce by default.


There's an article (on modifying mice with hardware debouncing) that talks a bit about this:

https://www.tomshardware.com/reviews/hack-mouse-click-do-it-...

> This is one more example of perfectly good theory not getting used in practice to save pennies per unit and also to perpetuate planned obsolescence. That is, sales would drop if you no longer needed a new mouse every two to four years as a result of glitchy buttons.

FWIW, the [1]Zaunkoenig brand is where I first heard about this. I have their M1K and M2K mice, which are really nice. (I am otherwise unaffiliated with them)

[1]: https://zaunkoenig.co/blogs/blog/zaunkoenig-m1k-firmware


As a person with no knowledge of music theory, I am amazed how the music produced here, even with completely random mouse movements, still sounds decent—even a bit pleasing, if I may. Certainly better than hitting keys randomly on a piano as an amateur. How does that happen? Is it just about the tempo, and how space between two notes has been programmatically defined?


Music theory is an amazing subject. You can actually make random notes sound reasonably musical by constraining them to just a few simple rules. Copy/pasting from Dmitri Tymoczko's Music 105 lecture notes:

1. Conjunct melodic motion. Melodies tend to move by short distances from note to note. Large leaps sound inherently unmelodic.

2. Harmonic consistency. The chords in a passage of music, whatever they may be, tend to be structurally similar to one another.

3. Acoustic consonance. Some chords sound intrinsically good or pleasing. These are said to be consonant.

4. Scales. Over small spans of musical time (say 30 seconds or so), most musical styles tend to use just a few types of notes, between 5 to 8.

5. Centricity. Over moderate spans of musical time, one tonic note is heard as being more prominent than the others, appearing more frequently and serving as a goal of musical motion.

(Not to say that everything that sounds musical follows these rules, just that if you follow these rules the output is likely to sound musical.)


when you first open the page it will only use the white keys, this essentially puts everything in the key of C major and prevents clashing of notes.

If you change the setting from "diatonic" to "chromatic" on the top left you'll get the random hitting of keys effect you mention :)


How do you know it's not in A minor? :-)


(Somewhat of a half-serious/half-joke answer:) Because it doesn't have any G#, of course!


plot twist: it was E Phrygian


It does keep the tempo, but also limits you to a single scale. So it does sound nice for a bit, but the song doesn't really go anywhere. There are some physical instruments that typically limit you to a single scale too, like a harmonica.


You don't need modulation (going to more than one scale/key) for the song to "go somewhere" or be hella interesting, catchy and touching/emotional.

Tens of thousands of the most known rock and pop songs and hits, from rockers to tearful ballads, are single scale diatonic as well.

You don't even need off-scale passing notes...

The reason this doesn't go anywhere, is not because it's single-scale, but because the melody has no direction and purpose. It's just a "random" pick based on the mouse movements.


Nice! One problem: There's digital clipping. I suspect that the four samples are normalized individually, and when playing at the same time the transients add up to over 0dB. On quality headphones (beyerdynamic dt770 for me) it is quite audible. It happens with the piano and the synth sample, but is more audible with the piano sample.


Is that the sort of "scratch" or "crunch" I hear from my Sennheiser HD 4.50's or is it something else?

At first, I didn't even notice it, but now I went back to listen more carefully. I'm not sure if my headphones are "quality" or not but they are the most expensive set I've ever owned.

I hear no clipping (like sudden silence) at the end of notes, even if I wait a long time. But, my ears are not tuned.


Additive digital clipping would be happening in your device. You should be able to resolve it by turning your OS volume down. This website could use a volume slider for each voice, though.


> You should be able to resolve it by turning your OS volume down.

It doesn't resolve it, the clipping happens in the audio generation before the OS does anything with it.


Clipping can occur at any gain stage, not just the final output


Implementation of something like this in Pong would be brilliant, where the ball is the "mouse"


The old bouncy screensaver.


With the default settings and just scrolling around it really feels like I'm in some sort of badly played Ghibli's OST!

https://www.youtube.com/watch?v=hpfLKbjTWn0

https://www.youtube.com/watch?v=zz68vFJmLKk

https://www.youtube.com/watch?v=tFFy0yEYki0


Haha, I thought the same !


As the world's most Curmudgeonly and Grumpy Old Man (TM) when it comes to web-based music applications ... THIS IS AMAZING. If I wasn't busy, I'd be implementing a native version of this right now. I know some of Laurie Spiegel's music, but had no idea she had ever designed anything like this. Just amazing.


No matter where I move my cursor, it ends up sounding like an opening theme for a light-hearted anime series. Impressed at how melodic it sounds even though I don't know what I'm doing.

Also please fix the mouse jacking. I was only able to regain control of my mouse after exiting the tab :(


Esc worked for me!


I played with the original a long time ago. IIRC, back then Laurie Spiegel asked for some kind of credit on music that was generated by it given that the musical output would be bounded by the software design.

Also, if you've never heard her album Unseen Worlds, its definitly worth checking out.


how fun.

maybe the author does not know this, but shift+/ doesn't work on a portuguese keyboard at least in safari; shift-7 is / and shift-' is ?

all of the other keys work.


I wonder if the key mapping was copied from the original Mac program.

It does seem odd to require ctrl/shift to make the changes since it necessitates taking your hand off the mouse.


It's the same for a lot of EU keyboard layouts =(


I had low expectations for this when I clicked the link and saw the spinny-rotatey loading ring (which for informational sites usually portends a wasted journey) - but I have to say this is one of the coolest things I've seen in a long time! I think an FPGA-based implementation of this or something similar might end up on my projects list in the not too distant future...


Nice! That guy also made this interactive version of Terry Riley's "In C": https://teropa.info/in-c/



It does produce quite nice-sounding fragments from random mouse moves. It highlights how much of the actual music composition process is just plain math, which is done by the algorithm in this case.


With your hand on the mouse, move it up and down a couple millimetres quickly, like you're scratching an itch. This makes quite a nice song.


Wow, it's like a Keith Jarrett improv generator!


Is there a way to move the mouse without playing a key? I am using a touchpad, so maybe it can't be done without an actual mouse.


With a mouse pressing and holding left/center/right mouse buttons and moving the mouse result in no sound until the left/center/right button is released. Not knowing about touchpads, do they not have buttons for left/center/right? If they do maybe those will work as they do on a mouse?


Nice! I expect to see more applications like this with the introduction of Max's RNBO library a few weeks back.


I had this software when I was a kid on my Macintosh Classic.

This brought back a lot of fond memories -- just doodling with sound.

Thanks!


Always love to see Tero Parviainen's new projects. Big inspiration for my webaudio tinkering.


Incredible - loved it! This is what a modern digital music instrument should be like :)


god I clicked in and suddenly an hour went by, this is brilliant


Cool! It's kind of a glorified wind chime.


Ingenious! Can I record in the app?

How are the tones generated?


Is the source code available somewhere?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: