TempleOSTS_130707.ISO
This commit is contained in:
1 parent
17b71f1a2d
commit
1343005a29
617 files changed
+14399
-25130
No files matched your search
@@ -5,8 +5,8 @@ I64 music_octave;
|
||||
F64 music_note_len;
|
||||
U8 music_note_map[7]={0,2,3,5,7,8,10};
|
||||
I64 music_mute=0;
|
||||
I64 music_waveform,music_meter_top,music_meter_bottom;
|
||||
public F64 music_tempo,music_stacatto_factor,music_amplitude;
|
||||
I64 music_meter_top,music_meter_bottom;
|
||||
public F64 music_tempo,music_stacatto_factor;
|
||||
|
||||
//This is if you wish to sync with a
|
||||
//note in a Play() string. 0 is the start
|
||||
@@ -49,19 +49,6 @@ U8 *MusicSetOctave(U8 *st)
|
||||
return --st;
|
||||
}
|
||||
|
||||
U8 *MusicSetWaveform(U8 *st)
|
||||
{
|
||||
U8 ch=*st++;
|
||||
while (ch=='W') {
|
||||
ch=*st++;
|
||||
if ('0'<=ch<'0'+WF_NUM_WAVEFORMS) {
|
||||
music_waveform=ch-'0';
|
||||
ch=*st++;
|
||||
}
|
||||
}
|
||||
return --st;
|
||||
}
|
||||
|
||||
U8 *MusicSetMeter(U8 *st)
|
||||
{
|
||||
U8 ch=*st++;
|
||||
@@ -119,17 +106,6 @@ public U0 Play(U8 *st,U8 *words=NULL)
|
||||
|
||||
'(' tie, placed before the note to be extended
|
||||
|
||||
Accents are made with
|
||||
'!' *1.5
|
||||
'!!' *1.5`2
|
||||
|
||||
$LK,"music_waveform","MN:music_waveform"$ is set with
|
||||
"W1" for $LK,"WF_SQUARE","MN:WF_SQUARE"$
|
||||
"W2" for $LK,"WF_SINE","MN:WF_SINE"$
|
||||
"W3" for $LK,"WF_TRIANGLE","MN:WF_TRIANGLE"$
|
||||
"W4" for $LK,"WF_SAWTOOTH","MN:WF_SAWTOOTH"$
|
||||
"W5" for $LK,"WF_NOISE","MN:WF_NOISE"$
|
||||
|
||||
$LK,"music_meter_top","MN:music_meter_top"$,$LK,"music_meter_bottom","MN:music_meter_bottom"$ is set with
|
||||
"M3/4"
|
||||
"M4/4"
|
||||
@@ -140,9 +116,6 @@ public U0 Play(U8 *st,U8 *words=NULL)
|
||||
The var music_stacatto_factor can
|
||||
be set to a range from 0.0 to 1.0.
|
||||
|
||||
The var music_amplitude 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.
|
||||
@@ -153,23 +126,18 @@ public U0 Play(U8 *st,U8 *words=NULL)
|
||||
U8 *word,*last_st;
|
||||
I64 note,i=0,timeout_val,timeout_val2;
|
||||
Bool tie,old_preempt=Preempt(OFF);
|
||||
F64 f,d,a,on_jiffies,off_jiffies;
|
||||
F64 f,d,on_jiffies,off_jiffies;
|
||||
music_play_note_num=0;
|
||||
while (*st) {
|
||||
timeout_val=sys_jiffies;
|
||||
a=music_amplitude;
|
||||
tie=FALSE;
|
||||
|
||||
do {
|
||||
last_st=st;
|
||||
if (*st=='!') {
|
||||
a*=1.5;
|
||||
st++;
|
||||
} else if (*st=='(') {
|
||||
if (*st=='(') {
|
||||
tie=TRUE;
|
||||
st++;
|
||||
} else {
|
||||
st=MusicSetWaveform(st);
|
||||
st=MusicSetMeter(st);
|
||||
st=MusicSetOctave(st);
|
||||
st=MusicSetNoteLen(st);
|
||||
@@ -208,12 +176,12 @@ public U0 Play(U8 *st,U8 *words=NULL)
|
||||
timeout_val2=timeout_val+off_jiffies;
|
||||
|
||||
if (!music_mute)
|
||||
Snd(f,music_waveform,a);
|
||||
Snd(f);
|
||||
SleepUntil(timeout_val);
|
||||
music_tM_correction+=on_jiffies-ToI64(on_jiffies);
|
||||
|
||||
if (!music_mute)
|
||||
Snd(0,music_waveform,a);
|
||||
Snd(0);
|
||||
SleepUntil(timeout_val2);
|
||||
music_tM_correction+=off_jiffies-ToI64(off_jiffies);
|
||||
|
||||
@@ -226,15 +194,11 @@ U0 MusicSettingsRst()
|
||||
{
|
||||
music_play_note_num=0;
|
||||
music_stacatto_factor=0.9;
|
||||
music_amplitude=1/1.5`2;
|
||||
music_tempo=2.5;
|
||||
music_octave=3;
|
||||
music_note_len=1.0;
|
||||
music_waveform=WF_SQUARE;
|
||||
music_meter_top=4;
|
||||
music_meter_bottom=4;
|
||||
snd_reverb_intensity=0.2;
|
||||
snd_reverb_delay=0.3;
|
||||
|
||||
PushFD;
|
||||
Cli;
|
||||
|
||||
Reference in new issue
Block a user