Better HN
topnewbestaskshowjobs
Log inSign up

codedokode

9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions

PHP developer from Russia.
Submissions

comment 1y ago · link · parent

It seems that computer translation is not good enough to parse Pushkin's poems yet. I tried ChatGPT, the translation is at least readable, but written in a dumbed down language. Yours is not even readable.

comment 1y ago · link · parent

It is interesting that although Napoleon captured Moscow, the capital at that time was in Saint-Petersburg. Why didn't he go to the capital? This painting depicts Napoleon hopelessly waiting for a delegation from Russian Emperor with burning city in the background [1].

[1] https://commons.wikimedia.org/wiki/File:Napoleon_in_burning_...

comment 1y ago · link · parent

> you must clear the page cache

In Linux there is a /proc/sys/vm/drop_caches pseudo file that does this. Look how great Linux is compared to other OSes.

comment 1y ago · link · parent

You are right though that many DAWs do not allow to route and process parameter data (control voltages) - I notice that some plugins implement this internally, especially synths, so you can draw curves and process them inside a plugin - but I think it would be better if you didn't need every plugin developer to add a curve editor and modulators.

comment 1y ago · link · parent

I think you can find something similar in a modular synth: you can have an envelope generator that generates control voltage, and connect it to a filter cutoff frequency input.

I don't care much how it is made in other DAWs, I just tried to design a routing system for a DAW on a paper. I needed a concept that would be simple yet powerful. So I thought that we can define 3 types of data - audio data, MIDI data and automation (parameter) data. And every plugin may have inputs/outputs of these types. So if a plugin has 20 parameters, we can count them as 20 inputs. And we can connect inputs and outputs however we want (as long as the types match). Of course, we also have 3 types of clips - audio, MIDI and automation curve clips. And obviously we can process these data with plugins - so we can take a MIDI clip, connect it to a plugin that generates envelopes for incoming MIDI notes, and connect its output to a cutoff frequency of a filter. Why not?

Technically it is possible to process parameter data, we just have to deal with converting data between different formats - some plugins might have "control voltage" inputs/outputs, other allow changing parameters sample- or block-precise points. And here VST3, which has a defined model for parameter interpolation, is easier to deal with than plugin formats that do not define exact interpolation formula.

By the way now I noted a serious weakness in my model - it doesn't support per-note parameters/controllers - all parameters are global in my concept. Guess I need to think more.

Your point about modulating parameters is valid, however I am not sure if it is better to implement modulation in a host and have full control over it (what do we do if a user moves a knob when the automation is being played) or have every plugin developer to implement it themselves (like in CLAP which supports parameter modulation).

> This is not possible in VST3,

I think it is possible - the plugin gets a sequence of parameter changes from the host and doesn't care where they come from. As I remember, plugins may also have output parameters, so it is possible to process parameter data using plugins.

comment 1y ago · link · parent

> If a compiler and linker don't follow those ABIs then it would also be close to useless for compiling or linking against shared libraries.

I guess in C++ you are not supposed to link libraries produced by different compilers? Maybe you should use C-compatible interfaces in this case?

comment 1y ago · link · parent

As I understand it is better because it gives more freedom in routing parameter values. The parameter values might come not only from a MIDI controller knob directly, but from an automation curve, or from other plugin output, or from an automation track output. For example, you might combine 2 automation curves through a multiplication plugin and route the output to a plugin's parameter input.

Or you could have an automation curve that produces a sine wave, and have a MIDI knob to modulate its amplitude, and send the result to an LPF "cutoff frequency" input, so that you can control amount of modulation with a knob.

So VST3 (and CLAP) treat each parameter as an additional plugin input, which can be routed arbitrarily.

If a plugin would instead have a single MIDI input and extract controller changes from a MIDI stream, then the scenario above would be more difficult to implement (you would need to convert an output of multiplication plugin into a sequence of MIDI controller changes and combine it with other MIDI events).

Am I missing something here? Never developed a single plugin.

comment 1y ago · link · parent

> Having separate parameter queues for sample-accurate automation requires plugins to treat their parameters in a very specific way (basically, you need audio-rate buffers for your parameter values that are as long as the maximum host block) in order to be written efficiently.

Oh I forgot about parameters. In VST3, the parameter changes use linear interpolation. So the DAW can predict how the plugin would interpret parameter value between changes and use this to create the best piece-wise linear approximation for automation curve (not merely sampling the curve every N samples uniformly which is not perfect).

CLAP has no defined interpolation method, and every plugin would interpolate the values in its own, unique and unpredictable way (and if you don't interpolate, there might be clicks). It is more difficult for a host to create an approximation for an automation curve. So with CLAP "sample-precise" might be not actually sample-precise.

I didn't find anything about interpolation in the spec, but it mentions interpolation for note expressions [1]:

> A plugin may make a choice to smooth note expression streams.

Also, I thought that maybe CLAP should have used the same event for parameters and note expessions? Aren't they very similar?

> duped's comment about needing to create "dummy" parameters which get mapped to MIDI CCs is spot-on as well. JUCE does this. 2048 additional parameters (128 controllers * 16 channels) just to receive CCs. At least JUCE handles those parameters sample-accurately!

What is the purpose of this? Why does plugin (unless it is a MIDI effect) need values for all controllers? Also, MIDI2 has more than 128 controllers anyway so this is a poor solution.

[1] https://github.com/free-audio/clap/blob/main/include/clap/ev...

comment 1y ago · link · parent

If you have the source code and use JUCE then yes, you can convert the plugin to VST3. But if you don't use a framework then you need to port the code manually.

comment 1y ago · link · parent

Everything would work except for VST3, if written according to standards.

comment 1y ago · link · parent

VST3 uses proprietary events for things like note on/off and note expressions. As for MIDI controllers, the host is supposed to convert them to parameter changes.

This makes sense if you want to map a controller to a plugin parameter in a DAW. However, if you want to write a "MIDI effect", which transforms incoming MIDI data for controllers, it would be difficult.

Also it is interesting that VST3 has an event for note expression, and separate event for polyphonic pressure although it can be considered a note expression.

comment 1y ago · link · parent

No. VST2 has nothing in common with VST3 despite similar name.

comment 1y ago · link · parent

I don't think GCC has a special case for handling COM classes. However, I found that GCC uses "Itanium CXX ABI" on Linux which specifies vtable layout which accidentally might match the layout of COM classes. However, it is not guaranteered (for example, by C++ standards) that other compilers use the same layout.

comment 1y ago · link · parent

There is no single UI framework in VST. The plugin API only has interfaces for creating/destroying/resizing a GUI window. You are not required to use VSTGUI.

comment 1y ago · link · parent

Clap doesn't allow describing plugin in a manifest (like VST3 and LV2 do). This allows to scan for plugins faster.

Also, CLAP uses 3 or 4 methods to represent MIDI data (MIDI1, MIDI1 + MPE, MIDI2, CLAP events). This requires to write several converters when implementing a host.

But, CLAP is much simpler and doesn't use COM-like system (VST3 resembles a Windows COM library with endless interfaces and GUIDs).

Also, VST3 interfaces in SDK are described as C++ classes with virtual functions (example: [1]), and I wonder how do they achieve portability, if the layout for such classes (vtables) is not standardized and may differ across compilers.

[1] https://github.com/steinbergmedia/vst3_pluginterfaces/blob/3...

comment 1y ago · link · parent

Before VST3 code was under GPL3 license and GPL2 software (like LMMS) couldn't use it.

Also the license change could be caused by competition from CLAP which is very openly licensed.

comment 1y ago · link · parent

Well now he is a government so he could teach those people a valuable lesson?

> In June this year, PiS-linked media outlets leaked recordings of a 2019 phone call between Tusk and Giertych, which appears to have been made using Pegasus.

So the previous government did not respect the law?

comment 1y ago · link · parent

I wonder why Cursor chose regex approach when it is widely known that it is a wrong method. Is it a result of training on low-quality forums for beginners?

comment 1y ago · link · parent

And if you need something that is not in a spec, you have to use a library anyway. Also the point was that browser should be as simple as possible and not like a whole new OS.

comment 1y ago · link · parent

The article is written to mislead the reader, like a propaganda piece, instead of using neutral language, for example:

> Cryptomus’s Vancouver street address was home to dozens of foreign currency dealers, money transfer businesses, and cryptocurrency exchanges — none of which were physically located there.

That's absolutely normal - in US many companies are not located at the address they are registered at (for example, to pay less taxes).

> These platforms were built for Russian speakers, and they each advertised the ability to anonymously swap one form of cryptocurrency for another,

Russians are not subject to Canada laws.

> They also allowed the exchange of cryptocurrency for cash in accounts at some of Russia’s largest banks — nearly all of which are currently sanctioned by the United States and other western nations.

US "sanctions" are merely a local regulation and do not apply to Russia or other countries. The article tries to present it as if sanctions were an international law (but there is no such things as universal international law).

> anonymity or “proxy” providers

Internet anonymity is almost an universal human right.

> anonymous SMS services

What's wrong with this? Should we fill a visa application before sending an SMS?

comment 1y ago · link · parent

I don't like this. This could be implemented as a JS library. I believe browsers should provide the minimal API so that they are smaller and easier to create. As for safe alternative to innerHTML, it is called innerText.

comment 1y ago · link · parent

React is the most inefficient in terms of performance (after imgui); it recomputes everything on every event like mousemove. It was probably made for simple forms with tens of variables.

comment 1y ago · link · parent

I know about different data structures but they are all more complicated than mutable data structures. For example, if you "store only changes", it will take more time to access the data, and you need to flatten your changes once in a while.

Also, for nested data structures you need to either do path copying, or use "modification boxes" [1].

[1] https://en.wikipedia.org/wiki/Persistent_data_structure#Tech...

comment 1y ago · link · parent

I don't like the style of code in the article, with weird functions like "useState" and "useSignal". Looks ugly to me.

Also, it seems that with signals you must use immutable values only. Imagine if you have, let's say, a text document model, and you need to create a new copy every time the user types a letter. That's not going to work fast. And there will be no granular updates, because the signal only tracks the value (whole document), not its components (a single paragraph).

Also the article mentions rarely used preact and doesn't mention Vue. Vue can track mutable object graphs (for example, text document model). But Vue uses JS proxies that have lot of own issues (cannot access private fields, having to deal with mixing proxies and real values when adding them to a set, browser APIs break when a proxy is passed).

Also I don't like that React requires installing Node and compilation tools, this is a waste of time when making a quick prototype. Vue can be used without Node.

comment 1y ago · link · parent

I wonder why it is so expensive (46 cents) in Italy when other EU countries have lower prices. Taxes? Monopoly? Corruption?

And why China has cheap electricity? They don't have much oil.

Could it be that electricity price is based not on real expenses, but simply on "how much they can pay" principle?

Anyway, Western Europe stands out as a dark spot on mostly light-colored map.

comment 1y ago · link · parent

Then one need to do the calculations and decide based on that. One should also remember that the product might break so if it repays it cost over many years, there is a chance it breaks long before that.

However, LED light bulbs are worth buying, the cheap ones (less than $3) repay their price in several months even with our electricity pricing.

comment 1y ago · link · parent

Electricity is so cheap (8-9 cents per kWh), it doesn't even make sense to invest in saving it. I would any day choose a cheaper product over 20% more expensive one that uses 10% less power.
1
333435
185