TempleOSCD_150720.ISO
This commit is contained in:
1 parent
401601816c
commit
f8c05f98f4
554 files changed
+26046
-24853
No files matched your search
@@ -16,12 +16,13 @@ class CFileSND
|
||||
//#define MAX_SND_FILE_DATA 0x0007FF00
|
||||
#define MAX_SND_FILE_DATA 0x7FFFFF00
|
||||
|
||||
public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,F64 averaging=0.0,I64 waveform=WF_SQUARE,
|
||||
F64 reverb_delay=0,F64 reverb_intensity=0,F64 time_shift=0)
|
||||
public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,
|
||||
F64 averaging=0.0,I64 waveform=WF_SQUARE,
|
||||
F64 reverb_delay=0,F64 reverb_intensity=0,F64 time_shift=0)
|
||||
{//Use "snd.record" flag to start or stop recording, then call this routine.
|
||||
//Averaging should be a num from 0.0 to 0.999.
|
||||
//Vol should be from 0.0 to 1.0.
|
||||
//Set reverb_delay to like 0.3 sec and reverb_intensity to like 0.4.
|
||||
//Vol should be from 0.0 to 1.0.
|
||||
//Set reverb_delay to like 0.3 sec and reverb_intensity to like 0.4.
|
||||
I64 i,k,cnt,cnt2,level,file_num;
|
||||
F64 avg,dt;
|
||||
CFileSND *s;
|
||||
@@ -78,14 +79,14 @@ public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,F64 averaging=
|
||||
avg=0;
|
||||
for (i=0;i<cnt-1;i++)
|
||||
s->body[i]=avg=LowPass1(averaging,avg,s->body[i],1.0);
|
||||
}
|
||||
}
|
||||
|
||||
//Reverb
|
||||
if (reverb_intensity) {
|
||||
if (dt=reverb_delay*SNDFILE_SAMPLE_RATE)
|
||||
for (i=dt;i<cnt;i++)
|
||||
s->body[i]+=reverb_intensity*s->body[i-dt];
|
||||
}
|
||||
}
|
||||
|
||||
//Get rid of D.C. component
|
||||
for (k=0;k<3;k++) {
|
||||
@@ -95,7 +96,7 @@ public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,F64 averaging=
|
||||
level/=cnt-1;
|
||||
for (i=0;i<cnt-1;i++)
|
||||
s->body[i]=ClampI64(s->body[i]-level,MIN_I16,MAX_I16);
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0;i<cnt-1;i++)
|
||||
s->body[i]=EndianU16(s->body[i]);
|
||||
|
||||
@@ -126,8 +126,8 @@ public U0 SndWaveAddBuf(CSndWaveCtrl *swc,U8 *buf,I64 num_samples,
|
||||
F64 _freq,I64 _waveform=WF_SQUARE,F64 _amp=1.0,F64 _left=1.0, F64 _right=1.0)
|
||||
{//Add waveform to buffer.
|
||||
//num_samples is multiplied by channels to get buf_len.
|
||||
//left,right range from 0.0-1.0
|
||||
//Supports 16,24 and 32 bits
|
||||
//left,right range from 0.0-1.0
|
||||
//Supports 16,24 and 32 bits
|
||||
I64 reg i,reg j,reg k;
|
||||
F64 a,f,amp,reg phase;
|
||||
if (!swc) return;
|
||||
@@ -195,7 +195,7 @@ public U0 SndWaveAddBuf(CSndWaveCtrl *swc,U8 *buf,I64 num_samples,
|
||||
}
|
||||
break;
|
||||
}
|
||||
//left channel
|
||||
//left channel
|
||||
k=j*_left;
|
||||
if (swc->sample_bits==16) {
|
||||
k>>=16;
|
||||
@@ -205,7 +205,7 @@ public U0 SndWaveAddBuf(CSndWaveCtrl *swc,U8 *buf,I64 num_samples,
|
||||
k&=0xFFFFFF00;
|
||||
buf(I32 *)[i++]+=k;
|
||||
}
|
||||
//right channel
|
||||
//right channel
|
||||
if (swc->channels==2) {
|
||||
k=j*_right;
|
||||
if (swc->sample_bits==16) {
|
||||
|
||||
+23
-23
@@ -20,7 +20,7 @@ public class CMusicGlbls
|
||||
|
||||
#help_index "Snd/Music;Time/Seconds"
|
||||
public F64 tM()
|
||||
{//Time in seconds synchronized to music subsystem.
|
||||
{//Time in seconds synced to music subsystem.
|
||||
return (cnts.jiffies+music.tM_correction)/JIFFY_FREQ;
|
||||
}
|
||||
|
||||
@@ -98,37 +98,37 @@ U8 *MusicSetNoteLen(U8 *st)
|
||||
public U0 Play(U8 *st,U8 *words=NULL)
|
||||
{/* Notes are entered with a capital letter.
|
||||
|
||||
Octaves are entered with a digit and
|
||||
stay set until changed.
|
||||
Octaves are entered with a digit and
|
||||
stay set until changed.
|
||||
|
||||
Durations are entered with
|
||||
'w' whole note
|
||||
'h' half note
|
||||
'q' quarter note
|
||||
'e' eighth note
|
||||
't' sets to 2/3rds the current duration
|
||||
'.' sets to 1.5 times the current duration
|
||||
durations stay set until changed.
|
||||
Durations are entered with
|
||||
'w' whole note
|
||||
'h' half note
|
||||
'q' quarter note
|
||||
'e' eighth note
|
||||
't' sets to 2/3rds the current duration
|
||||
'.' sets to 1.5 times the current duration
|
||||
durations stay set until changed.
|
||||
|
||||
'(' tie, placed before the note to be extended
|
||||
'(' tie, placed before the note to be extended
|
||||
|
||||
$LK,"music.meter_top",A="MN:CMusicGlbls"$,$LK,"music.meter_bottom",A="MN:CMusicGlbls"$ is set with
|
||||
"M3/4"
|
||||
"M4/4"
|
||||
etc.
|
||||
$LK,"music.meter_top",A="MN:CMusicGlbls"$,$LK,"music.meter_bottom",A="MN:CMusicGlbls"$ is set with
|
||||
"M3/4"
|
||||
"M4/4"
|
||||
etc.
|
||||
|
||||
Sharp and flat are done with '#' or 'b'.
|
||||
Sharp and flat are done with '#' or 'b'.
|
||||
|
||||
The var music.stacatto_factor can
|
||||
be set to a range from 0.0 to 1.0.
|
||||
The var music.stacatto_factor can
|
||||
be set to a range from 0.0 to 1.0.
|
||||
|
||||
The var music.tempo is quarter-notes
|
||||
per second. It defaults to
|
||||
2.5 and gets faster when bigger.
|
||||
The var music.tempo is quarter-notes
|
||||
per second. It defaults to
|
||||
2.5 and gets faster when bigger.
|
||||
*/
|
||||
U8 *word,*last_st;
|
||||
I64 note,i=0,timeout_val,timeout_val2;
|
||||
Bool tie,old_preempt=Preempt(OFF);
|
||||
Bool tie,old_preempt=Preempt;
|
||||
F64 f,d,on_jiffies,off_jiffies;
|
||||
music.play_note_num=0;
|
||||
while (*st) {
|
||||
|
||||
Reference in new issue
Block a user