Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DecentSampler Unofficial XML schema

💡 Check your presets right now with DSLint: dslint.fly.dev

Let's make .dspreset editing... Decent!

Making virtual instruments for DecentSampler eventually means some tedious editing of the XML-based .dspreset files by hand...

However, if you use a text editor that supports XML schemas, you can super-charge your editing experience:

  • Use context-aware code completion and suggestions: Code completion screencast

  • See documentation by hovering over a keyword: Code completion screencast

  • Spot errors with tags, attributes, structure, and incorrectly formatted values: Code completion screencast

How do I use this?

Option 1: GitHub Codespaces

Press this button on the GitHub page to create a new codespace:

GitHub Codespace creation button

You will receive a VS Code editor inside your browser. If you use Firefox and open local files, you might need to save the files to the codespace before the schema autocompletion kicks in.

Option 2: Setup in VS Code

Install Red Hat's XML editing extension.

Try it out!

Paste the following contents in a new text file:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://raw.githubusercontent.com/praashie/DecentSampler-schema/main/DecentSampler.xsd" ?>
<DecentSampler >
    <ui width="812" height="375">

    </ui>
    <groups>
        <group>

        </group>
    </groups>
</DecentSampler>

Place your cursor inside the <group> tag, and hit Ctrl+Space to trigger suggestions!

Edit an existing .dspreset with the schema

You can copy the <?xml-model ...?> line inside another .dspreset file to activate the schema. This will also work with some online XML validation tools.

Associate the schema with all *.dspreset files

⚠️ If you have trouble with this, use the previous section's xml-model line as a workaround.

Open your settings.json (instructions here), and copy the following settings inside it:

{
    "xml.fileAssociations": [
        {
            "pattern": "**/*.dspreset",
            "systemId": "https://raw.githubusercontent.com/praashie/DecentSampler-schema/main/DecentSampler.xsd"
        }
    ]
}

A ...schema? Huh?

An XML Schema Definition (XSD) is a standard way to describe the expected structure of an XML document.

Credits

Thanks to David Hilowitz for his exciting DecentSampler project. This schema has been mostly based on the DecentSampler file format documentation: https://www.decentsamples.com/docs/format-documentation.html

This schema was kickstarted and edited with the VS Code extension XML by Red Hat. Impressive XSD-based code completion features are the main inspiration for developing this schema in the first place.

About

XML schema for DecentSampler preset files

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors