News for hackers. Stuff that matters.
Re:Does anyone use sound effects in their dev environment? by mattlondon on Monday September 16, 2024 @11:44AM (#41557236)
Something I have often thought about for years but never implemented was "sound logging" where you get specific points of your code to play audio clips or tones instead of/as well as logging to console etc.

The idea being that you can test the app.and hear the sound logs going off as you go. In a tight loop that executes quickly I would hope that you could hear something "being off" in the same way that a mechanic can hear if an engine is "running rough" etc.

Of course... It might just be a totally inscrutable and useless wall of noise too! Won't know until I try it out

Re:Does anyone use sound effects in their dev environment? by tylerc230 on Monday September 16, 2024 @12:14PM (#41557607)
Xcode has this functionality. You can attach a system sound to a breakpoint. I used it exactly once when I was trying to determine if two events always happened in the same order and were always equally spaced in time. It worked well but drives you sort of mad after a while.
Re:Does anyone use sound effects in their dev environment? by klausa on Monday September 16, 2024 @12:25PM (#41557738)
One interesting way of using this I've heard of; is attaching it to a `-[UIViewController dealloc]`, and being able to "hear" (or rather notice the lack of sound) retain cycles this way.
Re:Does anyone use sound effects in their dev environment? by iosguyryan on Monday September 16, 2024 @03:39PM (#41559785)
This is the way
Re:Does anyone use sound effects in their dev environment? by karmelapple on Monday September 16, 2024 @09:24PM (#41563045)
I've used it so many times doing that, and also handling UIWebView events where I didn't know what all might happen. Really helpful.
Re:Does anyone use sound effects in their dev environment? by mrbombastic on Tuesday September 17, 2024 @10:54AM (#41568208)
Xcode has all sorts of cool stuff you can do with breakpoints, one I used more often than sound is logging a value on a breakpoint and continuing execution.
Re:Does anyone use sound effects in their dev environment? by worldsayshi on Monday September 16, 2024 @12:15PM (#41557614)
It could be useful but it would probably be very annoying and disharmonious unless it's very well designed. Would be cool and potentially very useful if somebody incorporated it in a good way.
Re:Does anyone use sound effects in their dev environment? by knodi123 on Monday September 16, 2024 @12:13PM (#41557584)
I definitely chain things like "make; say all done", then crank the volume and go make a snack. But that's probably not what you were referring to.
Re:Does anyone use sound effects in their dev environment? by shtack on Monday September 16, 2024 @12:55PM (#41558044)
This was my undergraduate "thesis" project. We built a GDB plugin that would generate a puredata audio structure to help with debugging. Eg. it would play snoring during a sleep() call, each breakpoint could be set to a different frequency, etc. It was actually pretty interesting for multi-threaded code, though pausing to play the audio could change the runtime profile.
Re:Does anyone use sound effects in their dev environment? by netsharc on Monday September 16, 2024 @12:59PM (#41558079)
Makes me think of movie/TV computers that beep and bop, e.g. https://www.youtube.com/watch?v=hsP-kWvl1ds

An out of place beep would probably be noticable.

Re:Does anyone use sound effects in their dev environment? by dennis-tra on Monday September 16, 2024 @01:03PM (#41558120)
I had the exact same thought for years but never came around experimenting with it. I also hoped that one could eventually hear that something is off.

I think this can happen by either recognising the "rhythm" in which sounds appear and/or recognising different tones.

As a first step, my idea was to write a logger that plays different beep sounds for different log levels. That way you could mostly identify the “rhythm” because I guess most log messages would have the same severity. However, to a tiny degree also by the pitch of the sound.

Then as a second step I thought of mapping the log message to a scale of sounds by e.g., hashing the message. This obviously would only work if there’s no dynamic content in the message.

Re:Does anyone use sound effects in their dev environment? by puzzledobserver on Monday September 16, 2024 @06:09PM (#41561589)
I recall seeing the following very neat idea on HackerNews some time ago, but can no longer find it:

The idea, if I remember correctly, was to intercept system calls and play a sound every time one occurred. So you'd get a series of beeps every time the disk was accessed, somewhat similar to the spinning noise from HDDs. It would play a different type of noise every time the network was accessed, memory was allocated or freed, and so on.

They reported that developers got pretty good at diagnosing and debugging their programs, purely from listening to it run.

Re:Does anyone use sound effects in their dev environment? by pilliq on Tuesday September 17, 2024 @04:45AM (#41565706)
A bit late to the party, but I had a similar idea a while back and built a prototype of this here: http://pilliq.com/companion

It's a "runtime" that executes arbitrary JS code while continuously playing a single tone. Every loop iteration increases the tone's frequency, and every recursive function call increases the tone's pitch (when the function returns, the tone's pitch is decreased).

  * There are visual markers to show what is currently being executed
  * You can increase or decrease the speed of playback
  * You write your own code and execute it in the browser.
I included two examples of fibonacci: one that's iterative and one recursive. I think the audio/visual feedback helps you "feel" the difference of why the iterative implementation is faster than the recursive one.

It's a bit of a hack, and you may need to refresh the page after it finishes running through the code once.

Re:Does anyone use sound effects in their dev environment? by cmpalmer52 on Tuesday September 17, 2024 @11:19AM (#41568575)
The Grep Console plugin for JetBrains IDEs lets you do this.