A Git-based artifact library for the Hydrogen drum machine. This repository is an example for a decentralized, versioned collection of Hydrogen artifacts (drumkits, patterns, and songs) with automatic index generation via CI/CD. Fork it and add your own artifacts to provide your own, personal online library!
This repository serves as a template library using which users can share their own Hydrogen artifacts. When artifacts are added to the repository, a GitLab CI pipeline automatically:
- Scans all
.h2drumkit,.h2pattern, and.h2songfiles (can be located both at top-level and in arbitrary subfolders) - Extracts metadata from each artifact
- Generates a structured
index.jsonfile with permalinks - Deploys the index to a dedicated
librarybranch
Users can then configure their Hydrogen application to consume artifacts from this library using the permalink to the index.json file.
.h2drumkit— Hydrogen drumkit archives (tar format containing drumkit.xml).h2pattern— Hydrogen pattern files.h2song— Hydrogen song files
Supports formats as old as Hydrogen version 0.9.3.
- Fork and clone this repository
- Add push permission for CI runner using the settings of your forked repo Setttings > CI/CD > Job token permissions > Check "Allow Git push requests to the repository"
# Add your artifacts
git add drumkits/your-kit.h2drumkit
git add patterns/your-pattern.h2pattern
git add songs/your-song.h2song
# Commit with a descriptive message
git commit -m "Add acoustic jazz drumkit and basic patterns"
# Push to your fork
git push origin mainThis repository supports both GitLab CI and GitHub Actions for automatic index generation. Choose the platform that matches your hosting platform.
The GitLab CI pipeline (.gitlab-ci.yml) automatically processes artifact additions:
- Build — Compiles the
hydrogen-indextool from the submodule - Index — Scans artifacts and generates
index.jsonwith metadata and permalinks - Deploy — Pushes
index.jsonto thelibrarybranch
The pipeline runs automatically on:
- Pushes to
mainormasterbranches - Merge requests that are merged into
mainormaster
- Enable CI/CD in your repository settings
- Configure job token permissions:
- Go to Settings > CI/CD > Job token permissions
- Check "Allow Git push requests to the repository"
The GitHub Actions workflow (.github/workflows/build-and-deploy-index.yml) provides equivalent functionality:
- build-indexer — Compiles the
hydrogen-indextool from the submodule - generate-index — Scans artifacts and generates
index.jsonwith metadata and permalinks - deploy-index — Pushes
index.jsonto thelibrarybranch
The workflow runs automatically on:
- Pushes to
mainormasterbranches - Manual workflow dispatch (via GitHub Actions UI)
- Enable Actions in your repository settings
- Grant write permissions:
- Go to Settings > Actions > General > Workflow permissions
- Select "Read and write permissions"
- Check "Allow GitHub Actions to create and approve pull requests"
Both CI systems run automatically on:
- Pushes to
mainormasterbranches - Merge requests/pull requests that are merged into
mainormaster
| Feature | GitLab CI | GitHub Actions |
|---|---|---|
| Configuration | .gitlab-ci.yml |
.github/workflows/build-and-deploy-index.yml |
| Artifact Storage | Built-in artifacts | Built-in artifacts |
| Deployment Auth | CI_JOB_TOKEN | GITHUB_TOKEN |
| Manual Trigger | Via pipeline UI | Via workflow_dispatch |
| Permissions | Job token scope settings | Workflow permissions |
| Permalink Format | gitlab.com/namespace/repo/-/raw/branch/... |
github.com/namespace/repo/raw/branch/... |
| Setup Complexity | Medium | Low |
Choosing a Platform:
- GitLab CI: Use if your repository is hosted on GitLab
- GitHub Actions: Use if your repository is hosted on GitHub
- Both provide identical functionality for this use case
The index.json file contains:
- Metadata for each artifact (name, author, license, version, etc.)
- SHA-256 hashes for integrity verification
- Permalinks to each artifact in the repository (platform-specific URLs)
- Self-hash of the index file for validation
Example structure:
{
"version": "0.1.0",
"created": "2026-05-25T09:57:55",
"patternCount": 4,
"songCount": 17,
"drumkitCount": 3,
"patterns": [...],
"songs": [...],
"drumkits": [
{
"type": "drumkit",
"name": "TR808EmulationKit",
"url": "https://github.com/namespace/repo/raw/library/drumkits/TR808EmulationKit.h2drumkit",
"hash": "abc123...",
"author": "Author Name",
"license": "CC BY",
"instruments": 12,
"samples": 12
}
],
"hash": "self-hash-of-index-file"
}Note: The url field format differs by platform:
- GitLab:
https://gitlab.com/namespace/repo/-/raw/library/path/to/artifact - GitHub:
https://github.com/namespace/repo/raw/library/path/to/artifact
After your artifacts are merged, the index.json is available at:
GitLab:
https://gitlab.com/<namespace>/<repository>/-/raw/library/index.json
GitHub:
https://github.com/<namespace>/<repository>/raw/library/index.json
Replace <namespace> and <repository> with your project's path.
In the Hydrogen application, add the library permalink:
- Open an "Online Import" dialog
- Hit the "Sources" button and select "Add Source"
- Add a new library with the permalink to
index.json - Hydrogen will now be able to browse and download artifacts from this library
GitLab Example:
https://gitlab.com/theGreatWhiteShark/hydrogen-online-library/-/raw/library/index.json
GitHub Example:
https://github.com/theGreatWhiteShark/hydrogen-online-library/raw/library/index.json
To generate the index locally without running the full CI pipeline:
# Ensure the submodule is checked out
git submodule update --init --recursive
# Build the hydrogen-index tool
cd hydrogen-index
go build -o ../hydrogen-index .
cd ..
# Generate the index (GitLab permalinks)
./hydrogen-index scan \
--provider gitlab \
--repo theGreatWhiteShark/hydrogen-online-library \
--branch library \
--output index.json \
--exclude hydrogen-index
# OR generate the index (GitHub permalinks)
./hydrogen-index scan \
--provider github \
--repo theGreatWhiteShark/hydrogen-online-library \
--branch library \
--output index.json \
--exclude hydrogen-index
# Validate the generated index
./hydrogen-index validate index.jsonFor GitLab:
./hydrogen-index scan \
--provider gitlab \
--repo namespace/repository \
--branch library \
--output index.json \
--exclude hydrogen-indexFor GitHub:
./hydrogen-index scan \
--provider github \
--repo namespace/repository \
--branch library \
--output index.json \
--exclude hydrogen-indexFor relative paths (no permalinks):
./hydrogen-index scan --output index.json --exclude hydrogen-indexIf the CI pipeline fails:
GitLab:
- Check the pipeline logs in GitLab CI/CD
- Verify artifact files are valid Hydrogen formats
- Ensure the submodule is properly initialized
- Check for XML parsing errors in artifact metadata
- Verify job token permissions are enabled
GitHub:
- Check the workflow logs in GitHub Actions
- Verify artifact files are valid Hydrogen formats
- Ensure the submodule is properly initialized
- Check for XML parsing errors in artifact metadata
- Verify workflow permissions are set to "Read and write"
If the library branch doesn't update:
GitLab:
- Verify the pipeline completed successfully
- Check that changes were pushed to
mainormaster - Ensure the
deploy-indexjob has proper Git permissions - Review the deploy job logs for authentication errors
- Check job token scope settings
GitHub:
- Verify the workflow completed successfully
- Check that changes were pushed to
mainormaster - Ensure workflow permissions include write access
- Review the deploy job logs for authentication errors
- Check that Actions are enabled in repository settings
If artifacts fail to parse:
- Open the artifact in Hydrogen to verify it's valid
- Check XML syntax in drumkit.xml files
- Ensure all referenced samples exist in drumkit archives
- Validate format version is supported (>=0.9.3)
This repository is licensed under GPLv3, consistent with the Hydrogen project.
Individual artifacts may have different licenses as specified in their metadata.
For issues or questions:
- Open an issue in this repository or hydrogen-index
- Check the Hydrogen forum
- Review the hydrogen-index documentation