@@ -18,11 +18,11 @@ Uint8*data; Uint32 len; // length in bytes } WaveSound; static Uint8 sound_on; -static Sint16 mmlvolume=9001; +static Sint16 mmlvolume=10000; static SDL_AudioSpec spec; static WaveSound*standardsounds; static Uint16 nstandardsounds; static WaveSound*usersounds; static Uint16 nusersounds; @@ -259,11 +259,12 @@ mmltuning=malloc(256*sizeof(Uint32)); if(!mmltuning) fatal("Allocation failed\n"); optionquery[2]=Q_mmlTuning; if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) f=strtod(v,0); else f=440.0; f*=0x80000000U/(double)spec.freq; - for(i=0;i<256;i++) mmltuning[i]=f*pow(2.0,(i-96)/24.0); + for(i=0;i<190;i++) mmltuning[i]=f*pow(2.0,(i-96)/24.0); + for(i=0;i<64;i++) mmltuning[i+190]=(((long long)(i+2))<<37)/spec.freq; optionquery[2]=Q_mmlTempo; if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) i=strtol(v,0,10); else i=120; // Convert quarter notes per minute to samples per sixty-fourth note mmltempo=(spec.freq*60)/(i*16); } @@ -321,15 +322,19 @@ mmlpos=1; mmltime=mmlsound[1]*mmltempo; } void set_sound_effect(Value v1,Value v2) { - static const unsigned char*const builtin[4]={ + static const unsigned char*const builtin[8]={ "s.g", "scdefgab+c-bagfedc-c", - "i1c+c+c+c+c+c+c", + "i1c+c+c+c+c+c+cx", "-cc'c#d,dd'd#ee'ff'f#", + "sn190n191n192n193n194n195n196n197n198n199n200n201n202n203n204n205n206n207n208n209n210", + "z+c-gec-gec", + "t+c-gec", + "tc-c+d-d+e-e+f-f+g-g", }; const unsigned char*s; if(!sound_on) return; if(!v2.t && !v2.u && (mmlpos || wavesound)) return; SDL_LockAudio(); @@ -353,11 +358,11 @@ if(s=value_string_ptr(v1)) set_mml(s); break; case TY_FOR: // (only used for the sound test) if(!mmlvolume) break; - set_mml(builtin[v1.u&3]); + set_mml(builtin[v1.u&7]); break; } SDL_UnlockAudio(); } @@ -387,11 +392,11 @@ if(mmltuning) printf("mmltempo=%d; mmlvolume=%d; mmltuning[96]=%d\n",(int)mmltempo,(int)mmlvolume,(int)mmltuning[96]); for(i=0;iw-16)/240?:1; scrmax=(nitems+columns-1)/columns; set_cursor(XC_arrow); redraw: SDL_FillRect(screen,0,0x02);