open-index/open-npm huggingface dataset:
npm package: @scorecard-app/types
Description: Shared TypeScript types used across the mobile app, web app and backend.
Latest version: 0.1.6

# @scorecard-app/types

Shared TypeScript types used across the mobile app, web app and backend.

## Purpose
This package centralizes domain types to ensure consistency between frontend and backend.

## Usage
npm i @scorecard-app/types

## What belongs here
- Domain entities
- API contracts (inputs/outputs)
- Enums and shared constants

## What does NOT belong here
- Database models
- ORM schemas
- Business logic
- Framework-specific code
npm package: @scorelabs/core
Description: Core logic and models for ScoreLabs music notation
Latest version: 1.1.0

# @scorelabs/core

Core logic and models for ScoreLabs music notation and processing. This package provides the foundational data structures and algorithms used across the ScoreLabs ecosystem, including the `Note` and `NoteSet` models, instrument definitions, and MusicXML importing capabilities.

## Installation

```bash
npm install @scorelabs/core
```

## Features

- **Comprehensive Music Models**: Strongly typed classes for `Score`, `Part`, `Staff`, `Measure`, `NoteSet`, `Note`, `Pitch`, and more.
- **MusicXML Import**: Robust `MusicXMLParser` to convert MusicXML files into ScoreLabs models.
- **Type Safety**: Written in TypeScript with complete type definitions.
- **Modular Architecture**: Designed to be platform-agnostic (Node.js and Browser).

## Usage

### Importing a MusicXML File

```typescript
import { MusicXMLParser } from '@scorelabs/core';

// Assuming you have the XML content as a string
const xmlContent = `<?xml version="1.0" ... >`;
const parser = new MusicXMLParser();
const score = parser.parse(xmlContent);

console.log(`Score Title: ${score.title}`);
console.log(`Number of Parts: ${score.parts.length}`);
```

### Working with Notes and NoteSets

The core model uses `NoteSet` to represent a collection of notes at a specific point data (e.g., a chord or a single note).

```typescript
import { Duration, Note, NoteSet, Pitch } from '@scorelabs/core';

// Create a C4 quarter note
const c4 = new Note(new Pitch('C', 4), Duration.Quarter);
const noteSet = new NoteSet([c4]);

// Transpose up a whole step
const d4Set = noteSet.transpose(2);

console.log(d4Set.pitch.toString()); // "D4"
```

## Architecture

The library is organized into two main modules:

- **`models/`**: Contains the data structures representing musical elements.
  - `Score`: The root object representing a musical piece.
  - `Part`: Represents a single instrument or voice within a score.
  - `Staff`: A collection of measures for a specific part.
  - `Measure`: Contains musical events like notes, rests, and directions.
  - `NoteSet`: A grouping of simultaneous `Note` objects (chords).
  - `Note`: The fundamental musical unit containing pitch, duration, and stylistic attributes.
- **`importers/`**: logic for importing external formats.
  - `MusicXMLParser`: Converts MusicXML data into the internal object model.

## Development

1.  **Clone the repository**
2.  **Install dependencies**: `npm install`
3.  **Build**: `npm run build`

## License

MIT