Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piano samples sound as Harmonika #173

Open
JanVeb opened this issue Oct 11, 2022 · 0 comments
Open

Piano samples sound as Harmonika #173

JanVeb opened this issue Oct 11, 2022 · 0 comments

Comments

@JanVeb
Copy link

JanVeb commented Oct 11, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant