If we only had trucks on the road, we’d need less road, right? The street where I live could be about a third of the width if it were not for personal cars.
The civic barely does anything to a road, except require its existence and maintenance, and it turns out that roads are expensive to build and maintain (even if only damaged by weather).
Awk is still one of my favorite tools because its power is underestimated by nearly everyone I see using it.
ls -l | awk '{print $3}'
That’s typical usage of Awk, where you use it in place of cut because you can’t be bothered to remember the right flags for cut.
But… Awk, by itself, can often replace entire pipelines. Reduce your pipeline to a single Awk invocation! The only drawback is that very few people know Awk well enough to do this, and this means that if you write non-trivial Awk code, nobody on your team will be able to read it.
Every once in a while, I write some tool in Awk or figure out how to rewrite some pipeline as Awk. It’s an enrichment activity for me, like those toys they put in animal habitats at the zoo.
>To Perl connoisseurs, this feature may be known as Autovivification. In general, AWK is quite unequivocally a prototype of Perl. You can even say that Perl is a kind of AWK overgrowth on steroids…
Before I learned Perl, I used to write non-trivial awk programs. Associative arrays, and other features are indeed very powerful. I'm no longer fluent, but I think I could still read a sophisticated awk script.
Even sed can be used for some fancy processing (i.e scripts), if one knows regex well.
> this means that if you write non-trivial Awk code, nobody on your team will be able to read it.
Sort of! A lot of AWK is easy to read even if you don't remember how to write it. There are a few quirks like how gsub modifies its target in-place (and how its default target is $0), and of course understanding the overall pattern-action layout. But I think most reasonable (not too clever, not too complicated) AWK scripts would also be readable to a typical programmer even if they don't know AWK specifically.
I wrote a BASIC renumberer and compactor in bash, using every bashism I could so that it called no externals and didn't even use backticks to call child bashes, just pure bash itself (but late version and use every available feature for convenience and compactness).
I then re-wrote it in awk out of curiosity and it looked almost the same.
Crazy bash expansion syntax and commandline parser abuse was replaced by actual proper functions, but the whole thing when done was almost a line by line in-place replacement, so almost the same loc and structure.
Both versions share most of the same advantages over something like python. Both single binary interpreters always already installed. Both versions will run on basically any system any platform any version (going forward at least) without needing to install anything let alone anything as gobsmacking ridiculous as pip or venv.(1)
But the awk version is actually readable.
And unlike bash, awk already pretty much stopped changing very much decades ago, so not only is it forward compatible, it's pretty backwards compatible too.
Not that that is generally a thing you have to worry about. We don't make new machines that are older than some code we wrote 5 years ago. Old bash or awk code always works on the next new machine, and that's all you ever need(2).
There is gnu vs bsd vs posix vs mawk/nawk but that's not much of a problem and it's not a constantly breaking new-version problem but the same gnu vs posix differences for the last 30 years. You have to knowingly go out of your way to use mawk etc.
(1) bash you still have for example how everything is on bash 5 or at worst 4, except a brand new Mac today still ships with bash3, and so you can actually run into backwards compatibility in bash.
(2) and bash does actually have plugins & extensions and they do vary from system to system so you do have things you either need to avoid using or run into exactly the same breakage as python or ruby or whatever.
For writing a program vs gluing other programs together, really awk should be the goat.
I feel the same about using Awk, it is just fun to use. I like that variables have defined initial values so they don't need to be declared. And the most common bits of control flow needed to process an input file are implicit. Some fun things I've written with awk
Although the latter just uses awk as a weird shell and maintains a couple child processes for converting md to html and executing code blocks with output piped into the document
I already get it with plan9port and it addresses 100% of my issues with make. It integrates nicely with rc so there's really not a lot of additional syntax to remember.
> That’s typical usage of Awk, where you use it in place of cut because you can’t be bothered to remember the right flags for cut.
Even you remember the flags, cut(1) will not be able to handle ls -l. And any command that uses spaces for aligning the text into fixed-width columns.
Unlike awk(1), cut(1) only works with delimiters that are a single character. Meaning, a run of spaces will be treated like several empty fields. And, depending on factors you don't control, every line will have different number of fields in it, and the data you need to extract will be in a different field.
You can either switch to awk(1), because its default field separator treats runs of spaces as one, or squeeze them with tr(1) first:
> What were you expecting? That your character ranges in ls would match mine?
I would expect the command to work in any directory. Try a few different directories on your computer and you'll see that it won't work in some of them.
Love awk. In the early days of my career, I used to write ETL pipelines and awk helped me condense a lot of stuff into a small number of LOC. I particularly prided myself in writing terse one-liners (some probably undecipherable, ha!); but did occasionally write scripts. Now I mostly reach for Python.
Since you control the \\d format, why would you allow/support anything but a space as a separator?
That's just to distinguish it from a comment like "\\delete empty nodes" that is not the \\d debug
notation.
If tabs are supported,
[ \t]
is still shorter than
[[:space:]]
and if we include all the "isspace" characters from ASCII (vertical tab, form feed, embedded carriage return) except for the line feed that would never occur due to separating lines, we just break even on pure character count:
[_\t\v\f\r]
TVFR all fall under the left hand, backspace under the right, and nothing requires Shift.
The resulting character class does exactly the same thing under any locale.
ISO C99 says, of the isblank function (to which [:blank:] is related:
The isblank function tests for any character that is a standard blank character or is one of a locale-specific set of characters for which isspace is true and that is used to separate words within a line of text. The standard blank characters are the following: space (’ ’), and horizontal tab (’\t’). In the "C" locale, isblank returns true only for the standard blank characters.
[:blank:] is only the same thing as [\t ] (tab space) if you run your scripts and Awk and everything in the "C" locale.
Interesting, the GNU Grep manual describes both character classes as behaving as if you are in the C locale. I shouldn't have assumed it was the same as in the C standard!
> Why are you using the locale-specific [:space:] on source code?
Because it’s the one I remembered first, it worked, and I didn’t think that it needed any improvement. In fact, I still don’t think it needs any improvement.
awk is so much better than sed to learn given its ability, the only unix tool it doesn't replace is tr and tail, but other than that, you can use it instead of grep, cut, sed, head.
You can, sure, but, tail seeks to EOF and then goes back until it finds "\n", awk cannot seek, so you must do what you did there, that means the bigger the file the longer the time.
And there's also tail -f, how would you go about doing that? a while loop that sleeps and reopens the file? yuck
So, I'm curious. What's the Nushell reimplementation of the 'crash-dump.awk' script at the end of the "Awk in 20 Minutes" article on ferd.ca ? Do note that "I simply won't deal with weirdly-structured data." isn't an option.
The N side has negative charge carriers. It has a positive charge in the depletion region because the charge carriers are missing. Likewise, the P side has positive charge carriers, and when they’re missing, you get a negative charge.
This is true whether we live in the current universe or live in an alternate universe where we say that electrons have positive charge. The depletion region is where the charge carriers are missing (depleted), so you get the opposite charge of whatever the charge carriers are.
3. Diode ring, which provides variable gain, used in analog compressors like the Neve 33609 (I have a clone of the 33609, and I’m very fond of it)
Think about this: if you have a nonlinear device like a diode, then the dynamic resistance changes depending on the operating point. If you modulate the operating point, you’re modulating the dynamic resistance.
A device used to multiply two analog signals in time domain. Best known for the sound of the Daleks in the original 1960s Doctor Who series. Has some applications outside of music and sound effects. If you can find those old fashioned audio transformers, this effect does not require a power source.
Two diodes in parallel with opposite polarities. Clips the incoming AC signal to a +/- diode threshold voltage. Put a high voltage gain amplifier stage in front of it and you get the classic electric guitar distortion tone you know and love. Allegedly works best with germanium-unobtainium diodes. In their absence, using two different kinds of diodes can also have pleasant tonal qualities.
So many distortion pedals use an op amp to run a signal into antiparallel diodes to create distortion. I’ve spent a few weeks trying to emulate it, and it’s a lot of fun.
Different flavors of diode make significant changes to the way it sounds. Even things like LEDs can be used (they are Light Emitting Diodes, after all).
Andy Simper of Cytomic is some kind of mad genius at this stuff. He’s created a painstakingly accurate emulation of the Ibanez Tube Screamer that allows you to change the values of basically every component in the circuit diagram. It’s jaw dropping: https://cytomic.com/product/scream/
He’s also shared a ton of incredible information about how he emulates circuits. The math can get really intense. If anyone is looking for a fun project, I strongly suggest experimenting with circuit modeling. It’s a great workout for the brain.
Abuse minority carrier lifetime to very suddenly turn from resistive to capacitive just after switching from forward current to reverse bias; use the fact that the current wants to keep flowing to force it to concentrate into another step recovery diode that's about to cut out, in turn making the cut off spike even sharper, and on.
Surprisingly capable for e.g. blasting a FET gate off while tanking the Miller effect gate current needs through sheer power of SRD-based-pulse-shaping.
Because for e.g. GaN and SiC if you have to choose between ZVS and ZCS, you can take ZVS and just furnish a gate pulse that _makes_ the channel remain off as the current drops and the voltage soars. At least if you pull some tricks and make the current commutation loop sufficiently low inductance to keep your transistors from blowing out in self-inflicted overvoltage due to a current that needed to pass too high an inductance in too short a time.
(Total drain charge is sadly fundamental to the channel's existence, and non-ZVS turn-on is unavoidably lossy. A majority carrier device is theoretically capable of just switching off though if you can arrange the structure for extremely low inductance.)
> 3. Diode ring, which provides variable gain, used in analog compressors like the Neve 33609 (I have a clone of the 33609, and I’m very fond of it)
I just had a quick look at the service manual, but isn't that more of a diode bridge than diode ring? A Ring Modulator has the diodes connected nose-to-tail in a ring, but the gain cell in the 33609 looks more like a rectifier :-)
You can see the same circuit in the VCF and (incorrectly drawn) in the VCA of the Korg MS50 synthesizer. In the former it acts as the "variable resistor" in a fairly straightforward Sallen-Key lowpass filter (there are two feedback capacitors, one to either side of the bridge, to attempt to prevent the input voltage also tuning the filter). On the VCA the diodes are drawn wrong but the pin numbers are correct.
For log converters you should not use diodes, because their parasitic currents mask the current component that has an exponential dependence from the voltage.
For log converters, bipolar transistors are used, because their collector current depends only on the ideal diode current of the base-emitter diode, not also on its parasitic currents, so the base-emitter voltage has a logarithmic dependence on the collector current, for a relatively wide range of currents.
Yeah, I remember one of these my brother cooked up to power a He-Ne laser tube way back when... It was lots of fun to apply to other off-label experiments too.
Diode ladder, but also in various Sallen-Key designs like the Steiner-Parker Synthacon which we all now know from the Arturia Minibrute (Yves Usson probably made more of these filters than Nyle Steiner ever did!) and as I've mentioned elsewhere the Korg MS50. I think the Yamaha GX1 filters used a diode bridge too, probably using discrete transistors similar to the Korg 700S filter.
I did this once with a diode when I was a baby electrical engineer in college. But of course you need some kind of measurement circuit. So somehow(???) I figured out I could wire a diode into one axis of my analog Gravis joystick--hooked up to my soundcard--and get a fairly accurate and stable measurement of temperature by poking the monostable multivibrator (pretty sure that's what it was called) in the soundcard that would trigger the time it took to drain a set amount of charge through the joystick's x-axis/now-diode.
Novices who don't have a clue nor know any better come up with the weirdest solutions. I have no clue whatsoever now what inspired me to even try something like that.
Kinda interesting to hear about. I have a 500 chassis I’m slowly working on filling. I’m between the RND 535 or 543, and had never heard of a diode bridge comp before looking at the 535.
I have the Heritage HA-609A. I considered going 500-series. Maybe some day in the future. For now, I have two preamps and the HA-609A in a 4U rack, and most of my other gear is in storage. Keeping things light.
Fantastic—I’ve written a QuickDraw PICT converter, but I focused narrowly on just extracting pixel data. The format is basically a way to encode QuickDraw drawing commands, and getting the original image back (in the general case) means reimplementing QuickDraw.
The old Mac game Avara used this format for levels. It was funky… you could place blocks in a 3D world, and control elevation and height by changing the corner radius of rectangles. You needed a QuickDraw image editor to make levels, like ClarisDraw.
I listen to a fair amount of choral music, from plainchant and organum up through modern and contemporary works. I think the short answer is missing, which is that most choral music just isn’t that exciting.
The Wikipedia article for the Motet has an interesting quote which echoes the sentiment here:
> [the motet is] not to be celebrated in the presence of common people, because they do not notice its subtlety, nor are they delighted in hearing it, but in the presence of the educated and of those who are seeking out subtleties in the arts.
This quote is attributed to Johannes de Grocheio in the 1200s! That means that people have been saying that choral music is hard to appreciate for more than seven hundred years.
I don't really know what's meant by "exciting" here, but there's plenty of choral music that's upbeat, joyful and rhythmical. For me the most enjoyable form of musical "excitement" is frisson, which choral music has in great abundance. Nothing can give you goosebumps like a good choir.
I disagree with the premise. I don't think there's anything inherently "harder to appreciate" about choral music. It's just a personal, and no doubt culturally influenced, preference. I struggle to enjoy opera and hip-hop, but that's on me. I don't go around writing articles about how hard they are to appreciate.
I totally agree - I've sung in a few choirs myself but even I myself hesitate to attend choral events sometimes. It takes effort to appreciate the depth involved, even with modern choral music (think Eric Whitacre) or even gospel choir, compared to other forms of entertainment.
I also agree with the article that understanding the blend of voices is best "when you are singing in the midst of the action" rather than on a recording. But also, that means it's hard to gain familiarity with specific songs or genre-specific styles, which is another barrier to entry.
I think there’s a big issue with the recording style used for choral music. It tends to be recorded with a far mic in an echoey room which gives the experience of hearing it in church, but I think close micing the individual sections would give more of a sense of being in the choir and really help make everything more distinct. I don’t know any choral music recorded this way, but I know that one of Tony Banks’ (keyboard player for Genesis) orchestral suites was recorded this way which I think worked well.
A recent recording of Obrecht masses had close mic, recorded in a studio usually used for pop music with very little echo, with one voice per part [1]. The effect really is quite startling. The last time choral music was recorded like this was (coincidentally another Obrecht mass) more than 30 years ago [2].
I think a lot of vocal music written around 1500 would benefit from this approach. It has been remarked that this is really a sort of sacred chamber music rather than music requiring a huge choir. The music moves too fast and it's very difficult for a big choir in a very resonant space to do Obrecht, Josquin and friends full justice.
I completely agree that one-per-part singing really brings out the beauty in 16th century choral music. I sing in a choir that specializes in music of this period, and while our live performances usually use two singers per part to fill a room, our recordings are more often one-per-part with relatively close micing.
We do record in churches because we like the reverb, so it's not quite the dry studio sound you're describing, but we do prioritize a clear sound stage where all of the parts can be clearly heard.
We've found that a Blumlein mic configuration (two figure-8 pattern microphones placed at a 90 degree angle from each other) helps to create this clarity of texture, where all the parts can be heard individually across the stereo image, especially when listening with headphones. I can't take credit for this idea though: we learned it from the sound engineer who records the Tallis Scholars, who told us that they record in this configuration.
Here are a couple examples of tracks recorded using this style:
That Byrd is very nice! The individual voices came across very well on
my IEMs.
I'm used to reverb as well, and the complete lack of reverb in these
recordings still sound a little weird to me, as if they are singing in
a closet. But even in the 15th and 16th century vocal polyphony was
likely performed (often?) in places other than the resonant nave or
choir of a large church. I read that aristocratic (or ecclesial)
patrons would have singers perform in private chambers, and
performance of votive masses at a private chapel to the side of main
space in the church would have very different (and quite dry)
acoustics.
Ha, I don't know much about Dolby Atmos and spacial placement. But from prior experience I'm somewhat skeptical about what this kind of clever DSP can do for choral music.
For example, when I learned about convolution reverb, and how it should theoretically be able to simulate the unique reverb pattern of any room, I was initially excited about the possibilities. But after trying it I was underwhelmed.
That said, I'm open to being convinced. If you know of any compelling demos of this kind of spatial placement, I'd be interested to see.
I had not heard of Nonsuch Palace, despite having a passing interest in Henry VIII and certainly a large interest in Tallis! Is it thought that Spem was performed there?
Atmos on earphones is done by manipulating the waveform that reaches the eardrum to reproduce the distinctive impulse response due to the sound bouncing off different parts of the ear as it arrives. (Come to think of it I guess that's really also a form of convolutional reverb.) I think it's cool that it can be done on earphones at all, and with head tracking the effect can be noticeable at least, but I don't think it really adds much. I find earphone listening sort of envelopingly directionless in a special way of its own that I enjoy anyway.
On a multi-speaker separates system, though, I think it's done simply by attenuating the signal to each speaker. Whether it's just that or something more sophisticated, the effect is much stronger and adds a lot more to the experience. A good system can place sounds clearly anywhere within a full dome enclosing the listener. The problem is that very few people have such a system, so the audience isn't huge. (That said, Apple Music heavily promotes spatial audio, so an Atmos Spem in Alium might reach more people just from search placement...)
What Atmos adds beyond surround sound (which itself offers untapped opportunities for Spem in Alium) is:
* It carries independent position data for up to 100 tracks, which can be edited (so you could experiment with the placement).
* It adapts to the set of speakers available at playback, rather than having a fixed track per speaker.
* It works on earphones, to some extent at least.
* It has vertical as well as planar positioning, so the "balconies" would work.
I don't know of any renaissance choral music available in Atmos. Most of Deutsche Gramaphon's new recordings use it, so there might be some good classical examples there. A listening room should have general demos that would show the effect off.
I think the Nonsuch Palace thing is just a suggestion rather than anything strongly historical. Wikipedia mentions it [1]:
> This account is consistent with the catalogue entry at Nonsuch Palace: Arundel House was the London home of Henry FitzAlan, 19th Earl of Arundel; Nonsuch Palace was his country residence. Nonsuch had an octagonal banqueting hall, which in turn had four first-floor balconies above the ground floor; on this supposition it could have been the case that Tallis designed the music to be sung not only in the round, but with four of the eight five-part choirs singing from the balconies.
I want a recording of Spem in Alium done with a mic per singer, placed spatially using Dolby Atmos and arranged as they might have been in the octagonal banqueting hall of Nonsuch Palace: surrounding the audience (in the round) and with four of the eight choirs up on balconies.
(Say what you want about "spatial audio" on earphones - if you're lucky enough to have a good home cinema separates system it's awesome, and this would be the ultimate application for it IMO.)
i think is also matter where you listen it. i think its very dull, but in a good church or room with a choir who is used to that specific place suddenly its like magic.
Company I worked at back then used XMPP. There was something that you could paste into the chat that would make all of the Mac clients crash, and to fix it, someone with a different client would have to join the chat and type a lot of comments to flood the history.
I am not surprised to hear the protocol is an abomination.
Yeah, there was a similar bug in HexChat and other (pango?) stuff some years back. I remember even though I was using irssi, it could crash my Termite window.
Taking this moment to promote 1-bit art! I run a couple accounts which promote 1-bit art and I’m trying to figure out how to expand what artwork is included. These are just personal accounts that retweet art from 1-bit artists on BlueSky and Twitter.