Open bgruber opened 7 years ago
I think this is a note-parser package issue. <Synth />
and <Monosynth />
both use parser.freq and it seems like depending on what kind of syntax you're using it works on some environments where in other it doesn't (In my case, i was working on a react app using create-react-app)
I had to move the entire react-music src/ folder to inside of my react project and had to switch out all the import parser from 'note-parser'
to var parser = require('parser')
and now it seems like it's working! Not elegant but a workaround for now.
Inside my apps
import {
Analyser,
Song,
Sequencer,
Sampler,
Synth,
} from '../ReactMusic';
Inside Monosynth, Synth
var parser = require('note-parser');
It's not the right solution but it works temporarily for me if I change line 128 in node_modules/react-music/lib/components/synth from this:
// osc.frequency.value = _noteParser2.default.freq(transposed);
to this:
osc.frequency.value = _noteParser2.freq(transposed);
_noteParser2.default is undefined
Would be nice if that could be fixed in a new release.
Is there an update on this?
Is there an update on this?
It's not the right solution but it works temporarily for me if I change line 128 in node_modules/react-music/lib/components/synth from this:
// osc.frequency.value = _noteParser2.default.freq(transposed);
to this:
osc.frequency.value = _noteParser2.freq(transposed);
_noteParser2.default is undefined
Would be nice if that could be fixed in a new release.
This worked for me 👍!
Hi!
Synthesizers work great for me in the demo project. However, when I add react-music as a dependency to another project, I'm unable to use Synth or Monosynth, seemingly because of an error using note-parser:
The Sampler instrument works fine.