Creating Piano Music with Claude: An Experiment in Going from Stiff to Soulful

Claude writes a Python sampler to drive open-source piano samples, crafting AI piano performances with real expressive nuance.
A Reddit user documented a full experiment using Claude to create piano performances: the AI doesn't synthesize audio directly but writes a Python sampler to drive the free Salamander Grand Piano library, using precise control over note timing and dynamics to inject emotional expression. A technical quirk — notes not re-rendering when retriggered under the sustain pedal — was actually praised for adding human-like randomness. The case highlights a controllable path for AI music creation: using AI as a programming collaborator rather than a one-click generator, with real expressiveness still dependent on the human's musical sensibility and ongoing iteration.
A Reddit user shared their complete process of creating piano performances using Anthropic's Claude. The initial attempts sounded flat and mechanical, but after multiple iterations and extensive research, the result was a genuinely moving piece of piano music. This case reveals an interesting technical path for large language models in music generation — rather than synthesizing audio directly, it uses programming and a sampler to simulate real instrument performance.
Not a VST, But a Sampler Plus Code
Many people's first instinct is to ask: what VST (virtual instrument plugin) was used for that piano sound? The answer is surprising. According to the original author, the sound comes from Salamander Grand Piano — a free Yamaha grand piano sample library — while the actual "performance" is executed by a lightweight Python sampler written by Claude itself.
The elegance of this approach lies in the division of labor: the sample library provides authentic piano timbre, while Claude's code handles sustain pedal logic and adds concert hall reverb to the whole piece, giving the dry samples a sense of space and warmth.

In other words, the AI here isn't acting as a "composer" or "audio generator" — it's more like a performance engineer who happens to be fluent in code. It uses code to control the trigger timing, velocity, and duration of each note, then maps those parameters onto real piano samples.
Salamander Grand Piano is an open-source piano sample library created by Alexander Holm and released under a Creative Commons license. It's recorded from a Yamaha C5 grand piano, covers all 88 keys with 16 velocity layers, and the raw files exceed 1GB. Thanks to its excellent sound quality and completely free licensing, it's widely used with open-source samplers like LinuxSampler, FluidSynth, and SForzando, and is the go-to piano sound source for many independent music producers and open-source projects.
VST (Virtual Studio Technology) is a plugin standard developed by Steinberg that allows software synthesizers or effects processors to run inside a host DAW (Digital Audio Workstation). Unlike VSTs that depend on professional host software, Claude in this case wrote a lightweight sampler directly in Python — reading sample files and controlling note-triggering logic at the code level, bypassing any dependency on a DAW environment, so the entire workflow runs independently in a standard Python environment.
The Feeling Comes from Timing and Dynamics, Not Timbre
The original author nailed it with one observation: "Most of the feeling comes from timing and dynamics, not the sound itself."
This is really the essence of musical expression. What makes a performance moving isn't the price tag of the piano — it's the performer's subtle stretching of rhythm and their layered control of dynamics. Claude was guided to adjust these parameters: nudging certain notes slightly earlier or later, shaping phrases with gradual swells and fades, and in doing so, giving the mechanical sample playback a genuine sense of being "performed."
For anyone who wants to replicate this kind of experiment, the original author offered concrete advice:
- Dig deep into expression rather than obsessing over timbre
- For Baroque-style pieces, focus on articulation and the shaping of each phrase
- Controlling timing and dynamics through parameterization is the key to making AI performance feel alive
In music performance studies, subtle deviations in timing are called "expressive timing" — distinct from the theoretical note values written in the score. Research shows that skilled performers deliberately place certain notes tens of milliseconds early or late to highlight phrase structure or create tension. This approach is perceptually far superior to mechanically precise beat alignment, which listeners often describe as sounding "like a metronome." The same applies to dynamics — it's not just about individual note volume, but the arc of crescendos and decrescendos within a phrase (dynamic shaping). In MIDI production, fine-tuning these two dimensions is the core dividing line between "professional arranging" and "mechanical playback," and they were the primary parameters Claude was trained to refine in this experiment.
An Interesting "Bug" That Actually Sounds More Human
The comments section spotted an interesting technical detail: when a note is retriggered while still being sustained by the pedal, the sampler apparently doesn't re-render it, which occasionally causes notes to seem to "drop out."
Interestingly, the community's reaction to this flaw was positive — "somehow, this actually makes it feel more real." Real piano performance is full of imperfections; mechanically precise playback often exposes its own artificiality, while this accidental "missed note" breaks the digital rigidity and introduces a random, organic quality reminiscent of human playing.
This raises a thought-provoking point: in AI-generated content, "perfect" isn't always optimal. A degree of irregularity can sometimes be the shortcut to authenticity.
A Creative Flywheel Is Forming in the Community
This post isn't just an isolated flex — it reflects a collaborative spirit that's organically emerging among creators building around Claude.
Another user in the comments is also doing music experiments with Claude, focused on Baroque style, and shared links to their YouTube work. The two quickly fell into a mutually inspiring exchange — one saying "your work inspired me to try this," the other responding "that's great, now you've given me something to build on in return."
This positive loop — "see someone else's experiment → try it yourself → inspire them back" — is exactly the kind of low-barrier creative ecosystem that open-source sample libraries combined with general-purpose AI tools make possible. Tasks that once required a professional music production background can now be gradually achieved by everyday users through conversations with Claude, asking it to write code and iterating toward the desired result. The community also mentioned r/Claudexplorers as a dedicated space for enthusiasts to share these kinds of explorations.
What This Experiment Teaches Us
From a technical perspective, this case demonstrates a path distinct from mainstream AI music generation (such as directly outputting audio waveforms): let the AI act as the programmer, using deterministic code to drive real samples.
The advantages are strong controllability, authentic timbre, reproducibility, and ease of fine-tuning. The limitation is a heavy dependence on the user's understanding of musical expression and continuous iterative refinement — as the author noted, the first result was "very flat," and it took many attempts and research sessions to reach a satisfying outcome.
For creators, this means AI isn't a magic box that produces finished songs with one click — it's an extraordinarily capable collaborator that needs to be correctly guided. True creativity still comes from the human's understanding of music and their aesthetic judgment.
The mainstream AI music generation tools today (like Suno and Udio) take an end-to-end audio waveform generation approach, directly outputting MP3/WAV files with almost no way for users to fine-tune internal parameters. The code-driven sampling approach represented by this case is fundamentally closer to traditional MIDI production — Claude outputs structured performance instructions (notes, timing, velocity, pedaling) rather than waveforms. This method offers much greater interpretability: every note's timing and velocity has corresponding code logic that can be traced and modified, standing in sharp contrast to the "black box" model of AI-generated audio in terms of creative control.
Related articles

Workbuddy for Absolute Beginners: How a Desktop AI Agent Fits Into Real Workflows
A beginner's guide to the Workbuddy desktop AI agent: installation, claiming credits, file management, and building automated workflows—compared with CodeX for fit and cost, helping professionals shift from AI question-askers to AI managers.

OpenAI's New Agent Stack: Computer Use, Decisions API, and Ultra-Fast Workflows
OpenAI Dev Day unveiled a new agent stack: Computer Use outperforms humans, Decisions API delivers ultra-low-latency classification via Luna, Agents API opens the same Computer Use capabilities, and GPT-6.1 Sol costs only one-seventh of Astra. Core updates, benchmark data, and developer insights.

Liang Wenfeng Open-Sources DeepInfo Inference Framework, Takes On U.S. Ban
DeepSeek open-sources its DeepInfo inference framework after its models, featuring GPU/CPU cross-pipelining, small-model prediction with large-model verification, and full Huawei Ascend and NVIDIA chip support—facing the U.S. federal ban head-on. This article analyzes its significance for AI deployment and open-source strategy.