nukeykt / Nuked-SC55

Roland SC-55 series emulation
Other
383 stars 40 forks source link

Splash Cymbal produces harsh static when TVF Cutoff Frequency is set to +9 or higher #9

Closed MIDIMan2 closed 5 months ago

MIDIMan2 commented 6 months ago

For some reason, playing the Splash Cymbal on a drum channel while the channel's TVF Cutoff Frequency is set to +9 or higher produces a harsh static sound.

Below is a comparison between my hardware SC-55mkII and Nuked SC-55. In both recordings, the Splash Cymbal is played with a cutoff of 0, then again with a cutoff of +9.

Real SC-55mkII: Splash Cymbal on SC-55mkII.webm

Nuked SC-55 (LOUDNESS WARNING): Splash Cymbal on Nuked SC-55.webm

Here's a ZIP file containing the MIDI (since GitHub won't let me upload the raw .mid file) used in both recordings: SplashCymbalCutoffBug.zip

nukeykt commented 6 months ago

Some overflow happens in filter applying stage, either I'm missing something there or it is possible that mk1 and mk2 have differences in their PCM chip. Nuked-SC55 runs mk2 firmware but emulates mk1 PCM chip. Will come back to this when mk1 support is added.

zaphod77 commented 6 months ago

yeah, mkII uses r15239229 according to the service manual, while original uses r15329166

so will probably have to decap one of THOSE too.

r15239148 is the one in the scc-1(a), ad apparently SOME models of sc-55.

this is annoying.

Axis4s commented 6 months ago

For some reason, playing the Splash Cymbal on a drum channel while the channel's TVF Cutoff Frequency is set to +9 or higher produces a harsh static sound.

Below is a comparison between my hardware SC-55mkII and Nuked SC-55. In both recordings, the Splash Cymbal is played with a cutoff of 0, then again with a cutoff of +9.

Real SC-55mkII: Splash Cymbal on SC-55mkII.webm

Nuked SC-55 (LOUDNESS WARNING): Splash Cymbal on Nuked SC-55.webm

Here's a ZIP file containing the MIDI (since GitHub won't let me upload the raw .mid file) used in both recordings: SplashCymbalCutoffBug.zip

[OFFTOPIC, sorry, idk if github has a DMs system] question, how did you manage to use cutoff freq? can it be automated into a midi CC?

giulioz commented 6 months ago

@Axis4s not midi CC but NRPN, look into page 91 http://cdn.roland.com/assets/media/pdf/SC-55MKII_OM.pdf You need to send three control changes: NRPN MSB, NRPN LSB and Data Entry MSB

Axis4s commented 6 months ago

@Axis4s not midi CC but NRPN, look into page 91 http://cdn.roland.com/assets/media/pdf/SC-55MKII_OM.pdf You need to send three control changes: NRPN MSB, NRPN LSB and Data Entry MSB

I Wonder if its possible to use them in FLStudio, been working on a New MIDIout preset that should cover all the needs for this emulator

Axis4s commented 6 months ago

@Axis4s not midi CC but NRPN, look into page 91 http://cdn.roland.com/assets/media/pdf/SC-55MKII_OM.pdf You need to send three control changes: NRPN MSB, NRPN LSB and Data Entry MSB

image image Got a setup going in FLStudio but.. uh in the manual it uses characters? while in FL they are numbers

giulioz commented 6 months ago

Those are hex numbers! You can convert them: https://www.rapidtables.com/convert/number/hex-to-decimal.html

Axis4s commented 6 months ago

Those are hex numbers! You can convert them: https://www.rapidtables.com/convert/number/hex-to-decimal.html

I see, i think i understand now, thank you

giulioz commented 6 months ago

In the manual there is: 01H NRPN LSB 08H NRPN MSB XXH Data Entry MSB

(H stands for HEX, mm stands for input number, I used XX here for clarity)

giulioz commented 6 months ago

The MSB should be 1

giulioz commented 6 months ago

Also, you need to enable it by doing a GS reset or going in the settings, sorry

image
Axis4s commented 6 months ago

In the manual there is: 01H NRPN LSB 08H NRPN MSB XXH Data Entry MSB

(H stands for HEX, mm stands for input number, I used XX here for clarity)

image gave it a test, no results image mind that i was using the Midi CC values for the NRPN

Axis4s commented 6 months ago

Also, you need to enable it by doing a GS reset or going in the settings, sorry image

Ah i see, speaking of this it would be nice if the emulator saved user settings

how do i do a GS reset

Karmeck commented 6 months ago

Also, you need to enable it by doing a GS reset or going in the settings, sorry image

Ah i see, speaking of this it would be nice if the emulator saved user settings

how do i do a GS reset

Start emulator. Press Q, hold U, press Q again. Let go of U, press W. Done.

This is explained in the owners manual. Page 36.

shingo45endo commented 4 months ago

The original SC-55 PCM chip seems to have a bug that produces such kind of harsh noise. I edited MIDIMan2's MIDI file and reproduced this bug on several actual SC-55(mk1) units I have. (Confirmed on v1.00, v1.21, and v2.00)

Before explaining what is being done with this MIDI file, I'd like to explain the difference between mk1 and mk2 regarding Cutoff Frequency. First, in mk1, the Cutoff Frequency value range is supposed to be "-50 ~ +16", but in reality it has no effect in the positive direction. Even if the maximum value of "+16" is specified, it is no different from "±0" aurally. In contrast to mk1, setting a positive value to Cutoff Frequency makes the sound brighter normally in mk2. (After the SC-55mkII was released, this difference in behavior became widely known in the Japanese DTM community as one of a compatibility issue with the original SC-55.)

However, the SC-55 has another way to control Cutoff Frequency. GS sound modules (including SC-55) can assign various parameters such as pitch, filter, volume, and LFO to aftertouch and control changes. (This feature is equivalent to the "Controller Destination Setting" in the later GM Level 2.) In the attached MIDI file, the "CAf TVF Cutoff Control (40 2n 21)" SysEx is used to set the sound to become brighter as the channel aftertouch value is increased. With this method, it is possible to brighten the sound on the mk1. (This method was known in a small part of the Japanese DTM community at the time, but some people said that it sometimes produced terrible noise on the mk1.)

Here's an event list of the attached SMF. SysEx F0 41 10 42 12 40 20 21 7F 00 F7 is used to set the "CAf TVF Cutoff Control" value of the drum part to "+9600 [cent]". Then aftertouch is set to "3" to brighten the sound, resulting in terrible noise.

Tr. hh:mm:ss:msec Kind Ch. Values
2 00:00:00:000 Track Name n/a
2 00:00:00:000 Port Prefix n/a 1
2 00:00:00:000 SysEx n/a F0 41 10 42 12 40 00 7F 00 41 F7 (GS Reset)
2 00:00:00:250 SysEx n/a F0 41 10 42 12 40 20 21 7F 00 F7 (CAf TVF Cutoff Control)
2 00:00:00:250 Control Change 10 7 (Volume), 100
2 00:00:00:291 Program Change 10 0 (Standard)
2 00:00:02:000 Ch. Aftertouch 10 0
2 00:00:02:000 Note On 10 55 (Splash Cymbal), 127, 96
2 00:00:02:500 Note Off 10 55 (Splash Cymbal), 0, 96
2 00:00:03:000 Ch. Aftertouch 10 3
2 00:00:03:000 Note On 10 55 (Splash Cymbal), 127, 96
2 00:00:03:500 Note Off 10 55 (Splash Cymbal), 0, 96
2 00:00:04:000 End of Track n/a

This is just my guess, but I suspect that the SC-55 firmware is programmed as if the Cutoff Frequency value is "±0" when "+1 ~ +16" is specified, in order to hide the defect in the SC-55 PCM chip. If this speculation is correct, it would make sense as an emulator to generate harsh noise with the combination of "mk1 equivalent PCM chip emulation implementation" and "mk2 firmware".

(I've disassembled and analyzed the SC-55 firmware to support this speculation, but nothing has been found so far on this matter...)

nukeykt commented 4 months ago

interesting, thanks for confirming that this is indeed PCM chip bug

shingo45endo commented 3 months ago

(I've disassembled and analyzed the SC-55 firmware to support this speculation, but nothing has been found so far on this matter...)

I may have found an evidence for the original SC-55 ignoring the TVF cutoff in the positive direction and report it for your information.

Here's an excerpt from the disassembly list for the SC-55 MCU firmware ROM. This process adds the offset value of the TVF Cutoff of the part parameter to the base value of the TVF Cutoff in the tone parameter. The final calculated TVF Cutoff value is stored in R4 and this value is used in the process from 0x0041e4.

CLR.W   R4                              ; 0041B7  AC13
MOV:G.B @(H'00A3:16,R0),R4              ; 0041B9  F000A384      // R4 = TVF Base Filter of voice (tone) param
MOV:G.W @(46:8,R0),R2                   ; 0041BD  E82E82
MOV:G.B @(18:8,R2),R6                   ; 0041C0  E21286        // R6 = TVF Cutoff of part param
SUB.B   #H'40:8,R6                      ; 0041C3  044036
BCC     H'41D2                          ; 0041C6  240A
NEG.B   R6                              ; 0041C8  A614
SUB.B   R6,R4                           ; 0041CA  A634
BPL     H'41E4                          ; 0041CC  2A16
CLR.B   R4                              ; 0041CE  A413
BRA     H'41E4                          ; 0041D0  2012
BTST.B  #2,@(H'00A2:16,R0)              ; 0041D2  F000A2F2      // voice_param[8] (or tone_param[40 or 124])
BNE     H'41E4                          ; 0041D6  260C          // Skips addition of TVF Cutoff
CMP:E.B #H'10:8,R6                      ; 0041D8  4610
BCS     H'41DE                          ; 0041DA  2502
MOV:E.B #H'10:8,R6                      ; 0041DC  5610
ADD:G.B R6,R4                           ; 0041DE  A624          // R4 = TVF Base Filter + TVF Cutoff
BPL     H'41E4                          ; 0041E0  2A02
MOV:E.B #H'7F:8,R4                      ; 0041E2  547F
SWAP.B  R4                              ; 0041E4  A410
...

The key point here is the branching process from 0x0041d2 to 0x0041d6. When the part parameter of TVF Cutoff is a positive value, the process of adding TVF Cutoff (at 0x0041de) is skipped if the branch process of 0x0041d2 to 0x0041d6 is established. The BTST instruction at 0x0041d2 examines a specific byte/bit of the tone parameter, but since “0xFF” is stored for all tones in the SC-55, the branch instruction after this is always valid. As a result, a positive value for the part parameter TVF Cutoff is always ineffective.

After this, there is another similar process, but again, if TVF Cutoff is a positive value, the addition is skipped.

CLR.W   R4                              ; 004665  AC13
MOV:G.B @(H'00A3:16,R0),R4              ; 004667  F000A384      // R4 = TVF Base Filter of voice (tone) param
MOV:G.W @(46:8,R0),R2                   ; 00466B  E82E82
MOV:G.B @(18:8,R2),R6                   ; 00466E  E21286        // R6 = TVF Cutoff of part param
SUB.B   #H'40:8,R6                      ; 004671  044036
BCC     H'4680                          ; 004674  240A
NEG.B   R6                              ; 004676  A614
SUB.B   R6,R4                           ; 004678  A634
BPL     H'4692                          ; 00467A  2A16
CLR.B   R4                              ; 00467C  A413
BRA     H'4692                          ; 00467E  2012
BTST.B  #2,@(H'00A2:16,R0)              ; 004680  F000A2F2      // voice_param[8] (or tone_param[40 or 124])
BNE     H'4692                          ; 004684  260C          // Skips addition of TVF Cutoff
CMP:E.B #H'10:8,R6                      ; 004686  4610
BCS     H'468C                          ; 004688  2502
MOV:E.B #H'10:8,R6                      ; 00468A  5610
ADD:G.B R6,R4                           ; 00468C  A624          // R4 = TVF Base Filter + TVF Cutoff
BPL     H'4692                          ; 00468E  2A02
MOV:E.B #H'7F:8,R4                      ; 004690  547F
SWAP.B  R4                              ; 004692  A410
...

In contrast to the original SC-55, there is no such branching process in the TVF calculation process of the SC-55mkII. (and there is no process to round the maximum TVF Cutoff value to “+16” as well).

CLR.W   R4                              ; 003F3B  AC13
MOV:G.B @(H'00A3:16,R0),R4              ; 003F3D  F000A384      // R4 = TVF Base Filter of voice (tone) param
MOV:G.W @(46:8,R0),R2                   ; 003F41  E82E82
MOV:G.B @(18:8,R2),R6                   ; 003F44  E21286        // R6 = TVF Cutoff of part param
SUB.B   #H'40:8,R6                      ; 003F47  044036
BCC     H'3F56                          ; 003F4A  240A
NEG.B   R6                              ; 003F4C  A614
SUB.B   R6,R4                           ; 003F4E  A634
BPL     H'3F5C                          ; 003F50  2A0A
CLR.B   R4                              ; 003F52  A413
BRA     H'3F5C                          ; 003F54  2006
ADD:G.B R6,R4                           ; 003F56  A624          // R4 = TVF Base Filter + TVF Cutoff
BPL     H'3F5C                          ; 003F58  2A02
MOV:E.B #H'7F:8,R4                      ; 003F5A  547F
SWAP.B  R4                              ; 003F5C  A410
...