Programming thread

FFMPEG's filter_complex should be able to do everything that script does in principle. By "in principle", I mean that I don't think there's anything like your Perlin distorter currently in the built-in filters, but it could be implemented.

Some equivalent filter names:

cull_color is colorkey
add_saturation is eq=saturation=0.98
overlap_visual is overlay
For audio mixing, use adelay and amix

https://ffmpeg.org/ffmpeg-filters.html -- full list of what FFMPEG offers here.
Something I use all the time is
Bash:
ffmpeg -i video.mp4 -ss 00:01:23.456 -to 00:02:34.567 -map 0 out.mp4
to trim videos to between the specified timestamps. You can also use -t $DURATION instead of -to $TIME to trim to the given duration, starting from the -ss time. Keep in mind using -c copy with this results in weird files that may start playing a few seconds prior to the desired start time in some players. It does cut out most of the surrounding data, but it seems to leave those little bits of padding.

On the topic of filters:
Bash:
ffmpeg -i audio.wav -af astats -f null -
is also super handy to check for positive peak dB values in 32-bit wavs before dithering down to 24-bit. I wish more software would support the new 32-bit flacs, but most don't.

Edit:
Bash:
ffmpeg -i audio.wav -af volumedetect -f null -
will also give you the overall peak and RMS values. Though astats is a lot more verbose and even gives per-channel stats along with the overall. I like that astats measures DC offset too.
 
Last edited:
I wish more software would support the new 32-bit flacs, but most don't.
Most software has no notion of an over-unity sample. IDK if Sox is still like this, but last I used it, but everything over unity got truncated. And given all that Sox can do, it's almost an egregious example. Integer-assuming software still has value. Just keep an integer-formatted version around for consumption. 16-bit is fine, especially if you've got floats for masters. And can I recommend the Zam plugins Maximizer as a Limiter? It's almost magical and I love it.
 
  • Thunk-Provoking
Reactions: Evil Whitey
Most software has no notion of an over-unity sample. IDK if Sox is still like this, but last I used it, but everything over unity got truncated. And given all that Sox can do, it's almost an egregious example. Integer-assuming software still has value. Just keep an integer-formatted version around for consumption. 16-bit is fine, especially if you've got floats for masters. And can I recommend the Zam plugins Maximizer as a Limiter? It's almost magical and I love it.
It's more a minor gripe I have when dealing with converting large numbers of wav samples to flac for storage savings. If you deal with audio at the level I do, losing that extra bit of dynamic range (ignoring any clipping that results, which is its own problem) can make a big difference. So currently I have a zsh script that normalizes the peak to around -0.2 dBFS before dithering down to 24-bit flac. That way, I can avoid messing with dynamics with limiting.

In reality, 24-bit gives you more than enough range for most, if not all, applications. The only thing is, unlike 32-bit, anything above 0 dBFS gets chopped off.
 
Last edited:
  • Agree
Reactions: analrapist
  • Like
Reactions: Marvin and y a t s
https://www.cs.cmu.edu/~dst/LispBook/book.pdf
This Common Lisp textbook is very good for beginners and has exercises in it you can work through.
CL Textbook said:
Prior to about 1984, the Lisps available on personal computers weren’t very good due to the small memories of the early machines. Today’s personal computers often come with several megabytes of RAM and a hard disk as standard equipment.
Copyright 1990.

It's funny how it really wasn't that long ago when a drive with a capacity of a few MB had to be loaded by several men onto a plane.
 
inside.png
>Be assigned to new project
>Code is in python
>Look inside
>They use eval to parse string to number (it's fetched from database)


I am scared
 
View attachment 7079815
>Be assigned to new project
>Code is in python
>Look inside
>They use eval to parse string to number (it's fetched from database)


I am scared
another example showing why no programming language will ever be clean or simple enough to stop pajeets from making horrible abominations
 
It's funny cause you're right.
Sounds like they would love the horrendous JS type conversions I demonstrated earlier
They gonna love anything to justify employment. It's second project in a row now, that I feel exists just for a sake of existing.
It's such a bizarre experience. There is almost nothing that could be done of value. Anything substantial is provided by OSS, the rest is just a ducktape.

I really feel like quitting IT, and going back to University.
 
They gonna love anything to justify employment. It's second project in a row now, that I feel exists just for a sake of existing.
It's such a bizarre experience. There is almost nothing that could be done of value. Anything substantial is provided by OSS, the rest is just a ducktape.
corporations love independently solving minor variations of the same problem over and over and over again
meanwhile, the real innovations are mostly made by extremely exceptional autists and released under permissive software licenses, so the "wow i can make so much money by programming" bootcamp armies and "programmers are basically interchangeable i should just hire these really new ones" phbs can make thousands of unholy messes from it
 
I always enjoy this thread, everyone talks about weird languages and stuff.

I'm just sitting here working on my side project over lunch and being glad I no longer have to count cycles for timing. I had some projects years ago where I had an ISR that I wanted to do too much work in so I sprinkled calls to the other stuff that might need to be checked to keep it happy, including bit-banging 9600bps serial, what can I say I enjoyed not having a UART at times.

Now I've got 200MHz and 2 cores(Pico/RP2040) and my biggest problem is just figuring out how slowly to do things. Sure I CAN sample the ADC at 500kHz, but what the hell is the point. So now I sample it every 10mS, do a 16x oversample and spit out the data every 160mS for 4 channels at once, no waiting. Then interleave that with a bunch of other sensors like PWM, raw GPIO and 1-Wire. And I've still got cycles and RAM and Flash to spare. The 1-Wire is the 'slowest' which just means I kick it off and then come back 750mS later, check the results from all the temp sensors and send them along to where they go.
 
Any Ziggers in here? If so, what do you think of Zig, and would you recommend it?
It is the least niggerlicious out of the modern wave of languages. The main selling points are excellent interoperability with C (you can import C files without any retarded wrappers), a build system that uses the language itself instead of some moronic DSL such as makefiles and convenient features such as defer, option types, etc. Its tooling is far from ready, tho, and it forces you to write boilerplate for example, you need to "consume" the return value of function which amounts to putting _ = before function calls otherwise it won't compile.
 
Back