r/pascal

SkeuoCom New Lazarus Component
▲ 49 r/pascal

SkeuoCom New Lazarus Component

Built on top of the BGRABitmap graphic engine, these components offer high-quality, anti-aliased rendering perfectly suited for simulation software, avionics dashboards, industrial control panels, and audio software interfaces (Virtual Instruments/Mixers).

🚀 Key Features

20+ Interactive Components: Ranging from simple switches to dynamic radar screens and oscilloscopes.

High-Quality Rendering: Utilizes BGRABitmap for smooth gradients, drop shadows, glowing elements, and glass reflections.

Highly Customizable: Tweak colors, value ranges, and component states directly through the Lazarus Object Inspector.

Self-Contained: Rendering is purely drawn via mathematical code and BGRABitmap (no reliance on external bitmap assets for UI logic).

Link

https://github.com/CodeInPas/SkeuoCom/tree/main

u/KangOzi — 11 days ago
▲ 13 r/pascal+3 crossposts

LibLayaX: run the Laya AI decision model inside your own app

Dear LLM developers community,

I have just released four open-source projects today that let an application use the Laya model directly, with no server and no Python.

What Laya is?

If you build agents, this is the step where you ask a big model "should I route this to billing?" and wait a second for one word. Laya answers that kind of question in a fraction of a second, on your own machine, with a probability you can put a threshold on.

Laya is an AI model that does not chat. You give it a text and a question, like "is this customer asking for a refund?", and it answers yes or no with a probability, in a fraction of a second. It can also pick one of several options, or rate something on a scale. Quick decisions, no essays.

What I released

- LibLayaX: a library you load into your own program, like any other. Windows, Linux and macOS, on the CPU or the GPU.

https://github.com/DaragonTech/LibLayaX

- RLaya, for Rust: https://github.com/DaragonTech/RLaya

- LLaya, for Lua: https://github.com/DaragonTech/LLaya

- DLaya, for Delphi and Free Pascal: https://github.com/DaragonTech/DLaya

On a laptop GPU it makes about 670 decisions per second.

Everything is MIT licensed.

Why

On Thursday I wanted to use Laya inside one of my applications and found there was no way to do it. It only came as a Python library and as a separate server program. This kind of AI belongs inside ordinary software, routing a ticket or flagging a message, and for that it has to be something an app can simply call.

How it was built

I did not write the code. Claude did. My job was to decide what we were building, guide Claude and run every version on real machines, and report back what happened.

The first version arrived within an hour and crashed on my PC. A few rounds later it worked. By the end of the first evening it ran on Windows, Linux and Mac, and on the GPU. The worst bug was on Windows on ARM, where the program simply froze. It could not be reproduced anywhere except on my actual machine, so we hunted it by adding log lines and reading where it stopped.

The second day went into the Rust and Lua versions, documentation, and testing on more machines. From my first question to Claude to this post: about 32 hours on the clock.

I could not have built this in two days by myself, and Claude could not have found those bugs without someone running the code on real hardware. It took both.

Status

Tested on five platforms and three GPUs. The docs say plainly what has not been tested yet, and test reports are welcome.

Credit

None of this would exist without two projects by other people:

- Laya itself, the model, by Nandakishor Mukkunnoth of ConvAI Innovations: https://github.com/NandhaKishorM/laya

- laya.cpp, the C++ port this is built on, by Lars Karlslund: https://github.com/lkarlslund/laya.cpp

The code and docs of the four projects above were written by Claude (Anthropic)

u/felipedaragon — 12 days ago
▲ 13 r/pascal

VertexArt – successful implementation of a pure Free Pascal FLAC encoder and WAV export in my procedural music editor.

# Procedural Music Editor in Free Pascal – Sound DnB (9)

program dnb9;

{$mode objfpc}{$H+}

{$APPTYPE CONSOLE}

uses

SysUtils,

Classes, // only for file writing and reading

Math,

glfw3, gl33,

SterilTypes, SterilMath,

SterilWindow,

FrameLimiter,

RenderTypes, RenderQueue, RenderState, ShaderCore, SimpleRenderEngine,

MiniGUI,

AL,

FlacWriter,

SynthUnit;

I'm building a procedural music editor in Free Pascal (Object Pascal). It's a sequencer + synthesizer, currently mono 44.1 kHz for easier development. It produces loops and exports them. The codebase for the export side is a single unit, `FlacWriter.pas`. It's not object-oriented – just a record and functions that take `var` parameters. This fits the DOD style of the rest of the project.

---

## Sound List – Sound DnB 9

The program contains **30 generated sounds**, organized into **5 pages**. Each sound is an independent procedure inside `SynthUnit.pas`. There are no samples, no external files, everything is synthesized at runtime.

---

## 1. DRUMS (10 sounds)

**KICK** – Deep, punchy kick. Pitch envelope from 45 Hz to 180 Hz, with a click on the attack. 40 Hz decay, 6 Hz amplitude envelope.

**SNARE** – Classic snare. 190 Hz tone plus noise. 25 Hz tone decay, 18 Hz noise decay.

**HIHAT** – Closed hi-hat. HP-filtered noise, fast 60 Hz decay.

**OPEN** – Open hi-hat. Same as above, but with a longer release, 7 Hz decay.

**CLAP** – Clap. Four bursts (0 / 8 / 16 / 24 ms) plus a tail.

**RIM** – Rimshot. 800 Hz plus noise. 180 Hz decay, 400 Hz noise.

**TOM** – Tom. Pitch envelope from 80 Hz to 200 Hz. 15 Hz pitch, 8 Hz amplitude.

**RIDE** – Ride cymbal. Four sine waves (6.5 / 7.8 / 9.2 / 11 kHz) plus noise.

**CRASH** – Crash cymbal. Wide spectrum plus shimmer. 12 and 9 kHz shimmer, 1.2 Hz decay.

**SHAKER** – Shaker. HP-filtered noise, 80 Hz decay.

---

## 2. BASS (6 sounds)

**SUB** – Pure sine at 55 Hz. Sidechained. Suited to every deep style.

**REESE** – Two detuned saws (1.01×), SVF LP cutoff with LFO. DnB, dubstep.

**808** – Pitch envelope from 40 Hz to 80 Hz, soft saturation. Trap, hip-hop, DnB.

**FMBS** – FM bass at a 2:1 ratio, index 3.0. Bass house, techno.

**WOBBLE** – LFO-filtered saw at 8 Hz, cutoff between 150 Hz and 950 Hz. Dubstep, DnB.

**ACID** – 303-style saw plus resonant SVF, Q = 3.5, cutoff envelope. Techno, acid house.

---

## 3. SYNTHETIC SOUNDS (8 sounds)

**PAD** – Three detuned saws (±0.5%), 2500 Hz LP. Ambient, trance.

**STAB** – Four detuned saws, fast release. Dub techno, DnB.

**HOOVER** – Pitch-down saw from 1.0 to 0.5, with saturation. Rave, hardstyle.

**PLUCK** – Clean sine, 10 Hz decay. Minimal, dub techno.

**BELL** – FM bell, 1.4 ratio, index 3.0. Ambient, Nanosphere.

**SUPERSAW** – Seven detuned saws (±1.8%), 5000 Hz LP. Trance, EDM, modern DnB.

**EPIANO** – FM Rhodes, with an index that decays from 2.5 to 0. House, lo-fi, jazz.

**CHORD** – Three notes at once (root + third + fifth). House, dub techno.

---

## 4. FX (5 sounds)

**RISER** – HP-filtered noise with a rising envelope. Used before transitions.

**DOWN** – LP-filtered noise with a falling envelope. Used after drops.

**IMPACT** – 40 Hz sine plus a noise burst. Used before drops.

**RVCYM** – Reversed cymbal with a rising envelope. DnB, ambient.

**SUBDROP** – Sub sweeping from 120 Hz down to 25 Hz, plus noise. Used before drops.

---

## 5. AMBIENT (1 sound)

**DRONE** – Two detuned sines (1.0025×), 0.08 Hz LFO. Nanosphere, ambient, dub techno.

---

## Parameters

Every sound receives three parameters on playback.

The **velocity** ranges from 0 to 9, which maps to a volume between 0.0 and 1.0. It can be set independently on each step.

The **length** ranges from 1 to 16 steps. It controls the duration of the sound, again per step.

The **frequency** applies to the melodic sounds only, and is computed as `MELODY[i mod 8] × multiplier`.

The **MELODY** is an eight-note scale, ranging from A1 at 55 Hz up to D3 at 146.83 Hz. Every melodic sound multiplies this scale by a fixed factor:

**Pad** ×2, so 110 Hz when `MELODY[0]` = 55 Hz.

**Stab**, **Hoover**, **Pluck**, **Supersaw**, **EPiano** and **Chord** ×4, so 220 Hz.

**Bell** ×8, so 440 Hz.

**Sub**, **Reese**, **FMBass**, **Wobble** and **Acid** stay fixed at 55 Hz and do not follow the scale.

**Drone** ×1, so 55 Hz.

---

## Pages and Content

The **DRUMS** page holds 10 sounds: Kick, Snare, Hihat, Open, Clap, Rim, Tom, Ride, Crash, Shaker.

The **BASS** page holds 6 sounds: Sub, Reese, 808, FMBS, Wobble, Acid.

The **SYNTH** page holds 8 sounds: Pad, Stab, Hoover, Pluck, Bell, Supersaw, EPiano, Chord.

The **FX** page holds 5 sounds: Riser, Down, Impact, RevCymbal, SubDrop.

The **AMBIENT** page holds 1 sound: Drone.

The grid displays 8 rows at a time; the rest is reachable with the mouse wheel.

---

## Effects on the Sounds

The sounds go through the master FX chain dry. There, in order:

First, the **sidechain** acts, but only on the bass sounds (Sub, Reese, 808, FMBS, Wobble, Acid).

Then comes the **drive**, which is oversampled tanh plus a DC blocker.

Next, the **master EQ** with three bands: low shelf at 200 Hz, peak at 3 kHz, high shelf at 6 kHz.

After that, the **reverb**, which is Schroeder-based, with adjustable size, decay and damp.

Then the **compressor** with threshold, ratio, attack, release and makeup parameters.

Then the **limiter**, using the ceiling value.

Finally, the **out gain**, the **peak normalize** stage, and the **16-bit conversion**.

u/AcanthaceaeNew774 — 12 days ago