Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
Ok. I get it. It's just a log scale with a magic number thrown in probably to match a certain curve.

Adbot
ADBOT LOVES YOU

TheresaJayne
Jul 1, 2011

baby puzzle posted:

Ok. I get it. It's just a log scale with a magic number thrown in probably to match a certain curve.

isnt it something like 1dB = double the volume? Well not quite but here is a bit of detail

http://www.animations.physics.unsw.edu.au/jw/dB.htm posted:

For instance, suppose we have two loudspeakers, the first playing a sound with power P1, and another playing a louder version of the same sound with power P2, but everything else (how far away, frequency) kept the same.

The difference in decibels between the two is defined to be

10 log (P2/P1) dB where the log is to base 10.
If the second produces twice as much power than the first, the difference in dB is

10 log (P2/P1) = 10 log 2 = 3 dB.
as is shown on the graph, which plots 10 log (P2/P1) against P2/P1. To continue the example, if the second had 10 times the power of the first, the difference in dB would be

10 log (P2/P1) = 10 log 10 = 10 dB.
If the second had a million times the power of the first, the difference in dB would be

10 log (P2/P1) = 10 log 1,000,000 = 60 dB.

This example shows one feature of decibel scales that is useful in discussing sound: they can describe very big ratios using numbers of modest size. But note that the decibel describes a ratio: so far we have not said what power either of the speakers radiates, only the ratio of powers. (Note also the factor 10 in the definition, which puts the 'deci' in decibel).

Jethro
Jun 1, 2000

I was raised on the dairy, Bitch!

baby puzzle posted:

This isn't really programming. What's the formula to increase or decrease the volume of something by a given amount? Multiplying a waveform by 50% doesn't make it sound literally half as loud. I'm completely failing to find the words to search for what I'm talking about.

I'm looking at these numbers in FL studio:



At 50% volume, it gives you 23% amplitude. Where does that 23% come from? e: At least I'm assuming that .23 is an amplitude, as that would correlate with the decibels.

An increase of approximately 10dB corresponds to a perceived doubling of loudness. I don't know why FL Studio chose -12.7 dB to be half volume instead of -10 dB, and googling isn't providing any answers. Is 25% volume -25.4 dB or something else?

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Yeah, my thinking was that it was probably arbitrary but didn't know if someone knew the inner workings of FL Studio to say why that decision was made.

huhu
Feb 24, 2006
Curious what everyone listens to when they code. My typical stuff is either classical, EDM, or video game soundtracks but I'm starting to get bored of all three. Any suggestions for Spotify playlists or genres to checkout?

Fergus Mac Roich
Nov 5, 2008

Soiled Meat

huhu posted:

Curious what everyone listens to when they code. My typical stuff is either classical, EDM, or video game soundtracks but I'm starting to get bored of all three. Any suggestions for Spotify playlists or genres to checkout?

https://open.spotify.com/track/0Ihcz5MbImgvTsYHzMm9PY

csammis
Aug 26, 2003

Mental Institution
I can crank out some pretty good coding sessions with cheesy power metal (Kamelot, Dragonforce). I'm going to put on some Dead or Alive today in memory of Pete Burns :rip:

In the electronic genre I've been been listening to a lot of Shpongle if I'm in the mood for a beat or Conelrad if I'm in the mood for more ambient. Sigur Ros is pretty good "Hey there's music happening and I don't have to worry about attention drifting to understanding lyrics"-music.

spiritual bypass
Feb 19, 2008

Grimey Drawer

huhu posted:

Curious what everyone listens to when they code. My typical stuff is either classical, EDM, or video game soundtracks but I'm starting to get bored of all three. Any suggestions for Spotify playlists or genres to checkout?

Really slow doom metal, especially Yob and Sunn

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

huhu posted:

Curious what everyone listens to when they code. My typical stuff is either classical, EDM, or video game soundtracks but I'm starting to get bored of all three. Any suggestions for Spotify playlists or genres to checkout?

Nothing.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

huhu posted:

Curious what everyone listens to when they code. My typical stuff is either classical, EDM, or video game soundtracks but I'm starting to get bored of all three. Any suggestions for Spotify playlists or genres to checkout?

Pouring coffee, mechanical typing, and persistent air conditioning.
Occasionally other people's conversations.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
Music I've heard literally hundreds or thousands of times before, so it takes up basically zero brain time while still providing a useful audio mask and rhythm.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

If I'm working with z/OS, Perturbator or Dynatron :v:

ufarn
May 30, 2009
I used to listen to music when doing stuff in high school, but these days, it probably just distracts me.

Eela6
May 25, 2007
Shredded Hen

huhu posted:

Curious what everyone listens to when they code. My typical stuff is either classical, EDM, or video game soundtracks but I'm starting to get bored of all three. Any suggestions for Spotify playlists or genres to checkout?

TooMuchAbstraction posted:

Music I've heard literally hundreds or thousands of times before, so it takes up basically zero brain time while still providing a useful audio mask and rhythm.
100% behind TooMuchAbstraction here. I find that repetition is really important to let the music fade into the background so I can really get into the coding mindset. This means a lot of electronic music, especially techno, but also music that's been inspired by it. Doom Metal isn't a bad call! I also really love jazz-inspired electronic music and electronic music-inspired jazz. It helps if I've heard the album a thousand times before. I can also listen to Pavement, but only because they're my favorite band - I have heard every single Pavement song so many times there are no longer any surprises.

Techno:
Self-Titled - Voices from the Lake
Schone Neue Extrawelt - Extrawelt
Club Construction, Volume VI - Jam City

Jazz-inspired Electronic:
Elaenia - Floating Points
Grenier meets Archie Pelago - Grenier, Archie Pelago

Electronic-inspired jazz / 'Classical' / 'Modern Composition':
Dysnomia - Dawn of Midi
V 2.0 - Gogo Penguin
Idiosynkrasia - Francesco Tristano

Ambient:
76:14 - Global Communication
Ravedeath, 1972 - Tim Hecker

Doom / Other:
Conference of the Birds - OM
Flood - Boris
Self-Titled - ...Of Sinking Ships

All of these albums have at least six hours of coding behind them, so I can vouch for them all :)

Eela6 fucked around with this message at 19:15 on Oct 25, 2016

Peristalsis
Apr 5, 2004
Move along.

leper khan posted:

Pouring coffee, mechanical typing, and persistent air conditioning.
Occasionally other people's conversations.

You forgot your office-mate's mouth-breathing, buzzing fluorescent light bulbs, and loud conference calls from your boss in the next office (who never shuts his door, not that it matters, because every noise leaches through the walls anyway).

-Anders
Feb 1, 2007

Denmark. Wait, what?
I like K-pop for coding, or doing any reading up on a subject. I dont understand a single word, so it's incredibly non-distracting. :3:

omeg
Sep 3, 2012

I'm recently listening to Ambient Epicuros' mixes on YouTube, most of them are pretty good. On mobile right now so cba to link but should be easy to find.

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings
I stream radio in a foreign language I'm idly learning. Most of the banter is just white noise to me, occasionally I feel good about catching a few words, the music(largely english anyway) is eclectic by US standards, and poo poo I don't know I can concentrate anyway?

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
https://www.youtube.com/watch?v=54X-WDpA4K8

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Peristalsis posted:

You forgot your office-mate's mouth-breathing, buzzing fluorescent light bulbs, and loud conference calls from your boss in the next office (who never shuts his door, not that it matters, because every noise leaches through the walls anyway).

It's like you totally get me. Except I'm the mouth breather occasionally barking at my monitor.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I've been cranking the office Sonos with obscure Japanese jazz and J-Fusion.

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

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

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Suspicious Dish posted:

the office Sonos

I've never worked somewhere that does this and it sounds absolutely awful. Do you just leave your desk whenever some jackass throws on ten hours of puddi puddi?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
you 1) suck it up and learn to appreciate music that is different than your usual tastes, like my amazing j-fusion, 2) put on headphones, 3) work in the soundproofed phone booths for extra space if needed

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
The only jobs I've had where music was played music all day involved manual labor.

I can't stand programming and listing to music though, unless I'm wearing headphones and using it to keep me from being distracted otherwise.

TheresaJayne
Jul 1, 2011

-Anders posted:

I like K-pop for coding, or doing any reading up on a subject. I dont understand a single word, so it's incredibly non-distracting. :3:

I am listening at the moment to Japanese/anime music, again i dont get the words but i wish i did,...

https://plug.dj/hummingbird-me

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Suspicious Dish posted:

you 1) suck it up and learn to appreciate music that is different than your usual tastes,

This is a good idea. My musical universe expanded a ton when I worked somewhere with a similar sort of setup. Of course, most people just listen to pop, but I learned to appreciate that too instead of being a snob about what was my preferred genre.

Though, maybe not everyone can do this. Personally, I don't care about music much at all and I can go weeks and realize I haven't actually listened to any music at all.

lord funk
Feb 16, 2004

My office is on the same floor as our guitar department, and I'm forced to listen to students practice all day in the halls. It's infuriating.

Or there was that summer job in a supermarket where they looped the same mix CD every day, and they still play it 16 years later.

Just requested a copy of 'The Hatred of Music' by Pascal Quignard. I have a feeling I'm going to like it.

Peristalsis
Apr 5, 2004
Move along.

Thermopyle posted:

This is a good idea. My musical universe expanded a ton when I worked somewhere with a similar sort of setup. Of course, most people just listen to pop, but I learned to appreciate that too instead of being a snob about what was my preferred genre.

Though, maybe not everyone can do this. Personally, I don't care about music much at all and I can go weeks and realize I haven't actually listened to any music at all.

The gym where I lift weights plays the most godawful teeny-bopper pop station in town. I've cut workouts short and left the third time the latest Talyer Swift song comes on in an hour. If I had to listen to that all day at work, I'd be climbing the bell tower with an M1 after a week.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Peristalsis posted:

The gym where I lift weights plays the most godawful teeny-bopper pop station in town. I've cut workouts short and left the third time the latest Talyer Swift song comes on in an hour. If I had to listen to that all day at work, I'd be climbing the bell tower with an M1 after a week.

That's the problem I have with pop radio...the constant repeats. I don't mind the pop music itself. Fortunately, in none of the places I work do I find myself being subjected to the torture of having to listen to Closer by The Chainsmokers every 15 minutes.

edit: oh, this is a programming thread

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Peristalsis posted:

The gym where I lift weights plays the most godawful teeny-bopper pop station in town. I've cut workouts short and left the third time the latest Talyer Swift song comes on in an hour. If I had to listen to that all day at work, I'd be climbing the bell tower with an M1 after a week.

just shake it off, dude

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Peristalsis posted:

The gym where I lift weights plays the most godawful teeny-bopper pop station in town. I've cut workouts short and left the third time the latest Talyer Swift song comes on in an hour. If I had to listen to that all day at work, I'd be climbing the bell tower with an M1 after a week.

That's the plan, stops people camping the squat rack

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Thermopyle posted:

Personally, I don't care about music much at all and I can go weeks and realize I haven't actually listened to any music at all.

This sounds like me. Maybe it'd be awesome. I dunno.

Pretty sure there's zero chance of the office going for it.

Maybe I should start a lil in-office gbs.fm so whoever wants to listen communally can do so. Any suggestions for the least painful way to make it happen? Maybe it's a little harder now with streaming services than it was when everyone had mp3s to upload.

qntm
Jun 17, 2009

Peristalsis posted:

You forgot your office-mate's mouth-breathing, buzzing fluorescent light bulbs, and loud conference calls from your boss in the next office (who never shuts his door, not that it matters, because every noise leaches through the walls anyway).

sneezes

Peristalsis
Apr 5, 2004
Move along.

Suspicious Dish posted:

just shake it off, dude

When I go up the tower, you're the first one on my list.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Peristalsis posted:

The gym where I lift weights plays the most godawful teeny-bopper pop station in town. I've cut workouts short and left the third time the latest Talyer Swift song comes on in an hour. If I had to listen to that all day at work, I'd be climbing the bell tower with an M1 after a week.

http://www.meeaudio.com/M7P-BK/ or, you know, whatever you have laying around.

The Pell
Feb 6, 2008
Im trying to build a script in MacOS to save the contents of a text file to a variable, but when the filename has spaces in it, cat doesn't seem to work. I get a "No such file or directory" error.

What I dont understand is that if I echo the filepath variable and the cat filepath line everything looks good. I can even copy and paste the echo cat filepath output, and the cat works correctly. I have no clue what Im missing here.

code:
#!/bin/bash

echo -n "File path:"
read -r filepath
words=$(cat "$filepath")

nielsm
Jun 1, 2009



Instead of calling cat, you should just be able to redirect the file into another "read" call.

Bash:
code:
read -r -i "File path: " filepath
read -r words < "$filepath"
No idea if that'll make it any better...

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
You need to enclose the path in quotation marks. Which you're doing, but I suspect that bash is stripping them for you. So try
code:
words=$(cat "\"$filepath\"")

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



huhu posted:

Curious what everyone listens to when they code. My typical stuff is either classical, EDM, or video game soundtracks but I'm starting to get bored of all three. Any suggestions for Spotify playlists or genres to checkout?

Oh and I should probably plug https://dtanders.net/noise again

Send bug reports or feature requests by PM please

Adbot
ADBOT LOVES YOU

Mycroft Holmes
Mar 26, 2010

by Azathoth
Ok, new question. I am trying to create a function that will take the results of 4 check boxes and, depending on which are marked, define a variable as a number. The number will be different depending on which boxes are checked. More than one can be checked at a time. Is there some way to do this without a huge block of if..then statements?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply