Skip to content

Commit

Permalink
fix: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danigb committed Dec 17, 2024
1 parent 305ca88 commit 864f120
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,21 +468,15 @@ const drums = new DrumMachine(context, { instrument: "TR-808" });
drums.start({ note: "kick" });

// Drum samples are grouped and can have variations:
drums.sampleNames; // => ['kick-1', 'kick-2', 'snare-1', 'snare-2', ...]
drums.groupNames; // => ['kick', 'snare']
drums.getSampleNames(); // => ['kick-1', 'kick-2', 'snare-1', 'snare-2', ...]
drums.getGroupNames(); // => ['kick', 'snare']
drums.getSampleNamesForGroup("kick") => // => ['kick-1', 'kick-2']

// You can trigger samples by group name or specific sample
drums.start("kick");
drums.start("kick-1");
```

Properties and functions:

- `sampleNames: string[]`: An array with all sample names of this instrument
- `groupNames: string[]`: Samples with same name are grouped (for example `tom-1.ogg` and `tom-2.ogg` are from the `tom` group). `groupNames` is an array with all groups of this drum machine
- `getSampleNamesForGroup(groupName: string) => string[]`: Return all sample names of the given group

### Smolken double bass

```js
Expand Down

0 comments on commit 864f120

Please sign in to comment.