Merge branch 'master' of https://github.com/tildearrow/furnace into command-palette

This commit is contained in:
YohananDiamond 2023-06-17 18:49:04 -03:00
commit 224577c1f5
60 changed files with 4975 additions and 5052 deletions

Binary file not shown.

Binary file not shown.

View file

@ -6,7 +6,11 @@ Furnace's wavetable editor is rather simple, you can draw the waveform using mou
Furnace's wavetable editor features multiple ways of creating desired waveform shape: Furnace's wavetable editor features multiple ways of creating desired waveform shape:
- Shape tab allows you to select a few predefined basic shapes and indirectly edit it via "Duty", "Exponent" and "XOR Point" sliders TODO: what the last two are doing? What is amplitude/phase for?) - Shape tab allows you to select a few predefined basic shapes and indirectly edit it via "Duty", "Exponent" and "XOR Point" sliders:
- `Duty` slider affects mainly pulse waves, determining its wisth, like on C64/VRC6
- `Exponent` powers the waveform in the mathematical sense of the word (^2, ^3 and so on)
- `XOR Point` determines the point where the waveform gets negated.
- TODO: amplitude/phase part
- FM is for creating the waveform with frequency modulation synthesis principles: One can set carrier/modulation levels, frquency multiplier, connection between operators and FM waveforms of these operators. - FM is for creating the waveform with frequency modulation synthesis principles: One can set carrier/modulation levels, frquency multiplier, connection between operators and FM waveforms of these operators.
- WaveTools allows user to fine-tune the waveform: scale said waveform in both X and Y axes, smoothen, amplify, normalize, convert to signed/unisgned, invert or even randomize the wavetable. - WaveTools allows user to fine-tune the waveform: scale said waveform in both X and Y axes, smoothen, amplify, normalize, convert to signed/unisgned, invert or even randomize the wavetable.

View file

@ -1,6 +1,6 @@
# samples # samples
In the context of Furnace, a sound sample (usually just referred to as a sample) is a string of numbers that hold sampled PCM audio. In the context of Furnace, a sound sample (usually just referred to as a sample) is a string of numbers that represent sampled PCM audio.
In Furnace, these samples can be generated by importing a .wav (think of it as an higher quality MP3) file. In Furnace, these samples can be generated by importing a .wav (think of it as an higher quality MP3) file.
@ -13,6 +13,7 @@ as of Furnace 0.6, the following sound chips have sample support:
- PC Engine/TurboGrafx-16/HuC6280 - PC Engine/TurboGrafx-16/HuC6280
- Amiga/Paula - Amiga/Paula
- SegaPCM - SegaPCM
- NEC PC-9801/YM2608 (ADPCM channel only)
- Neo Geo/Neo Geo CD/YM2610 (ADPCM channels only) - Neo Geo/Neo Geo CD/YM2610 (ADPCM channels only)
- Seta/Allumer X1-010 - Seta/Allumer X1-010
- Atari Lynx - Atari Lynx
@ -21,12 +22,16 @@ as of Furnace 0.6, the following sound chips have sample support:
- QSound - QSound
- ZX Spectrum 48k (1-bit) - ZX Spectrum 48k (1-bit)
- RF5C68 - RF5C68
- WonderSwan - SNES/S-DSP
- WonderSwan (second channel only)
- tildearrow Sound Unit - tildearrow Sound Unit
- VERA (last channel only) - VERA (last channel only)
- Y8950 (last channel only) - Y8950 (last channel only)
- Konami K007232 - Konami K007232
- a few more that I've forgotten to mention - Irem GA20
- Ensoniq OTTO/ES5506
- Yamaha PCMD8/YMZ280B
- MMC5 (last channel only)
## compatible sample mode ## compatible sample mode
@ -45,9 +50,9 @@ due to limitations in some of those sound chips, some restrictions exist:
- NES: if on DPCM mode, only a limited selection of frequencies is available, and loop position isn't supported (only entire sample). - NES: if on DPCM mode, only a limited selection of frequencies is available, and loop position isn't supported (only entire sample).
- SegaPCM: your sample can't be longer than 65535, and the maximum frequency is 31.25KHz. - SegaPCM: your sample can't be longer than 65535, and the maximum frequency is 31.25KHz.
- QSound: your sample can't be longer than 65535, and the loop length shall not be greater than 32767. - QSound: your sample can't be longer than 65535, and the loop length shall not be greater than 32767.
- Neo Geo (ADPCM-A): no looping supported. your samples will play at ~18.5KHz. - Neo Geo (ADPCM-A): no looping supported. your samples will play at 18.518KHz.
- Neo Geo (ADPCM-B): no loop position supported (only entire sample), and the maximum frequency is ~55KHz. - Neo Geo (ADPCM-B): no loop position supported (only entire sample), and the maximum frequency is 55.555KHz.
- YM2608: the maximum frequency is ~55KHz. - YM2608: the maximum frequency is 55.555KHz.
- MSM6258/MSM6295: no arbitrary frequency. - MSM6258/MSM6295: no arbitrary frequency.
- ZX Spectrum Beeper: your sample can't be longer than 2048, and it always plays at ~55KHz. - ZX Spectrum Beeper: your sample can't be longer than 2048, and it always plays at ~55KHz.
- Seta/Allumer X1-010: frequency resolution is terrible in the lower end. your sample can't be longer than 131072. - Seta/Allumer X1-010: frequency resolution is terrible in the lower end. your sample can't be longer than 131072.

View file

@ -3,7 +3,7 @@
a series of FM sound chips which were very popular in DOS land. it was so popular that even Yamaha made a logo for it! a series of FM sound chips which were very popular in DOS land. it was so popular that even Yamaha made a logo for it!
essentially a downgraded version of Yamaha's other FM chips, with only 2 operators per channel. essentially a downgraded version of Yamaha's other FM chips, with only 2 operators per channel.
however, it also had a drums mode, and later chips in the series added more waveforms (than just the typical sine) and even a 4-operator mode. however, it also had a [drums mode](opll.md), and later chips in the series added more waveforms (than just the typical sine) and even a 4-operator mode.
the original OPL (Yamaha YM3526) was present as an expansion for the Commodore 64 and MSX computers (erm, a variant of it). it only had 9 two-operator channels and drums mode. the original OPL (Yamaha YM3526) was present as an expansion for the Commodore 64 and MSX computers (erm, a variant of it). it only had 9 two-operator channels and drums mode.
@ -77,4 +77,4 @@ afterwards everyone moved to Windows and software mixed PCM streaming...
- only in 4-op mode (OPL3). - only in 4-op mode (OPL3).
- `5Bxy`: set KSR of operator. - `5Bxy`: set KSR of operator.
- `x` is the operator (1-4; last 2 operators only in 4-op mode). a value of 0 means "all operators". - `x` is the operator (1-4; last 2 operators only in 4-op mode). a value of 0 means "all operators".
- `y` determines whether KSR is on. - `y` determines whether KSR is on.

View file

@ -12,7 +12,11 @@ OPLL also spawned a few derivative chips, the best known of these is:
the YM2413 is equipped with the following features: the YM2413 is equipped with the following features:
- 9 channels of 2 operator FM synthesis - 9 channels of 2 operator FM synthesis
- A drum/percussion mode, replacing the last 3 voices with 5 rhythm channels - A drum/percussion mode, replacing the last 3 voices with 5 rhythm channels, with drum mode tones hard-defined in the chip itself, like FM instruments. Only pitch might be altered.
- Drum mode works like following: FM channel 7 is for Kick Drum, which is a normal FM channel but routed through mxier twice for 2x volume, like all drum sounds. FM channel 8 splits to Snare Drum and Hi-Hat. Snare Drum is the carrier and it works with a special 1 bit noise generator combined with a square wave, all possible by overriding phase-generator with some different synthesis method. Hi-Hat is the modulator and it works with the noise generator and also the special synthesis. CH9 splits to Top-Cymbal and Tom-Tom, Top-Cymbal is the carrier and only has the special synthesis, while Tom-Tom is basically a 1op wave.
- Special syntheis mentioned already is: 5 square waves are gathered from 4x, 64x and 128x the pitch of channel 8 and 16x and 64x the pitch of channel 9 and they go through a process where 2 HH bits OR'd together, then 1 HH and 1 TC bit OR'd, then the two TC bits OR'd together, and those 3 results get XOR'd.
- 1 user-definable patch (this patch can be changed throughout the course of the song) - 1 user-definable patch (this patch can be changed throughout the course of the song)
- 15 pre-defined patches which can all be used at the same time - 15 pre-defined patches which can all be used at the same time
- Support for ADSR on both the modulator and the carrier - Support for ADSR on both the modulator and the carrier
@ -60,4 +64,4 @@ the YM2413 is equipped with the following features:
- `58xx`: set DR of operator 2. - `58xx`: set DR of operator 2.
- `5Bxy`: set KSR of operator. - `5Bxy`: set KSR of operator.
- `x` is the operator (1-2). a value of 0 means "all operators". - `x` is the operator (1-2). a value of 0 means "all operators".
- `y` determines whether KSR is on. - `y` determines whether KSR is on.

View file

@ -1,6 +1,6 @@
# Yamaha YM2612 # Yamaha YM2612
one of two chips that powered the Sega Genesis. It is a six-channel, four-operator FM synthesizer. Channel #6 can be turned into 8-bit PCM player. one of two chips that powered the Sega Genesis. It is a six-channel, four-operator FM synthesizer. Channel #6 can be turned into 8-bit PCM player, that via software mixing, thanks to Z80 sound CPU, can play more than one channel of straight-shot samples at once. As of Furnace 0.6pre5, Furnace offers DualPCM, which allows 2 channels of software-mixed 8-bit PCM samples at 13750 Hz.
# effects # effects

View file

@ -316,27 +316,27 @@ void CSAADevice::_TickAndOutputStereo(unsigned int& left_mixed, unsigned int& ri
m_Noise0.Tick(); m_Noise0.Tick();
m_Noise1.Tick(); m_Noise1.Tick();
m_Amp0.TickAndOutputStereo(temp_left, temp_right); m_Amp0.TickAndOutputStereo(temp_left, temp_right);
oscBuf[0]->data[oscBuf[0]->needle++]=(temp_left+temp_right)<<4; oscBuf[0]->data[oscBuf[0]->needle++]=(temp_left+temp_right)<<3;
accum_left += temp_left; accum_left += temp_left;
accum_right += temp_right; accum_right += temp_right;
m_Amp1.TickAndOutputStereo(temp_left, temp_right); m_Amp1.TickAndOutputStereo(temp_left, temp_right);
oscBuf[1]->data[oscBuf[1]->needle++]=(temp_left+temp_right)<<4; oscBuf[1]->data[oscBuf[1]->needle++]=(temp_left+temp_right)<<3;
accum_left += temp_left; accum_left += temp_left;
accum_right += temp_right; accum_right += temp_right;
m_Amp2.TickAndOutputStereo(temp_left, temp_right); m_Amp2.TickAndOutputStereo(temp_left, temp_right);
oscBuf[2]->data[oscBuf[2]->needle++]=(temp_left+temp_right)<<4; oscBuf[2]->data[oscBuf[2]->needle++]=(temp_left+temp_right)<<3;
accum_left += temp_left; accum_left += temp_left;
accum_right += temp_right; accum_right += temp_right;
m_Amp3.TickAndOutputStereo(temp_left, temp_right); m_Amp3.TickAndOutputStereo(temp_left, temp_right);
oscBuf[3]->data[oscBuf[3]->needle++]=(temp_left+temp_right)<<4; oscBuf[3]->data[oscBuf[3]->needle++]=(temp_left+temp_right)<<3;
accum_left += temp_left; accum_left += temp_left;
accum_right += temp_right; accum_right += temp_right;
m_Amp4.TickAndOutputStereo(temp_left, temp_right); m_Amp4.TickAndOutputStereo(temp_left, temp_right);
oscBuf[4]->data[oscBuf[4]->needle++]=(temp_left+temp_right)<<4; oscBuf[4]->data[oscBuf[4]->needle++]=(temp_left+temp_right)<<3;
accum_left += temp_left; accum_left += temp_left;
accum_right += temp_right; accum_right += temp_right;
m_Amp5.TickAndOutputStereo(temp_left, temp_right); m_Amp5.TickAndOutputStereo(temp_left, temp_right);
oscBuf[5]->data[oscBuf[5]->needle++]=(temp_left+temp_right)<<4; oscBuf[5]->data[oscBuf[5]->needle++]=(temp_left+temp_right)<<3;
accum_left += temp_left; accum_left += temp_left;
accum_right += temp_right; accum_right += temp_right;
} }
@ -394,4 +394,4 @@ void CSAADevice::_TickAndOutputSeparate(unsigned int& left_mixed, unsigned int&
} }
left_mixed = accum_left; left_mixed = accum_left;
right_mixed = accum_right; right_mixed = accum_right;
} }

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2,9 +2,6 @@
// uncomment and modify defines under for customize ImGuiFileDialog // uncomment and modify defines under for customize ImGuiFileDialog
//this options need c++17
//#define USE_STD_FILESYSTEM
//#define MAX_FILE_DIALOG_NAME_BUFFER 1024 //#define MAX_FILE_DIALOG_NAME_BUFFER 1024
//#define MAX_PATH_BUFFER_SIZE 1024 //#define MAX_PATH_BUFFER_SIZE 1024

View file

@ -168,7 +168,7 @@ void DivPlatformAmiga::acquire(short** buf, size_t len) {
outL+=(output*sep2)>>7; outL+=(output*sep2)>>7;
outR+=(output*sep1)>>7; outR+=(output*sep1)>>7;
} }
oscBuf[i]->data[oscBuf[i]->needle++]=(amiga.nextOut[i]*MIN(64,amiga.audVol[i]))<<2; oscBuf[i]->data[oscBuf[i]->needle++]=(amiga.nextOut[i]*MIN(64,amiga.audVol[i]))<<1;
} else { } else {
oscBuf[i]->data[oscBuf[i]->needle++]=0; oscBuf[i]->data[oscBuf[i]->needle++]=0;
} }

View file

@ -76,7 +76,7 @@ void DivPlatformArcade::acquire_nuked(short** buf, size_t len) {
} }
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=fm.ch_out[i]; oscBuf[i]->data[oscBuf[i]->needle++]=fm.ch_out[i]>>1;
} }
if (o[0]<-32768) o[0]=-32768; if (o[0]<-32768) o[0]=-32768;
@ -111,7 +111,7 @@ void DivPlatformArcade::acquire_ymfm(short** buf, size_t len) {
fm_ymfm->generate(&out_ymfm); fm_ymfm->generate(&out_ymfm);
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1)); oscBuf[i]->data[oscBuf[i]->needle++]=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1))>>1;
} }
os[0]=out_ymfm.data[0]; os[0]=out_ymfm.data[0];

View file

@ -187,9 +187,9 @@ void DivPlatformAY8910::acquire(short** buf, size_t len) {
buf[0][i]=ayBuf[0][0]; buf[0][i]=ayBuf[0][0];
buf[1][i]=buf[0][i]; buf[1][i]=buf[0][i];
oscBuf[0]->data[oscBuf[0]->needle++]=sunsoftVolTable[31-(ay->lastIndx&31)]<<3; oscBuf[0]->data[oscBuf[0]->needle++]=sunsoftVolTable[31-(ay->lastIndx&31)]<<2;
oscBuf[1]->data[oscBuf[1]->needle++]=sunsoftVolTable[31-((ay->lastIndx>>5)&31)]<<3; oscBuf[1]->data[oscBuf[1]->needle++]=sunsoftVolTable[31-((ay->lastIndx>>5)&31)]<<2;
oscBuf[2]->data[oscBuf[2]->needle++]=sunsoftVolTable[31-((ay->lastIndx>>10)&31)]<<3; oscBuf[2]->data[oscBuf[2]->needle++]=sunsoftVolTable[31-((ay->lastIndx>>10)&31)]<<2;
} }
} else { } else {
for (size_t i=0; i<len; i++) { for (size_t i=0; i<len; i++) {
@ -205,9 +205,9 @@ void DivPlatformAY8910::acquire(short** buf, size_t len) {
buf[1][i]=buf[0][i]; buf[1][i]=buf[0][i];
} }
oscBuf[0]->data[oscBuf[0]->needle++]=ayBuf[0][0]<<2; oscBuf[0]->data[oscBuf[0]->needle++]=ayBuf[0][0]<<1;
oscBuf[1]->data[oscBuf[1]->needle++]=ayBuf[1][0]<<2; oscBuf[1]->data[oscBuf[1]->needle++]=ayBuf[1][0]<<1;
oscBuf[2]->data[oscBuf[2]->needle++]=ayBuf[2][0]<<2; oscBuf[2]->data[oscBuf[2]->needle++]=ayBuf[2][0]<<1;
} }
} }
} }

View file

@ -186,9 +186,9 @@ void DivPlatformAY8930::acquire(short** buf, size_t len) {
buf[1][i]=buf[0][i]; buf[1][i]=buf[0][i];
} }
oscBuf[0]->data[oscBuf[0]->needle++]=ayBuf[0][0]<<2; oscBuf[0]->data[oscBuf[0]->needle++]=ayBuf[0][0]<<1;
oscBuf[1]->data[oscBuf[1]->needle++]=ayBuf[1][0]<<2; oscBuf[1]->data[oscBuf[1]->needle++]=ayBuf[1][0]<<1;
oscBuf[2]->data[oscBuf[2]->needle++]=ayBuf[2][0]<<2; oscBuf[2]->data[oscBuf[2]->needle++]=ayBuf[2][0]<<1;
} }
} }

View file

@ -55,7 +55,7 @@ void DivPlatformBubSysWSG::acquire(short** buf, size_t len) {
chanOut=chan[i].waveROM[k005289.addr(i)]*(regPool[2+i]&0xf); chanOut=chan[i].waveROM[k005289.addr(i)]*(regPool[2+i]&0xf);
out+=chanOut; out+=chanOut;
if (writeOscBuf==0) { if (writeOscBuf==0) {
oscBuf[i]->data[oscBuf[i]->needle++]=chanOut<<7; oscBuf[i]->data[oscBuf[i]->needle++]=chanOut<<6;
} }
} }
} }

View file

@ -80,18 +80,18 @@ void DivPlatformC64::acquire(short** buf, size_t len) {
sid_fp.clock(4,&buf[0][i]); sid_fp.clock(4,&buf[0][i]);
if (++writeOscBuf>=4) { if (++writeOscBuf>=4) {
writeOscBuf=0; writeOscBuf=0;
oscBuf[0]->data[oscBuf[0]->needle++]=(sid_fp.lastChanOut[0]-dcOff)>>5; oscBuf[0]->data[oscBuf[0]->needle++]=(sid_fp.lastChanOut[0]-dcOff)>>6;
oscBuf[1]->data[oscBuf[1]->needle++]=(sid_fp.lastChanOut[1]-dcOff)>>5; oscBuf[1]->data[oscBuf[1]->needle++]=(sid_fp.lastChanOut[1]-dcOff)>>6;
oscBuf[2]->data[oscBuf[2]->needle++]=(sid_fp.lastChanOut[2]-dcOff)>>5; oscBuf[2]->data[oscBuf[2]->needle++]=(sid_fp.lastChanOut[2]-dcOff)>>6;
} }
} else { } else {
sid.clock(); sid.clock();
buf[0][i]=sid.output(); buf[0][i]=sid.output();
if (++writeOscBuf>=16) { if (++writeOscBuf>=16) {
writeOscBuf=0; writeOscBuf=0;
oscBuf[0]->data[oscBuf[0]->needle++]=(sid.last_chan_out[0]-dcOff)>>5; oscBuf[0]->data[oscBuf[0]->needle++]=(sid.last_chan_out[0]-dcOff)>>6;
oscBuf[1]->data[oscBuf[1]->needle++]=(sid.last_chan_out[1]-dcOff)>>5; oscBuf[1]->data[oscBuf[1]->needle++]=(sid.last_chan_out[1]-dcOff)>>6;
oscBuf[2]->data[oscBuf[2]->needle++]=(sid.last_chan_out[2]-dcOff)>>5; oscBuf[2]->data[oscBuf[2]->needle++]=(sid.last_chan_out[2]-dcOff)>>6;
} }
} }
} }

View file

@ -32,7 +32,7 @@ void DivPlatformDummy::acquire(short** buf, size_t len) {
if (chan[j].active) { if (chan[j].active) {
if (!isMuted[j]) { if (!isMuted[j]) {
chanOut=(((signed short)chan[j].pos)*chan[j].amp*chan[j].vol)>>12; chanOut=(((signed short)chan[j].pos)*chan[j].amp*chan[j].vol)>>12;
oscBuf[j]->data[oscBuf[j]->needle++]=chanOut; oscBuf[j]->data[oscBuf[j]->needle++]=chanOut>>1;
out+=chanOut; out+=chanOut;
} else { } else {
oscBuf[j]->data[oscBuf[j]->needle++]=0; oscBuf[j]->data[oscBuf[j]->needle++]=0;

View file

@ -168,7 +168,7 @@ void DivPlatformES5506::acquire(short** buf, size_t len) {
buf[(o<<1)|1][h]=es5506.rout(o); buf[(o<<1)|1][h]=es5506.rout(o);
} }
for (int i=chanMax; i>=0; i--) { for (int i=chanMax; i>=0; i--) {
oscBuf[i]->data[oscBuf[i]->needle++]=(es5506.voice_lout(i)+es5506.voice_rout(i))>>5; oscBuf[i]->data[oscBuf[i]->needle++]=(es5506.voice_lout(i)+es5506.voice_rout(i))>>6;
} }
} }
} }

View file

@ -64,7 +64,7 @@ void DivPlatformFDS::acquire_puNES(short* buf, size_t len) {
buf[i]=sample; buf[i]=sample;
if (++writeOscBuf>=32) { if (++writeOscBuf>=32) {
writeOscBuf=0; writeOscBuf=0;
oscBuf->data[oscBuf->needle++]=sample<<1; oscBuf->data[oscBuf->needle++]=sample;
} }
} }
} }
@ -80,7 +80,7 @@ void DivPlatformFDS::acquire_NSFPlay(short* buf, size_t len) {
buf[i]=sample; buf[i]=sample;
if (++writeOscBuf>=32) { if (++writeOscBuf>=32) {
writeOscBuf=0; writeOscBuf=0;
oscBuf->data[oscBuf->needle++]=sample<<1; oscBuf->data[oscBuf->needle++]=sample;
} }
} }
} }

View file

@ -75,7 +75,7 @@ void DivPlatformGA20::acquire(short** buf, size_t len) {
ga20.sound_stream_update(buffer, 1); ga20.sound_stream_update(buffer, 1);
buf[0][h]=(signed int)(ga20Buf[0][h]+ga20Buf[1][h]+ga20Buf[2][h]+ga20Buf[3][h])>>2; buf[0][h]=(signed int)(ga20Buf[0][h]+ga20Buf[1][h]+ga20Buf[2][h]+ga20Buf[3][h])>>2;
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=ga20Buf[i][h]; oscBuf[i]->data[oscBuf[i]->needle++]=ga20Buf[i][h]>>1;
} }
} }
} }

View file

@ -74,7 +74,7 @@ void DivPlatformGB::acquire(short** buf, size_t len) {
buf[1][i]=gb->apu_output.final_sample.right; buf[1][i]=gb->apu_output.final_sample.right;
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(gb->apu_output.current_sample[i].left+gb->apu_output.current_sample[i].right)<<6; oscBuf[i]->data[oscBuf[i]->needle++]=(gb->apu_output.current_sample[i].left+gb->apu_output.current_sample[i].right)<<5;
} }
} }
} }

View file

@ -184,16 +184,18 @@ void DivPlatformGenesis::acquire_nuked(short** buf, size_t len) {
if (i==5) { if (i==5) {
if (fm.dacen) { if (fm.dacen) {
if (softPCM) { if (softPCM) {
oscBuf[5]->data[oscBuf[5]->needle++]=chan[5].dacOutput<<7; oscBuf[5]->data[oscBuf[5]->needle++]=chan[5].dacOutput<<6;
oscBuf[6]->data[oscBuf[6]->needle++]=chan[6].dacOutput<<7; oscBuf[6]->data[oscBuf[6]->needle++]=chan[6].dacOutput<<6;
} else { } else {
oscBuf[i]->data[oscBuf[i]->needle++]=fm.dacdata<<7; oscBuf[i]->data[oscBuf[i]->needle++]=fm.dacdata<<6;
oscBuf[6]->data[oscBuf[6]->needle++]=0;
} }
} else { } else {
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm.ch_out[i]<<(chipType==2?2:7),-32768,32767); oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm.ch_out[i]<<(chipType==2?1:6),-32768,32767);
oscBuf[6]->data[oscBuf[6]->needle++]=0;
} }
} else { } else {
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm.ch_out[i]<<(chipType==2?2:7),-32768,32767); oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm.ch_out[i]<<(chipType==2?1:6),-32768,32767);
} }
} }
@ -241,19 +243,21 @@ void DivPlatformGenesis::acquire_ymfm(short** buf, size_t len) {
//OPN2_Write(&fm,0,0); //OPN2_Write(&fm,0,0);
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
int chOut=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1))<<6; int chOut=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1))<<5;
if (chOut<-32768) chOut=-32768; if (chOut<-32768) chOut=-32768;
if (chOut>32767) chOut=32767; if (chOut>32767) chOut=32767;
if (i==5) { if (i==5) {
if (fm_ymfm->debug_dac_enable()) { if (fm_ymfm->debug_dac_enable()) {
if (softPCM) { if (softPCM) {
oscBuf[5]->data[oscBuf[5]->needle++]=chan[5].dacOutput<<7; oscBuf[5]->data[oscBuf[5]->needle++]=chan[5].dacOutput<<6;
oscBuf[6]->data[oscBuf[6]->needle++]=chan[6].dacOutput<<7; oscBuf[6]->data[oscBuf[6]->needle++]=chan[6].dacOutput<<6;
} else { } else {
oscBuf[i]->data[oscBuf[i]->needle++]=fm_ymfm->debug_dac_data()<<7; oscBuf[i]->data[oscBuf[i]->needle++]=fm_ymfm->debug_dac_data()<<6;
oscBuf[6]->data[oscBuf[6]->needle++]=0;
} }
} else { } else {
oscBuf[i]->data[oscBuf[i]->needle++]=chOut; oscBuf[i]->data[oscBuf[i]->needle++]=chOut;
oscBuf[6]->data[oscBuf[6]->needle++]=0;
} }
} else { } else {
oscBuf[i]->data[oscBuf[i]->needle++]=chOut; oscBuf[i]->data[oscBuf[i]->needle++]=chOut;

View file

@ -79,14 +79,14 @@ void DivPlatformK007232::acquire(short** buf, size_t len) {
buf[0][h]=(lout[0]+lout[1])<<4; buf[0][h]=(lout[0]+lout[1])<<4;
buf[1][h]=(rout[0]+rout[1])<<4; buf[1][h]=(rout[0]+rout[1])<<4;
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(lout[i]+rout[i])<<4; oscBuf[i]->data[oscBuf[i]->needle++]=(lout[i]+rout[i])<<3;
} }
} else { } else {
const unsigned char vol=regPool[0xc]; const unsigned char vol=regPool[0xc];
const signed int out[2]={(k007232.output(0)*(vol&0xf)),(k007232.output(1)*((vol>>4)&0xf))}; const signed int out[2]={(k007232.output(0)*(vol&0xf)),(k007232.output(1)*((vol>>4)&0xf))};
buf[0][h]=(out[0]+out[1])<<4; buf[0][h]=(out[0]+out[1])<<4;
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=out[i]<<5; oscBuf[i]->data[oscBuf[i]->needle++]=out[i]<<4;
} }
} }
} }

View file

@ -85,9 +85,9 @@ void DivPlatformMMC5::acquire(short** buf, size_t len) {
if (++writeOscBuf>=32) { if (++writeOscBuf>=32) {
writeOscBuf=0; writeOscBuf=0;
oscBuf[0]->data[oscBuf[0]->needle++]=isMuted[0]?0:((mmc5->S3.output*10)<<7); oscBuf[0]->data[oscBuf[0]->needle++]=isMuted[0]?0:((mmc5->S3.output*10)<<6);
oscBuf[1]->data[oscBuf[1]->needle++]=isMuted[1]?0:((mmc5->S4.output*10)<<7); oscBuf[1]->data[oscBuf[1]->needle++]=isMuted[1]?0:((mmc5->S4.output*10)<<6);
oscBuf[2]->data[oscBuf[2]->needle++]=isMuted[2]?0:((mmc5->pcm.output*2)<<6); oscBuf[2]->data[oscBuf[2]->needle++]=isMuted[2]?0:((mmc5->pcm.output*2)<<5);
} }
} }
} }

View file

@ -60,7 +60,7 @@ void DivPlatformMSM5232::acquire(short** buf, size_t len) {
((regPool[12+(i>>4)]&2)?((msm->vo8[i]*partVolume[2+(i&4)])>>8):0)+ ((regPool[12+(i>>4)]&2)?((msm->vo8[i]*partVolume[2+(i&4)])>>8):0)+
((regPool[12+(i>>4)]&4)?((msm->vo4[i]*partVolume[1+(i&4)])>>8):0)+ ((regPool[12+(i>>4)]&4)?((msm->vo4[i]*partVolume[1+(i&4)])>>8):0)+
((regPool[12+(i>>4)]&8)?((msm->vo2[i]*partVolume[i&4])>>8):0) ((regPool[12+(i>>4)]&8)?((msm->vo2[i]*partVolume[i&4])>>8):0)
)<<3; )<<2;
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(o,-32768,32767); oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(o,-32768,32767);
} }

View file

@ -84,7 +84,7 @@ void DivPlatformMSM6258::acquire(short** buf, size_t len) {
} else { } else {
buf[0][h]=(msmPan&2)?msmOut:0; buf[0][h]=(msmPan&2)?msmOut:0;
buf[1][h]=(msmPan&1)?msmOut:0; buf[1][h]=(msmPan&1)?msmOut:0;
oscBuf[0]->data[oscBuf[0]->needle++]=msmPan?msmOut:0; oscBuf[0]->data[oscBuf[0]->needle++]=msmPan?(msmOut>>1):0;
} }
} }
} }

View file

@ -79,9 +79,8 @@ void DivPlatformMSM6295::acquire(short** buf, size_t len) {
if (++updateOsc>=22) { if (++updateOsc>=22) {
updateOsc=0; updateOsc=0;
// TODO: per-channel osc
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=msm.voice_out(i)<<6; oscBuf[i]->data[oscBuf[i]->needle++]=msm.voice_out(i)<<5;
} }
} }
} }

View file

@ -118,7 +118,7 @@ void DivPlatformN163::acquire(short** buf, size_t len) {
buf[0][i]=out; buf[0][i]=out;
if (n163.voice_cycle()==0x78) for (int i=0; i<8; i++) { if (n163.voice_cycle()==0x78) for (int i=0; i<8; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=n163.voice_out(i)<<7; oscBuf[i]->data[oscBuf[i]->needle++]=n163.voice_out(i)<<6;
} }
// command queue // command queue

View file

@ -177,7 +177,7 @@ void DivPlatformNamcoWSG::acquire(short** buf, size_t len) {
}; };
namco->sound_stream_update(bufC,1); namco->sound_stream_update(bufC,1);
for (int i=0; i<chans; i++) { for (int i=0; i<chans; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=namco->m_channel_list[i].last_out*chans; oscBuf[i]->data[oscBuf[i]->needle++]=(namco->m_channel_list[i].last_out*chans)>>1;
} }
} }
} }

View file

@ -115,11 +115,11 @@ void DivPlatformNES::acquire_puNES(short** buf, size_t len) {
buf[0][i]=sample; buf[0][i]=sample;
if (++writeOscBuf>=32) { if (++writeOscBuf>=32) {
writeOscBuf=0; writeOscBuf=0;
oscBuf[0]->data[oscBuf[0]->needle++]=isMuted[0]?0:(nes->S1.output<<11); oscBuf[0]->data[oscBuf[0]->needle++]=isMuted[0]?0:(nes->S1.output<<10);
oscBuf[1]->data[oscBuf[1]->needle++]=isMuted[1]?0:(nes->S2.output<<11); oscBuf[1]->data[oscBuf[1]->needle++]=isMuted[1]?0:(nes->S2.output<<10);
oscBuf[2]->data[oscBuf[2]->needle++]=isMuted[2]?0:(nes->TR.output<<11); oscBuf[2]->data[oscBuf[2]->needle++]=isMuted[2]?0:(nes->TR.output<<10);
oscBuf[3]->data[oscBuf[3]->needle++]=isMuted[3]?0:(nes->NS.output<<11); oscBuf[3]->data[oscBuf[3]->needle++]=isMuted[3]?0:(nes->NS.output<<10);
oscBuf[4]->data[oscBuf[4]->needle++]=isMuted[4]?0:(nes->DMC.output<<8); oscBuf[4]->data[oscBuf[4]->needle++]=isMuted[4]?0:(nes->DMC.output<<7);
} }
} }
} }
@ -142,11 +142,11 @@ void DivPlatformNES::acquire_NSFPlay(short** buf, size_t len) {
buf[0][i]=sample; buf[0][i]=sample;
if (++writeOscBuf>=32) { if (++writeOscBuf>=32) {
writeOscBuf=0; writeOscBuf=0;
oscBuf[0]->data[oscBuf[0]->needle++]=nes1_NP->out[0]<<11; oscBuf[0]->data[oscBuf[0]->needle++]=nes1_NP->out[0]<<10;
oscBuf[1]->data[oscBuf[1]->needle++]=nes1_NP->out[1]<<11; oscBuf[1]->data[oscBuf[1]->needle++]=nes1_NP->out[1]<<10;
oscBuf[2]->data[oscBuf[2]->needle++]=nes2_NP->out[0]<<11; oscBuf[2]->data[oscBuf[2]->needle++]=nes2_NP->out[0]<<10;
oscBuf[3]->data[oscBuf[3]->needle++]=nes2_NP->out[1]<<11; oscBuf[3]->data[oscBuf[3]->needle++]=nes2_NP->out[1]<<10;
oscBuf[4]->data[oscBuf[4]->needle++]=nes2_NP->out[2]<<8; oscBuf[4]->data[oscBuf[4]->needle++]=nes2_NP->out[2]<<7;
} }
} }
} }

View file

@ -211,7 +211,7 @@ void DivPlatformOPL::acquire_nuked(short** buf, size_t len) {
if (!isMuted[adpcmChan]) { if (!isMuted[adpcmChan]) {
os[0]-=aOut.data[0]>>3; os[0]-=aOut.data[0]>>3;
os[1]-=aOut.data[0]>>3; os[1]-=aOut.data[0]>>3;
oscBuf[adpcmChan]->data[oscBuf[adpcmChan]->needle++]=aOut.data[0]; oscBuf[adpcmChan]->data[oscBuf[adpcmChan]->needle++]=aOut.data[0]>>1;
} else { } else {
oscBuf[adpcmChan]->data[oscBuf[adpcmChan]->needle++]=0; oscBuf[adpcmChan]->data[oscBuf[adpcmChan]->needle++]=0;
} }
@ -234,14 +234,13 @@ void DivPlatformOPL::acquire_nuked(short** buf, size_t len) {
if (fm.channel[i].out[3]!=NULL) { if (fm.channel[i].out[3]!=NULL) {
oscBuf[i]->data[oscBuf[i]->needle]+=*fm.channel[ch].out[3]; oscBuf[i]->data[oscBuf[i]->needle]+=*fm.channel[ch].out[3];
} }
oscBuf[i]->data[oscBuf[i]->needle]<<=1;
oscBuf[i]->needle++; oscBuf[i]->needle++;
} }
// special // special
oscBuf[melodicChans+1]->data[oscBuf[melodicChans+1]->needle++]=fm.slot[16].out*6; oscBuf[melodicChans+1]->data[oscBuf[melodicChans+1]->needle++]=fm.slot[16].out*3;
oscBuf[melodicChans+2]->data[oscBuf[melodicChans+2]->needle++]=fm.slot[14].out*6; oscBuf[melodicChans+2]->data[oscBuf[melodicChans+2]->needle++]=fm.slot[14].out*3;
oscBuf[melodicChans+3]->data[oscBuf[melodicChans+3]->needle++]=fm.slot[17].out*6; oscBuf[melodicChans+3]->data[oscBuf[melodicChans+3]->needle++]=fm.slot[17].out*3;
oscBuf[melodicChans+4]->data[oscBuf[melodicChans+4]->needle++]=fm.slot[13].out*6; oscBuf[melodicChans+4]->data[oscBuf[melodicChans+4]->needle++]=fm.slot[13].out*3;
} else { } else {
for (int i=0; i<chans; i++) { for (int i=0; i<chans; i++) {
unsigned char ch=outChanMap[i]; unsigned char ch=outChanMap[i];
@ -259,7 +258,6 @@ void DivPlatformOPL::acquire_nuked(short** buf, size_t len) {
if (fm.channel[i].out[3]!=NULL) { if (fm.channel[i].out[3]!=NULL) {
oscBuf[i]->data[oscBuf[i]->needle]+=*fm.channel[ch].out[3]; oscBuf[i]->data[oscBuf[i]->needle]+=*fm.channel[ch].out[3];
} }
oscBuf[i]->data[oscBuf[i]->needle]<<=1;
oscBuf[i]->needle++; oscBuf[i]->needle++;
} }
} }

View file

@ -68,7 +68,7 @@ void DivPlatformOPLL::acquire_nuked(short** buf, size_t len) {
unsigned char nextOut=cycleMapOPLL[fm.cycles]; unsigned char nextOut=cycleMapOPLL[fm.cycles];
if ((nextOut>=6 && properDrums) || !isMuted[nextOut]) { if ((nextOut>=6 && properDrums) || !isMuted[nextOut]) {
os+=(o[0]+o[1]); os+=(o[0]+o[1]);
if (vrc7 || (fm.rm_enable&0x20)) oscBuf[nextOut]->data[oscBuf[nextOut]->needle++]=(o[0]+o[1])<<6; if (vrc7 || (fm.rm_enable&0x20)) oscBuf[nextOut]->data[oscBuf[nextOut]->needle++]=(o[0]+o[1])<<5;
} else { } else {
if (vrc7 || (fm.rm_enable&0x20)) oscBuf[nextOut]->data[oscBuf[nextOut]->needle++]=0; if (vrc7 || (fm.rm_enable&0x20)) oscBuf[nextOut]->data[oscBuf[nextOut]->needle++]=0;
} }
@ -76,7 +76,7 @@ void DivPlatformOPLL::acquire_nuked(short** buf, size_t len) {
if (!(vrc7 || (fm.rm_enable&0x20))) for (int i=0; i<9; i++) { if (!(vrc7 || (fm.rm_enable&0x20))) for (int i=0; i<9; i++) {
unsigned char ch=visMapOPLL[i]; unsigned char ch=visMapOPLL[i];
if ((i>=6 && properDrums) || !isMuted[ch]) { if ((i>=6 && properDrums) || !isMuted[ch]) {
oscBuf[ch]->data[oscBuf[ch]->needle++]=(fm.output_ch[i])<<6; oscBuf[ch]->data[oscBuf[ch]->needle++]=(fm.output_ch[i])<<5;
} else { } else {
oscBuf[ch]->data[oscBuf[ch]->needle++]=0; oscBuf[ch]->data[oscBuf[ch]->needle++]=0;
} }

View file

@ -101,7 +101,7 @@ void DivPlatformPCE::acquire(short** buf, size_t len) {
pce->ResetTS(0); pce->ResetTS(0);
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP((pce->channel[i].blip_prev_samp[0]+pce->channel[i].blip_prev_samp[1])<<1,-32768,32767); oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(pce->channel[i].blip_prev_samp[0]+pce->channel[i].blip_prev_samp[1],-32768,32767);
} }
tempL[0]=(tempL[0]>>1)+(tempL[0]>>2); tempL[0]=(tempL[0]>>1)+(tempL[0]>>2);

View file

@ -229,7 +229,7 @@ void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
} else { } else {
output=output*chan[0].vol*chan[0].envVol/16384; output=output*chan[0].vol*chan[0].envVol/16384;
} }
oscBuf->data[oscBuf->needle++]=output; oscBuf->data[oscBuf->needle++]=output>>1;
if (outStereo) { if (outStereo) {
buf[0][h]=((output*chan[0].panL)>>(depthScale+8))<<depthScale; buf[0][h]=((output*chan[0].panL)>>(depthScale+8))<<depthScale;
buf[1][h]=((output*chan[0].panR)>>(depthScale+8))<<depthScale; buf[1][h]=((output*chan[0].panR)>>(depthScale+8))<<depthScale;

View file

@ -85,10 +85,10 @@ void DivPlatformPOKEY::acquireMZ(short* buf, size_t len) {
if (++oscBufDelay>=14) { if (++oscBufDelay>=14) {
oscBufDelay=0; oscBufDelay=0;
oscBuf[0]->data[oscBuf[0]->needle++]=pokey.outvol_0<<11; oscBuf[0]->data[oscBuf[0]->needle++]=pokey.outvol_0<<10;
oscBuf[1]->data[oscBuf[1]->needle++]=pokey.outvol_1<<11; oscBuf[1]->data[oscBuf[1]->needle++]=pokey.outvol_1<<10;
oscBuf[2]->data[oscBuf[2]->needle++]=pokey.outvol_2<<11; oscBuf[2]->data[oscBuf[2]->needle++]=pokey.outvol_2<<10;
oscBuf[3]->data[oscBuf[3]->needle++]=pokey.outvol_3<<11; oscBuf[3]->data[oscBuf[3]->needle++]=pokey.outvol_3<<10;
} }
} }
} }

View file

@ -272,7 +272,7 @@ void DivPlatformQSound::acquire(short** buf, size_t len) {
buf[1][h]=chip.out[1]; buf[1][h]=chip.out[1];
for (int i=0; i<19; i++) { for (int i=0; i<19; i++) {
int data=chip.voice_output[i]<<2; int data=chip.voice_output[i]<<1;
if (data<-32768) data=-32768; if (data<-32768) data=-32768;
if (data>32767) data=32767; if (data>32767) data=32767;
oscBuf[i]->data[oscBuf[i]->needle++]=data; oscBuf[i]->data[oscBuf[i]->needle++]=data;

View file

@ -74,7 +74,7 @@ void DivPlatformRF5C68::acquire(short** buf, size_t len) {
rf5c68.sound_stream_update(bufPtrs,chBufPtrs,blockLen); rf5c68.sound_stream_update(bufPtrs,chBufPtrs,blockLen);
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
for (size_t j=0; j<blockLen; j++) { for (size_t j=0; j<blockLen; j++) {
oscBuf[i]->data[oscBuf[i]->needle++]=bufC[i*2][j]+bufC[i*2+1][j]; oscBuf[i]->data[oscBuf[i]->needle++]=(bufC[i*2][j]+bufC[i*2+1][j])>>1;
} }
} }
pos+=blockLen; pos+=blockLen;

View file

@ -87,7 +87,7 @@ void DivPlatformSCC::acquire(short** buf, size_t len) {
buf[0][h]=out; buf[0][h]=out;
for (int i=0; i<5; i++) { for (int i=0; i<5; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=scc->voice_out(i)<<7; oscBuf[i]->data[oscBuf[i]->needle++]=scc->voice_out(i)<<6;
} }
} }
} }

View file

@ -49,7 +49,7 @@ void DivPlatformSegaPCM::acquire(short** buf, size_t len) {
buf[1][h]=os[1]; buf[1][h]=os[1];
for (int i=0; i<16; i++) { for (int i=0; i<16; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=pcm.lastOut[i][0]+pcm.lastOut[i][1]; oscBuf[i]->data[oscBuf[i]->needle++]=(pcm.lastOut[i][0]+pcm.lastOut[i][1])>>1;
} }
} }
} }

View file

@ -58,9 +58,9 @@ void DivPlatformSM8521::acquire(short** buf, size_t len) {
sm8521_sound_tick(&sm8521,8); sm8521_sound_tick(&sm8521,8);
buf[0][h]=sm8521.out<<6; buf[0][h]=sm8521.out<<6;
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=sm8521.sg[i].base.out<<6; oscBuf[i]->data[oscBuf[i]->needle++]=sm8521.sg[i].base.out<<5;
} }
oscBuf[2]->data[oscBuf[2]->needle++]=sm8521.noise.base.out<<6; oscBuf[2]->data[oscBuf[2]->needle++]=sm8521.noise.base.out<<5;
} }
} }

View file

@ -91,7 +91,7 @@ void DivPlatformSNES::acquire(short** buf, size_t len) {
next=(next*254)/MAX(1,globalVolL+globalVolR); next=(next*254)/MAX(1,globalVolL+globalVolR);
if (next<-32768) next=-32768; if (next<-32768) next=-32768;
if (next>32767) next=32767; if (next>32767) next=32767;
oscBuf[i]->data[oscBuf[i]->needle++]=next; oscBuf[i]->data[oscBuf[i]->needle++]=next>>1;
} }
} }
} }

View file

@ -509,7 +509,7 @@ public:
} }
if (oscb!=NULL) { if (oscb!=NULL) {
oscb[i]->data[oscb[i]->needle++]=oscbWrite; oscb[i]->data[oscb[i]->needle++]=oscbWrite>>1;
} }
} }

View file

@ -39,7 +39,7 @@ static constexpr int MuteInit = 2;
static constexpr int MuteSerialInput = 8; static constexpr int MuteSerialInput = 8;
//just some magick value to match the audio level of mzpokeysnd //just some magick value to match the audio level of mzpokeysnd
static constexpr int16_t MAGICK_VOLUME_BOOSTER = 160; static constexpr int16_t MAGICK_VOLUME_BOOSTER = 160;
static constexpr int16_t MAGICK_OSC_VOLUME_BOOSTER = 4; static constexpr int16_t MAGICK_OSC_VOLUME_BOOSTER = 2;
struct PokeyBase struct PokeyBase
{ {

View file

@ -87,7 +87,7 @@ void DivPlatformSwan::acquire(short** buf, size_t len) {
buf[0][h]=samp[0]; buf[0][h]=samp[0];
buf[1][h]=samp[1]; buf[1][h]=samp[1];
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(ws->sample_cache[i][0]+ws->sample_cache[i][1])<<6; oscBuf[i]->data[oscBuf[i]->needle++]=(ws->sample_cache[i][0]+ws->sample_cache[i][1])<<5;
} }
} }
} }

View file

@ -51,8 +51,8 @@ void DivPlatformTIA::acquire(short** buf, size_t len) {
} }
if (++chanOscCounter>=114) { if (++chanOscCounter>=114) {
chanOscCounter=0; chanOscCounter=0;
oscBuf[0]->data[oscBuf[0]->needle++]=tia.myChannelOut[0]; oscBuf[0]->data[oscBuf[0]->needle++]=tia.myChannelOut[0]>>1;
oscBuf[1]->data[oscBuf[1]->needle++]=tia.myChannelOut[1]; oscBuf[1]->data[oscBuf[1]->needle++]=tia.myChannelOut[1]>>1;
} }
} }
} }

View file

@ -78,7 +78,7 @@ void DivPlatformTX81Z::acquire(short** buf, size_t len) {
fm_ymfm->generate(&out_ymfm); fm_ymfm->generate(&out_ymfm);
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1)); oscBuf[i]->data[oscBuf[i]->needle++]=(fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1))>>1;
} }
os[0]=out_ymfm.data[0]; os[0]=out_ymfm.data[0];

View file

@ -107,7 +107,7 @@ void DivPlatformVB::acquire(short** buf, size_t len) {
tempL=0; tempL=0;
tempR=0; tempR=0;
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(vb->last_output[i][0]+vb->last_output[i][1])*8; oscBuf[i]->data[oscBuf[i]->needle++]=(vb->last_output[i][0]+vb->last_output[i][1])*4;
tempL+=vb->last_output[i][0]; tempL+=vb->last_output[i][0];
tempR+=vb->last_output[i][1]; tempR+=vb->last_output[i][1];
} }

View file

@ -107,9 +107,9 @@ void DivPlatformVERA::acquire(short** buf, size_t len) {
pos++; pos++;
for (int i=0; i<16; i++) { for (int i=0; i<16; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=psg->channels[i].lastOut<<4; oscBuf[i]->data[oscBuf[i]->needle++]=psg->channels[i].lastOut<<3;
} }
int pcmOut=whyCallItBuf[2][i]+whyCallItBuf[3][i]; int pcmOut=(whyCallItBuf[2][i]+whyCallItBuf[3][i])>>1;
if (pcmOut<-32768) pcmOut=-32768; if (pcmOut<-32768) pcmOut=-32768;
if (pcmOut>32767) pcmOut=32767; if (pcmOut>32767) pcmOut=32767;
oscBuf[16]->data[oscBuf[16]->needle++]=pcmOut; oscBuf[16]->data[oscBuf[16]->needle++]=pcmOut;

View file

@ -69,7 +69,7 @@ void DivPlatformVIC20::acquire(short** buf, size_t len) {
vic_sound_machine_calculate_samples(vic,&samp,1,1,0,SAMP_DIVIDER); vic_sound_machine_calculate_samples(vic,&samp,1,1,0,SAMP_DIVIDER);
buf[0][h]=samp; buf[0][h]=samp;
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=vic->ch[i].out?(vic->volume<<11):0; oscBuf[i]->data[oscBuf[i]->needle++]=vic->ch[i].out?(vic->volume<<10):0;
} }
} }
} }

View file

@ -87,9 +87,9 @@ void DivPlatformVRC6::acquire(short** buf, size_t len) {
if (++writeOscBuf>=32) { if (++writeOscBuf>=32) {
writeOscBuf=0; writeOscBuf=0;
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=vrc6.pulse_out(i)<<10; oscBuf[i]->data[oscBuf[i]->needle++]=vrc6.pulse_out(i)<<9;
} }
oscBuf[2]->data[oscBuf[2]->needle++]=vrc6.sawtooth_out()<<10; oscBuf[2]->data[oscBuf[2]->needle++]=vrc6.sawtooth_out()<<9;
} }
// Command part // Command part

View file

@ -222,7 +222,7 @@ void DivPlatformX1_010::acquire(short** buf, size_t len) {
if (stereo) buf[1][h]=tempR; if (stereo) buf[1][h]=tempR;
for (int i=0; i<16; i++) { for (int i=0; i<16; i++) {
int vo=(x1_010.voice_out(i,0)+x1_010.voice_out(i,1))<<3; int vo=(x1_010.voice_out(i,0)+x1_010.voice_out(i,1))<<2;
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(vo,-32768,32767); oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(vo,-32768,32767);
} }
} }

View file

@ -231,11 +231,11 @@ void DivPlatformYM2203::acquire_combo(short** buf, size_t len) {
buf[0][h]=os; buf[0][h]=os;
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]; oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]>>1;
} }
for (int i=3; i<6; i++) { for (int i=3; i<6; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=fmout.data[i-2]; oscBuf[i]->data[oscBuf[i]->needle++]=fmout.data[i-2]>>1;
} }
} }
} }
@ -282,11 +282,11 @@ void DivPlatformYM2203::acquire_ymfm(short** buf, size_t len) {
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1)); oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))>>1;
} }
for (int i=3; i<6; i++) { for (int i=3; i<6; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=fmout.data[i-2]; oscBuf[i]->data[oscBuf[i]->needle++]=fmout.data[i-2]>>1;
} }
} }
} }

View file

@ -402,19 +402,19 @@ void DivPlatformYM2608::acquire_combo(short** buf, size_t len) {
for (int i=0; i<psgChanOffs; i++) { for (int i=0; i<psgChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]; oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]>>1;
} }
ssge->get_last_out(ssgOut); ssge->get_last_out(ssgOut);
for (int i=psgChanOffs; i<adpcmAChanOffs; i++) { for (int i=psgChanOffs; i<adpcmAChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]; oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]>>1;
} }
for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) { for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1); oscBuf[i]->data[oscBuf[i]->needle++]=(adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1))>>1;
} }
oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=abe->get_last_out(0)+abe->get_last_out(1); oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=(abe->get_last_out(0)+abe->get_last_out(1))>>1;
} }
} }
@ -471,19 +471,19 @@ void DivPlatformYM2608::acquire_ymfm(short** buf, size_t len) {
buf[1][h]=os[1]; buf[1][h]=os[1];
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1)); oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))>>1;
} }
ssge->get_last_out(ssgOut); ssge->get_last_out(ssgOut);
for (int i=6; i<9; i++) { for (int i=6; i<9; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-6]; oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-6]>>1;
} }
for (int i=9; i<15; i++) { for (int i=9; i<15; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=adpcmAChan[i-9]->get_last_out(0)+adpcmAChan[i-9]->get_last_out(1); oscBuf[i]->data[oscBuf[i]->needle++]=(adpcmAChan[i-9]->get_last_out(0)+adpcmAChan[i-9]->get_last_out(1))>>1;
} }
oscBuf[15]->data[oscBuf[15]->needle++]=abe->get_last_out(0)+abe->get_last_out(1); oscBuf[15]->data[oscBuf[15]->needle++]=(abe->get_last_out(0)+abe->get_last_out(1))>>1;
} }
} }

View file

@ -333,19 +333,19 @@ void DivPlatformYM2610::acquire_combo(short** buf, size_t len) {
for (int i=0; i<psgChanOffs; i++) { for (int i=0; i<psgChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[bchOffs[i]]; oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[bchOffs[i]]>>1;
} }
ssge->get_last_out(ssgOut); ssge->get_last_out(ssgOut);
for (int i=psgChanOffs; i<adpcmAChanOffs; i++) { for (int i=psgChanOffs; i<adpcmAChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]; oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]>>1;
} }
for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) { for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1); oscBuf[i]->data[oscBuf[i]->needle++]=(adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1))>>1;
} }
oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=abe->get_last_out(0)+abe->get_last_out(1); oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=(abe->get_last_out(0)+abe->get_last_out(1))>>1;
} }
} }
@ -404,19 +404,19 @@ void DivPlatformYM2610::acquire_ymfm(short** buf, size_t len) {
buf[1][h]=os[1]; buf[1][h]=os[1];
for (int i=0; i<psgChanOffs; i++) { for (int i=0; i<psgChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1)); oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))>>1;
} }
ssge->get_last_out(ssgOut); ssge->get_last_out(ssgOut);
for (int i=psgChanOffs; i<adpcmAChanOffs; i++) { for (int i=psgChanOffs; i<adpcmAChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]; oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]>>1;
} }
for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) { for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1); oscBuf[i]->data[oscBuf[i]->needle++]=(adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1))>>1;
} }
oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=abe->get_last_out(0)+abe->get_last_out(1); oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=(abe->get_last_out(0)+abe->get_last_out(1))>>1;
} }
} }

View file

@ -401,19 +401,19 @@ void DivPlatformYM2610B::acquire_combo(short** buf, size_t len) {
for (int i=0; i<psgChanOffs; i++) { for (int i=0; i<psgChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]; oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]>>1;
} }
ssge->get_last_out(ssgOut); ssge->get_last_out(ssgOut);
for (int i=psgChanOffs; i<adpcmAChanOffs; i++) { for (int i=psgChanOffs; i<adpcmAChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]; oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]>>1;
} }
for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) { for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1); oscBuf[i]->data[oscBuf[i]->needle++]=(adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1))>>1;
} }
oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=abe->get_last_out(0)+abe->get_last_out(1); oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=(abe->get_last_out(0)+abe->get_last_out(1))>>1;
} }
} }
@ -471,19 +471,19 @@ void DivPlatformYM2610B::acquire_ymfm(short** buf, size_t len) {
for (int i=0; i<psgChanOffs; i++) { for (int i=0; i<psgChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1)); oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))>>1;
} }
ssge->get_last_out(ssgOut); ssge->get_last_out(ssgOut);
for (int i=psgChanOffs; i<adpcmAChanOffs; i++) { for (int i=psgChanOffs; i<adpcmAChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]; oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-psgChanOffs]>>1;
} }
for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) { for (int i=adpcmAChanOffs; i<adpcmBChanOffs; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1); oscBuf[i]->data[oscBuf[i]->needle++]=(adpcmAChan[i-adpcmAChanOffs]->get_last_out(0)+adpcmAChan[i-adpcmAChanOffs]->get_last_out(1))>>1;
} }
oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=abe->get_last_out(0)+abe->get_last_out(1); oscBuf[adpcmBChanOffs]->data[oscBuf[adpcmBChanOffs]->needle++]=(abe->get_last_out(0)+abe->get_last_out(1))>>1;
} }
} }

View file

@ -76,7 +76,7 @@ void DivPlatformYMZ280B::acquire(short** buf, size_t len) {
for (int j=0; j<8; j++) { for (int j=0; j<8; j++) {
dataL+=why[j*2][i]; dataL+=why[j*2][i];
dataR+=why[j*2+1][i]; dataR+=why[j*2+1][i];
oscBuf[j]->data[oscBuf[j]->needle++]=(short)(((int)why[j*2][i]+why[j*2+1][i])/2); oscBuf[j]->data[oscBuf[j]->needle++]=(short)(((int)why[j*2][i]+why[j*2+1][i])/4);
} }
buf[0][pos]=(short)(dataL/8); buf[0][pos]=(short)(dataL/8);
buf[1][pos]=(short)(dataR/8); buf[1][pos]=(short)(dataR/8);

View file

@ -124,6 +124,7 @@ const char* aboutLine[]={
"Ultraprogramer", "Ultraprogramer",
"UserSniper", "UserSniper",
"Weeppiko", "Weeppiko",
"Xan",
"Yuzu4K", "Yuzu4K",
"Zaxolotl", "Zaxolotl",
"ZoomTen (Zumi)", "ZoomTen (Zumi)",

View file

@ -93,7 +93,7 @@ void FurnaceGUI::calcChanOsc() {
unsigned short needlePos=buf->needle; unsigned short needlePos=buf->needle;
needlePos-=displaySize; needlePos-=displaySize;
for (unsigned short i=0; i<512; i++) { for (unsigned short i=0; i<512; i++) {
float y=(float)buf->data[(unsigned short)(needlePos+(i*displaySize/512))]/65536.0f; float y=(float)buf->data[(unsigned short)(needlePos+(i*displaySize/512))]/32768.0f;
if (minLevel>y) minLevel=y; if (minLevel>y) minLevel=y;
if (maxLevel<y) maxLevel=y; if (maxLevel<y) maxLevel=y;
} }
@ -400,14 +400,14 @@ void FurnaceGUI::drawChanOsc() {
needlePos-=displaySize; needlePos-=displaySize;
for (unsigned short i=0; i<precision; i++) { for (unsigned short i=0; i<precision; i++) {
float y=(float)buf->data[(unsigned short)(needlePos+(i*displaySize/precision))]/65536.0f; float y=(float)buf->data[(unsigned short)(needlePos+(i*displaySize/precision))]/32768.0f;
if (minLevel>y) minLevel=y; if (minLevel>y) minLevel=y;
if (maxLevel<y) maxLevel=y; if (maxLevel<y) maxLevel=y;
} }
dcOff=(minLevel+maxLevel)*0.5f; dcOff=(minLevel+maxLevel)*0.5f;
for (unsigned short i=0; i<precision; i++) { for (unsigned short i=0; i<precision; i++) {
float x=(float)i/(float)precision; float x=(float)i/(float)precision;
float y=(float)buf->data[(unsigned short)(needlePos+(i*displaySize/precision))]/65536.0f; float y=(float)buf->data[(unsigned short)(needlePos+(i*displaySize/precision))]/32768.0f;
y-=dcOff; y-=dcOff;
if (y<-0.5f) y=-0.5f; if (y<-0.5f) y=-0.5f;
if (y>0.5f) y=0.5f; if (y>0.5f) y=0.5f;

View file

@ -1,5 +1,6 @@
#include "fileDialog.h" #include "fileDialog.h"
#include "ImGuiFileDialog.h" #include "ImGuiFileDialog.h"
#include "util.h"
#include "../ta-log.h" #include "../ta-log.h"
#ifdef USE_NFD #ifdef USE_NFD
@ -152,6 +153,7 @@ bool FurnaceGUIFileDialog::openLoad(String header, std::vector<String> filter, c
ImGuiFileDialog::Instance()->singleClickSel=mobileUI; ImGuiFileDialog::Instance()->singleClickSel=mobileUI;
ImGuiFileDialog::Instance()->DpiScale=dpiScale; ImGuiFileDialog::Instance()->DpiScale=dpiScale;
ImGuiFileDialog::Instance()->mobileMode=mobileUI; ImGuiFileDialog::Instance()->mobileMode=mobileUI;
ImGuiFileDialog::Instance()->homePath=getHomeDir();
ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,allowMultiple?999:1,nullptr,0,clickCallback); ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,allowMultiple?999:1,nullptr,0,clickCallback);
} }
opened=true; opened=true;
@ -235,6 +237,7 @@ bool FurnaceGUIFileDialog::openSave(String header, std::vector<String> filter, c
ImGuiFileDialog::Instance()->singleClickSel=false; ImGuiFileDialog::Instance()->singleClickSel=false;
ImGuiFileDialog::Instance()->DpiScale=dpiScale; ImGuiFileDialog::Instance()->DpiScale=dpiScale;
ImGuiFileDialog::Instance()->mobileMode=mobileUI; ImGuiFileDialog::Instance()->mobileMode=mobileUI;
ImGuiFileDialog::Instance()->homePath=getHomeDir();
ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite); ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite);
} }
opened=true; opened=true;