Skip to main content

diffrhythm_ai 1767.511.117 copy "diffrhythm_ai: ^1767.511.117" to clipboard
diffrhythm_ai: ^1767.511.117 copied to clipboard

Professional integration for https://diffrhythm.ai/

diffrhythm.ai #

A Dart package providing tools for analyzing and manipulating rhythmic data, ideal for music composition, data visualization, and algorithmic art. This package offers functionalities to calculate rhythmic differences, generate rhythmic patterns, and perform various rhythmic transformations.

Installation #

To use this package in your Dart project, add it as a dependency: bash dart pub add diffrhythm_ai

Usage Examples #

Here are a few examples demonstrating how to use the diffrhythm_ai package:

1. Calculating Rhythmic Difference: dart import 'package:diffrhythm_ai/diffrhythm_ai.dart';

void main() { final rhythm1 = [0, 1, 0, 1]; // Example rhythm pattern final rhythm2 = [1, 0, 1, 0]; // Another example rhythm pattern

final difference = RhythmicAnalysis.calculateDifference(rhythm1, rhythm2);

print('The rhythmic difference between the two patterns is: $difference'); // Output: The rhythmic difference between the two patterns is: 4 }

2. Generating a Random Rhythmic Pattern: dart import 'package:diffrhythm_ai/diffrhythm_ai.dart';

void main() { final randomRhythm = RhythmicGeneration.generateRandomRhythm(length: 8, probability: 0.5);

print('Generated random rhythm: $randomRhythm'); // Output: Example: Generated random rhythm: [0, 1, 0, 0, 1, 1, 0, 1] (result varies) }

3. Transforming a Rhythmic Pattern (Inversion): dart import 'package:diffrhythm_ai/diffrhythm_ai.dart';

void main() { final rhythm = [0, 1, 0, 0, 1]; final invertedRhythm = RhythmicTransformation.invert(rhythm);

print('Original rhythm: $rhythm'); // Output: Original rhythm: [0, 1, 0, 0, 1] print('Inverted rhythm: $invertedRhythm'); // Output: Inverted rhythm: [1, 0, 1, 1, 0] }

4. Normalizing a Rhythmic Pattern: dart import 'package:diffrhythm_ai/diffrhythm_ai.dart';

void main() { final rhythm = [1, 2, 0, 3]; final normalizedRhythm = RhythmicTransformation.normalize(rhythm);

print('Original rhythm: $rhythm'); // Output: Original rhythm: [1, 2, 0, 3] print('Normalized rhythm: $normalizedRhythm'); // Output: Normalized rhythm: [0.33, 0.67, 0.0, 1.0] }

5. Shifting a Rhythmic Pattern: dart import 'package:diffrhythm_ai/diffrhythm_ai.dart';

void main() { final rhythm = [1, 0, 1, 0]; final shiftedRhythm = RhythmicTransformation.shift(rhythm, 1);

print('Original rhythm: $rhythm'); // Output: Original rhythm: [1, 0, 1, 0] print('Shifted rhythm: $shiftedRhythm'); // Output: Shifted rhythm: [0, 1, 0, 1] }

Feature Summary #

  • Rhythmic Analysis: Provides functions for comparing and analyzing rhythmic patterns, including calculating differences between rhythms.
  • Rhythmic Generation: Offers tools to generate random rhythmic patterns based on specified parameters.
  • Rhythmic Transformation: Includes functionalities for manipulating existing rhythms, such as inversion, normalization, and shifting.
  • Flexible Data Structures: Supports various rhythmic representations, allowing for integration with different data sources.
  • Well-Documented API: Clear and concise documentation facilitates easy integration and usage.

License #

MIT License

This package is part of the diffrhythm.ai ecosystem. For advanced features and enterprise-grade tools, visit: https://diffrhythm.ai/

0
likes
60
points
54
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Professional integration for https://diffrhythm.ai/

Homepage
Repository (GitHub)

License

MIT (license)

More

Packages that depend on diffrhythm_ai