chip-player-js icon indicating copy to clipboard operation
chip-player-js copied to clipboard

Discrete voice audio routing

Open javigaralva opened this issue 5 years ago • 4 comments

Export channels to wav files could be a nice feature. Could be possible to do that? Currently I try to do this job with RYMCast, but the channels completely panned to the right, generate an empty wav file.

Thanks for this amazing project

javigaralva avatar Aug 27 '19 06:08 javigaralva

Basically need 2 things in order to do this...

  • refactor audio output to a generic interface, which could be either a file writer or WebAudio context. Medium difficulty.
  • expose discrete voices (write to an audio buffer for each voice) outside of each player engine. The player engines are all designed for internal mixing, and write to stereo audio buffer only. Very difficulty.

Getting discrete voices in some common interface would have other benefits, like being able to show an oscilloscope for each channel, but it requires modifying the engines. The problem with modifying the engines is that (1) they each do things differently, so the work doesn't scale very well and (2) it makes things (more) brittle since they will diverge from upstream improvements.

I would like to see how Modizer handles this :)

mmontag avatar Sep 01 '21 03:09 mmontag

It looks like Modizer only does this where the engine already supports it.

https://github.com/yoyofr/modizer/blob/master/src/ModizMusicPlayer.mm

see

  • m_voicesdataavail=
  • m_voice_buff_ana
  • //copy voice data for oscillo view

edit: actually Modizer makes deep modification to emulation cores:

https://github.com/yoyofr/modizer/commit/cf117601dd9909b1635b99650df6537f0450b92c#diff-7390462695712dbe8460edcaab01bd6597b9d920f20a15211b0172acc8ceb4df

mmontag avatar Sep 01 '21 19:09 mmontag

Furnace Tracker provides another example of emulation cores being modified to expose discrete channel output:

https://github.com/search?q=repo%3Atildearrow%2Ffurnace+oscilloscope&type=commits&s=committer-date&o=asc

mmontag avatar Aug 14 '23 00:08 mmontag

See also: https://github.com/tildearrow/furnace/discussions/1361 https://github.com/tildearrow/furnace/discussions/1355

mmontag avatar Dec 13 '23 01:12 mmontag