Skip to content

Cithara is a music theory web app and Python library for exploring the relationships between notes, scales, chords, and intervals. Built with Django, DRF, and Next.js, it lets users generate and visualise scales with support for sharps/flats, and will soon support advanced queries like chord-to-scale matching.

License

Notifications You must be signed in to change notification settings

ralphmettle/cithara

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cithara

Live Site CI Status Last Commit Built with Next.js Built with Django Python version TypeScript version License

Cithara is a comprehensive music theory toolkit and exploration platform designed to help users understand and interact with musical concepts such as notes, intervals, scales, and chords. The project combines a Python core library, a Django REST API backend, and a React/Next.js frontend to provide an interactive and educational experience.


Table of Contents


Overview

The Cithara Project consists of three main parts:

  • Core Library (cithara/core): A Python library implementing music theory logic — notes, intervals, scales, chords, and related utilities. This is designed to be robust, type-annotated, and modular for easy reuse.

  • Backend API (backend): A Django REST Framework-based API that exposes the core library functionalities through HTTP endpoints. This enables external clients, such as the frontend, to query and interact with musical data.

  • Frontend Application (frontend): A React/Next.js web application that provides a user-friendly, mobile-first interface for exploring musical scales, chords, and theory relationships, powered by the backend API.


Project Structure

cithara-project/
├── cithara/              # Core Python music theory library
│   ├── core/
│   └── utils/
├── backend/              # Django REST API backend
│   ├── apps/
│   ├── config/
│   └── manage.py
├── frontend/             # Next.js frontend
│   ├── app/
│   ├── components/
│   └── public/
├── README.md
├── requirements.txt
└── package.json

Core Features

  • Note and Interval Representation: Precise handling of musical notes, accidentals, pitch classes, and intervals.
  • Scale and Chord Generation: Ability to create major, minor, diminished, augmented scales and chords.
  • Diatonic and Chromatic Relationships: Supports exploring relationships between notes and chords within scales.
  • API Access: Exposes music theory computations as RESTful endpoints.
  • Interactive Demo: Allows users to select notes, accidentals, and scales/chords to explore their structure dynamically.

Getting Started

Prerequisites

  • Python 3.12+
  • Node.js (for frontend)
  • pnpm or npm/yarn package manager

Backend Setup

cd .
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

Frontend Setup

cd frontend
pnpm install
pnpm dev

Usage

  • Visit the frontend at http://localhost:3000 (or your deployed URL).
  • Use the interface to select root notes, accidentals, and scale types.
  • Submit selections to fetch scale data dynamically from the backend.
  • Explore generated scales and chords with interactive visual components.

Development

  • Follow test-driven development practices; tests live primarily in the backend tests/ directory.
  • Backend API is built with Django REST Framework.
  • Frontend uses React with Next.js and Tailwind CSS for styling.
  • Core library is standalone Python code designed for reuse or extension.
  • Use GitHub Actions for CI/CD including linting and type checks.

Technologies Used

  • Python 3.12, Django, Django REST Framework
  • TypeScript, React, Next.js, Tailwind CSS
  • Docker (planned)
  • GitHub Actions for CI/CD

Contributing

Contributions are welcome! Please fork the repository and submit pull requests with clear descriptions and tests where applicable :3


Roadmap / To Be Completed

  • Core Library: Add more scale and chord types, refine enharmonic logic, improve documentation, MIDI support.
  • Backend API: Expand endpoint coverage and feature set, add authentication and rate limiting, implement caching.
  • Frontend: Build comprehensive UI with more interactive components, better error handling and display, mobile optimisation, and potential user onboarding for full online Cithara app.
  • Deployment: Set up CI/CD for backend and make backend deployment for site interactivity.
  • CLI Tool: (Planned) Add a command-line interface for users to interact with the library directly.
  • Documentation Site: Develop detailed user and developer documentation, tutorials, and example projects.

License

This project is licensed under the GNU General Public License v3.0 (GNU GPLv3).


Created and maintained by Ralph Mettle

About

Cithara is a music theory web app and Python library for exploring the relationships between notes, scales, chords, and intervals. Built with Django, DRF, and Next.js, it lets users generate and visualise scales with support for sharps/flats, and will soon support advanced queries like chord-to-scale matching.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published