Skip to content

Piano samples sound as Harmonika #173

@JanVeb

Description

@JanVeb

Hi there, reply interesting library, using Howler at the moment and decided to try Pizzicato because of reverb function.

I was sucesfull in making Pizzicato playing midi file with piano samples, which in Howler sound normal, but in Pizzicato they sound as though its harmonica playing. How can I control this>

Also when adding reverb effect, sound gets really deformed and it stoped playing altogether after few seconds.

How I implemented Pizzicato:


import Pizzicato from 'pizzicato';

const m21 = new Pizzicato.Sound({
  source: 'file',
  options: { path: 'assets/Yamahac3/mcg_mf_021.mp3' },
});
const m22 = new Pizzicato.Sound({
  source: 'file',
  options: { path: 'assets/Yamahac3/mcg_mf_022.mp3' },
});
const m23 = new Pizzicato.Sound({
  source: 'file',
  options: { path: 'assets/Yamahac3/mcg_mf_023.mp3' },
});
...
let midiToHowl = {
  21: m21,
  22: m22,
  23: m23,
...
}

var reverb = new Pizzicato.Effects.Reverb({
  time: 1,
  decay: 0.8,
  reverse: true,
  mix: 0.5,
});

function OsmdNoteOn() {
  let noteName = midi.tracks[0].notes[noteIndex];

  noteName = midiToHowl[midi.tracks[0].notes[noteIndex]['midi']];


  noteName.stop();
  //   noteName.addEffect(reverb);
  noteName.play();

  setTimeout(
    () => noteName.stop(),
    midi.tracks[0].notes[noteIndex]['durationTicks'] * 4
  );

  setTimeout(
    () => OsmdNoteOn(),

    (midi.tracks[0].notes[noteIndex + 1]['ticks'] -
      midi.tracks[0].notes[noteIndex]['ticks']) *
      2
  );
  if (noteIndex + 2 <= midi.tracks[0].notes.length) {
    noteIndex++;
  } else {
    noteIndex = 0;
    console.log(
      '🚀 ~ file: howlerPlay.js ~ line 222 ~ OsmdNoteOn ~ noteIndex',
      noteIndex
    );
  }

}


How could I implement reverb and to make piano samples sound like Piano?

Thank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions