User:Contribution/Chanofreq Project

Chanofreq Project

Objective: The Chanofreq project seeks to create a standardized file format that allows precise tuning of each note on every MIDI channel to a specific frequency. The aim is to achieve this using a minimalistic data structure that prioritizes efficiency and simplicity.


File Extension: .cnf

Format Name: Chanofreq

Etymology: Derived from Channel, Note, and Frequency.

File Structure

The Chanofreq format is a text-based structure comprising commands in the following format:

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, if included, should appear on the second line for quick identification without needing to scan the entire file. YAML is used, and fields are open-ended.

<meta>
YAML content
</meta>

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

Alias support

To assign an alias for a keyword (e.g., channel, note, frequency, internal,default):

@alias keyword: your_custom_alias

To remove an alias:

@unalias keyword

For assigning or removing for multiple keywords at once, use a comma-separated list:

@alias keyword1: alias1, keyword2: alias2
@unalias keyword1, keyword2

Practical example of shorthands:

@alias channel: c, note: n, frequency: f, internal: i, default: d

Comments

Inline comment:

# Inline comment

Multiline comment:

/* Multiline
comment */

Nota bene: YAML metadata only supports inline 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.

Once an alias is assigned to a keyword, it stays effective throughout the entire file until a new alias replaces it. The original keyword can still be used alongside the alias.

Validation Rules

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

Include error handling strategies (e.g., dealing with invalid note numbers, negative frequencies, or incorrect syntax), and consider different levels of error severity (warnings vs. halts).

  Todo: Case sensitivity

Clarify whether commands are case-sensitive.

  Todo: Security

Address potential security concerns related to parsing untrusted .cnf files, such as buffer overflows or malformed data exploits.

Development Roadmap

  1. File Format Specification: Draft a detailed file format specification document, incorporating input from stakeholders to ensure all use cases are covered.
  2. Research Phase: Explore existing formats, gather user requirements, and establish a foundation for design decisions.
  3. Prototyping Stage: Develop a minimal viable product (MVP) of the .cnf file parser and validator for early testing and feedback.
  4. Set up a GitHub repository: Engage initial contributors and stakeholders to participate in the development process and foster open collaboration.
  5. Feedback Loop: Refine the MVP parser and validator through extensive user testing and iterative improvements. Incorporate structured feedback mechanisms and introduce user personas and scenarios.
  6. Web Interface: Develop an online tool for easily creating .cnf files.
  7. Virtual Synthesizer: Build a basic virtual synthesizer supporting .cnf format to serve as a reference implementation for developers.
  8. Compatibility Testing: Ensure the format's compatibility with both MIDI 1 and MIDI 2 standards, as well as with common DAWs and MIDI hardware.
  9. Beta Testing and Feedback: Open a phase for musicians, developers, and other stakeholders to test the .cnf format and provide feedback.
  10. Diverse Test Group: Gather feedback not only on the format itself but also on its intuitiveness and usability for a wide range of users, including those unfamiliar with microtuning, advanced microtonal musicians, plugin developers, and hardware developers.
  11. Tools for developers: Provide ready-to-use open-source libraries in multiple languages, a simple SDK with comprehensive documentation, and reference plugins. Create tools for automatic code generation and an API for parsing .cnf files. Provide automated test suites that developers can use to verify that their implementations correctly adhere to the .cnf format.
  12. Performance Benchmarks: Ensure that both software and hardware can parse .cnf files as efficiently and quickly as possible, especially when dealing with large files or real-time tuning changes.
  13. Documentation and Tutorials: Write comprehensive documentation and tutorials, including a technical reference for developers and a user guide for musicians and other end-users.
  14. Presentation Video: Produce a compelling video to introduce the .cnf format and demonstrate the synthesizer, showcasing its utility for developers and users.
  15. Integration Testing: Perform integration testing with various free virtual instruments to ensure smooth interoperability.
  16. Collaborations: With Scale Workshop to integrate .cnf file creation. With Oddsound to support the .cnf format in their MTS-ESP plugins.
  17. 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.
  18. Advocacy: Promote the adoption of the .cnf format and MTS-ESP Multi-Channel among tuning-friendly companies.
  19. Standardization Bodies: Engage with standardization bodies like MIDI Manufacturers Association (MMA) to discuss potential standardization of the format or its inclusion in future MIDI specifications.
  20. Partnerships: Collaborate with hardware manufacturers, DAW developers, and educational institutions.

Long-Term Strategy and Maintenance

The Chanofreq project aims to ensure that version 1.0.0 is fully compatible with both MIDI 1 and MIDI 2 standards while supporting an unlimited number of channels and notes. This design guarantees that the format will remain flexible and adaptable to future technological advancements.

  Todo: Versioning Strategy
  • Develop a detailed versioning plan to manage updates during the beta testing phase leading up to version 1.0.0.
  • Ensure that version 1.0.0 is a stable and final release to minimize the need for significant updates afterward.
  • Establish clear criteria and timelines for ending the beta testing phase and officially launching version 1.0.0.
  • Implement a comprehensive strategy for handling updates post-version 1.0.0, focusing on maintaining backward compatibility.