User:Contribution/Chanofreq Project

From Xenharmonic Wiki
Jump to navigation Jump to search

Chanofreq Project

Objective: The Chanofreq project aims to develop a standardized file format that allows precise tuning of each note on every MIDI channel to a specific frequency, using a minimalistic data structure.


File Extension: .cnf

Format Name: Chanofreq

Etymology: Derived from Channel, Note, and Frequency.

File Structure

A Chanofreq file is a text file containing commands with the following structure:

channel X note Y frequency Z
  • X: An integer ≥ 1, representing the MIDI channel.
  • Y: An integer ≥ 0, representing the note number.
  • Z: A 64-bit floating-point number > 0, representing the frequency in Hertz.

Commands can be separated by a semicolon (';') or a newline.

Examples:

channel X1 note Y1 frequency Z1; channel X2 note Y2 frequency Z2
channel X3 note Y3 frequency Z3

Syntax

File identification and version declaration

The first line of a Chanofreq file must declare the format and version to ensure compatibility:

chanofreq version ?.?.?

Metadata support

Metadata is optional but should be declared on the second line if included. This allows software to quickly identify metadata without scanning the entire file. All metadata fields are optional and should be enclosed in either single (') or double (") quotation marks:

/*@meta

Title: 'Your Title Here'
Author: 'Author Name'
Date: 'YYYY-MM-DD'
Description: 'Brief description of the tuning.'
Usage: 'Instructions on how to use this tuning file.'

*/

Tuning control

To define tuning for instruments controlled via MIDI, use:

channel X note Y frequency Z

For instruments with internal notes not controlled by MIDI (such as those with built-in sequencers or keyboards), use:

internal note Y frequency Z

To set a fallback frequency for any unspecified note Y across all channels and internal settings, use:

default note Y frequency Z

Comments

Inline comment:

/* Inline comment */

Multiline comment:

/* Multiline
comment */

Behavior on Loading

Upon loading a Chanofreq file, all notes start in an inactive state. As the file is read, each channel and internal command activates the specified note and assigns it the corresponding frequency. If a note that is already active is specified again, its frequency is updated to the new value provided. The same process applies to any default settings defined in the file. After processing the entire file, any notes that remain unspecified are assigned the default frequency if one is set. If no default frequency is provided, these notes remain inactive.

Validation Rules

Todo: Define more specific rules for validating the syntax and content of .cnf files.

For instance, how should errors be handled (e.g., invalid note numbers, negative frequencies)?

Development Roadmap

  1. Prototyping Stage: Develop a minimal viable product (MVP) of the .cnf file parser and validator for early testing and feedback.
  2. Web Interface: Develop an online tool for easily creating .cnf files.
  3. Virtual Synthesizer: Build a basic virtual synthesizer supporting .cnf format to serve as a reference implementation for developers.
  4. Beta Testing and Feedback: Open a phase for musicians, developers, and other stakeholders to test the .cnf format and provide feedback. Consider creating a GitHub repository or similar platform for open collaboration.
  5. Documentation and Tutorials: Write comprehensive documentation and tutorials, including a technical reference for developers and a user guide for musicians and other end-users.
  6. Presentation Video: Produce a compelling video to introduce the .cnf format and demonstrate the synthesizer, showcasing its utility for developers and users.
  7. Integration Testing: Perform integration testing with various free virtual instruments to ensure smooth interoperability.
  8. Collaboration with Scale Workshop: Work with Scale Workshop to incorporate .cnf file creation into their web interface.
  9. Collaboration with Oddsound: Partner with Oddsound to integrate the .cnf format into their MTS-ESP Mini and MTS-ESP Master plugins.
  10. Update Xen Wiki: Add a "Multi-Channel Tuning Ability" column to the List of Microtonal Software Plugins, highlighting developers who properly implement the .cnf format or MTS-ESP Multi-Channel.
  11. Advocacy: Promote the adoption of the .cnf format and MTS-ESP Multi-Channel among tuning-friendly companies.