TempleOSTS_131005.ISO
This commit is contained in:
1 parent
1343005a29
commit
2d2a65d572
547 files changed
+33608
-12549
No files matched your search
@@ -0,0 +1,20 @@
|
||||
//7 no nothing
|
||||
U0 Song()
|
||||
{
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
music_tempo= 2.480;
|
||||
music_stacatto_factor= 0.902;
|
||||
try {
|
||||
while (!ScanKey) {
|
||||
Play("2q.GeGqG3sBBCB2q.GeGqG3sBBCB");
|
||||
Play("q.C2eG3CsDC2eGG3qC2G3eCsDC2eGG");
|
||||
Play("3sEAEAeCsCReRsDAe.GsBFFFFeEsAGeCsGDeDG");
|
||||
Play("sEAEAeCsCReRsDAe.GsBFFFFeEsAGeCsGDeDG");
|
||||
}
|
||||
} catch
|
||||
CatchAll;
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
Song;
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
//7 has words
|
||||
//8 has words
|
||||
U0 Song()
|
||||
{
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
//7 no nothing
|
||||
U0 Song()
|
||||
{
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
music_tempo= 2.480;
|
||||
music_stacatto_factor= 0.902;
|
||||
try {
|
||||
while (!ScanKey) {
|
||||
Play("3e.C2sG3qEe.FsBeCCsFGeBAAetAREeEsCB");
|
||||
Play("e.C2sG3qEe.FsBeCCsFGeBAAetAREeEsCB");
|
||||
Play("eGE2qG3sCDCDe.EsGqCsDCDCe.AsReGE");
|
||||
Play("GE2qG3sCDCDe.EsGqCsDCDCe.AsReGE");
|
||||
}
|
||||
} catch
|
||||
CatchAll;
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
Song;
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
//7 no nothing
|
||||
U0 Song()
|
||||
{
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
music_tempo= 2.480;
|
||||
music_stacatto_factor= 0.902;
|
||||
try {
|
||||
while (!ScanKey) {
|
||||
Play("3qAeCDqEAeCDECDECsCC");
|
||||
Play("qAeCDqEAeCDECDECsCC");
|
||||
Play("eDAGAqDsECECCBCBeAFsDCeGDE");
|
||||
Play("DAGAqDsECECCBCBeAFsDCeGDE");
|
||||
}
|
||||
} catch
|
||||
CatchAll;
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
Song;
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
//7 no nothing
|
||||
U0 Song()
|
||||
{
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
music_tempo= 2.480;
|
||||
music_stacatto_factor= 0.902;
|
||||
try {
|
||||
while (!ScanKey) {
|
||||
Play("3qGsARARCBCBeACACGCGBAsEA");
|
||||
Play("qGsARARCBCBeACACGCGBAsEA");
|
||||
Play("eAsCEqEsDECEqAsDACAeAGFsBDeCB");
|
||||
Play("AsCEqEsDECEqAsDACAeAGFsBDeCB");
|
||||
}
|
||||
} catch
|
||||
CatchAll;
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
Song;
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -17,11 +17,11 @@ U0 PutVerse()
|
||||
I64 *start;
|
||||
|
||||
DocClear;
|
||||
start=GetTimeStamp/16%size;
|
||||
start=GetTSC/16%size;
|
||||
if (start>size-LEN) start=size-LEN;
|
||||
ch=bible[start+LEN-1];
|
||||
bible[start+LEN-1]=0;
|
||||
"" bible+start;
|
||||
"%s",bible+start;
|
||||
bible[start+LEN-1]=ch;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -4,9 +4,9 @@ $WW,1$$FG,5$$TX+CX,"Music Organ Help"$$FG$
|
||||
|
||||
* The clipboard can be used to cut and paste.
|
||||
|
||||
* $FG,2$MusicOrgan$FG$ uses $LK,"Holy C","FI:::/TempleOS/Doc/HolyC.TXT"$ files as it's fmt! See $LK-A,"::/TempleOS/Apps/MusicOrgan/Examples/personal.CPP"$. It does not fully parse them when loading back in, so changes made outside $FG,2$MusicOrgan$FG$ can be lost.
|
||||
* $FG,2$MusicOrgan$FG$ uses $LK,"HolyC","FI:::/TempleOS/Doc/HolyC.TXT"$ files as it's fmt! See $LK-A,"::/TempleOS/Apps/MusicOrgan/Examples/personal.CPP"$. It does not fully parse them when loading back in, so changes made outside $FG,2$MusicOrgan$FG$ can be lost.
|
||||
|
||||
* The first line of the $LK,"Holy C","FI:::/TempleOS/Doc/HolyC.TXT"$ files has a comment with a category recognized by $LK,"JukeBox","FF:::/TempleOS/Apps/MusicOrgan/JukeBox.CPP,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the comment is a digit rating number.
|
||||
* The first line of the $LK,"HolyC","FI:::/TempleOS/Doc/HolyC.TXT"$ files has a comment with a category recognized by $LK,"JukeBox","FF:::/TempleOS/Apps/MusicOrgan/JukeBox.CPP,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the comment is a digit rating number.
|
||||
|
||||
* You can take the $LK,"Play","MN:Play"$() statements out of a song file and place them in your programs. You can also add a song to a document with $FG,2$<CTRL-L>$FG$, but you should do it after pressing $FG,2$<CTRL-T>$FG$ because the clipboard-insert in $FG,2$<CTRL-L>$FG$ is screwy. See this $SO,"<Song>","2qG3ECB2eGG3qCeFDsBGBG2qG3ECB2eGG3qCeFDsBGBGqEeEFqEB2eG3FetCAGqFCEeEFqEB2eG3FetCAGqFC"$ after pressing $FG,2$<CTRL-T>$FG$, now.
|
||||
|
||||
|
||||
@@ -20,20 +20,20 @@ CTask *SingleSong(U8 *msg,U8 *name)
|
||||
Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
{ //ch=ASCII; sc=scancode
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
CDirEntry *tempm;
|
||||
CDirEntry *tempde;
|
||||
CDoc *s;
|
||||
if (!(sc&(SCF_ALT|SCF_CTRL|SCF_SHIFT))
|
||||
&& doc_ce->type_u8==DOCT_MENU_VAL && doc_ce->left_exp>=0) {
|
||||
tempm=doc_ce->left_exp;
|
||||
tempde=doc_ce->left_exp;
|
||||
if (sc.u8[0]==SC_DELETE ) {
|
||||
Beep;
|
||||
Silent(ON);
|
||||
Del(tempm->full_name);
|
||||
Del(tempde->full_name);
|
||||
Silent(OFF);
|
||||
} else if ('0'<=ch<='9') {
|
||||
if (StrLen(doc_ce->tag)>1)
|
||||
doc_ce->tag[0]=ch;
|
||||
s=DocRead(tempm->full_name);
|
||||
s=DocRead(tempde->full_name);
|
||||
doc_e=s->root.next;
|
||||
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
||||
doc_e=doc_e->next;
|
||||
@@ -44,7 +44,7 @@ Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
DocDel(s);
|
||||
return TRUE;
|
||||
} else if (ch==CH_SPACE||ch==CH_ESC)
|
||||
tempm->user_data++; //JB_RUN_LEVEL++
|
||||
tempde->user_data++; //JB_RUN_LEVEL++
|
||||
//<SPACE BAR> is followed by <ESC> --> JB_RUN_LEVEL_TWO
|
||||
//Actual <ESC> just exits --> JB_RUN_LEVEL_ONE
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public U0 JukeBox(U8 *dirname=NULL,U8 **_filename=NULL)
|
||||
//_filename is for using this as a song-chooser program.
|
||||
I64 i=0,rating;
|
||||
U8 *st,*st2;
|
||||
CDirEntry *tempm,*tempm1;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDoc *doc=DocNew,*s;
|
||||
CDocEntry *doc_e;
|
||||
StrCpy(doc->desc,"JukeBox");
|
||||
@@ -67,24 +67,24 @@ public U0 JukeBox(U8 *dirname=NULL,U8 **_filename=NULL)
|
||||
dirname=StrNew("HOME/MusicOrgan");
|
||||
else
|
||||
dirname=StrNew(dirname);
|
||||
st=MSPrintF("%s/*.CPP.Z",dirname);
|
||||
tempm=FilesFind(st);
|
||||
st=MPrint("%s/*.CPP.Z",dirname);
|
||||
tempde=FilesFind(st);
|
||||
Free(st);
|
||||
Free(dirname);
|
||||
doc->user_put_key=&JBPutKey;
|
||||
tempm1=tempm;
|
||||
DocPutS(doc,
|
||||
tempde1=tempde;
|
||||
DocPrint(doc,
|
||||
"Key: $$FG,GREEN$$Graphics $$FG,BLUE$$Words $$FG,RED$$No Nothing "
|
||||
"$$FG,BLACK$$Incomplete $$FG,CYAN$$Special$$FG$$\n\n"
|
||||
"$$FG,GREEN$$<DELETE>$$FG$$ to delete a song.\n"
|
||||
"Press a number to rate a song.\n");
|
||||
while (tempm1) {
|
||||
while (tempde1) {
|
||||
if (!(i++%5))
|
||||
DocPutS(doc,"\n");
|
||||
if (FileOcc("Play(",tempm1->full_name,"")) {
|
||||
st=StrNew(tempm1->name);
|
||||
DocPrint(doc,"\n");
|
||||
if (FileOcc("Play(",tempde1->full_name,"")) {
|
||||
st=StrNew(tempde1->name);
|
||||
FileExtRem(st);
|
||||
s=DocRead(tempm1->full_name);
|
||||
s=DocRead(tempde1->full_name);
|
||||
doc_e=s->root.next;
|
||||
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
||||
doc_e=doc_e->next;
|
||||
@@ -92,55 +92,55 @@ public U0 JukeBox(U8 *dirname=NULL,U8 **_filename=NULL)
|
||||
if (doc_e!=s && doc_e->type_u8==DOCT_TEXT) {
|
||||
if ('0'<=doc_e->tag[2]<='9')
|
||||
rating=doc_e->tag[2];
|
||||
if (StrStr(doc_e->tag,"incomplete"))
|
||||
DocPutS(doc,"$$FG,BLACK$$");
|
||||
else if (StrStr(doc_e->tag,"has graphics"))
|
||||
DocPutS(doc,"$$FG,GREEN$$");
|
||||
else if (StrStr(doc_e->tag,"has words"))
|
||||
DocPutS(doc,"$$FG,BLUE$$");
|
||||
else if (StrStr(doc_e->tag,"special"))
|
||||
DocPutS(doc,"$$FG,CYAN$$");
|
||||
else if (StrStr(doc_e->tag,"no nothing")) {
|
||||
DocPutS(doc,"$$FG,RED$$");
|
||||
if (FileOcc("\\0",tempm1->full_name,"")) {
|
||||
if (StrMatch("incomplete",doc_e->tag))
|
||||
DocPrint(doc,"$$FG,BLACK$$");
|
||||
else if (StrMatch("has graphics",doc_e->tag))
|
||||
DocPrint(doc,"$$FG,GREEN$$");
|
||||
else if (StrMatch("has words",doc_e->tag))
|
||||
DocPrint(doc,"$$FG,BLUE$$");
|
||||
else if (StrMatch("special",doc_e->tag))
|
||||
DocPrint(doc,"$$FG,CYAN$$");
|
||||
else if (StrMatch("no nothing",doc_e->tag)) {
|
||||
DocPrint(doc,"$$FG,RED$$");
|
||||
if (FileOcc("\\0",tempde1->full_name,"")) {
|
||||
s->cur_entry=doc_e->next;
|
||||
s->cur_data_col=0;
|
||||
DocEntryDel(s,doc_e);
|
||||
DocPutS(s,"//0 has words\n");
|
||||
DocPrint(s,"//0 has words\n");
|
||||
DocWrite(s);
|
||||
}
|
||||
}
|
||||
DocPrintF(doc,"$$MU-UL,\"%c%-8ts\",%d$$ ",rating,st,tempm1);
|
||||
tempm1->user_data=JB_RUN_LEVEL_NULL;
|
||||
DocPrint(doc,"$$MU-UL,\"%c%-8ts\",%d$$ ",rating,st,tempde1);
|
||||
tempde1->user_data=JB_RUN_LEVEL_NULL;
|
||||
}
|
||||
DocDel(s);
|
||||
Free(st);
|
||||
}
|
||||
tempm1=tempm1->next;
|
||||
tempde1=tempde1->next;
|
||||
}
|
||||
DocPrintF(doc,"\n$$FG,CYAN$$$$MU-UL,\"DONE\",%d$$\n",DOCM_CANCEL);
|
||||
DocPrint(doc,"\n$$FG,CYAN$$$$MU-UL,\"DONE\",%d$$\n",DOCM_CANCEL);
|
||||
while (TRUE) {
|
||||
if (_filename)
|
||||
tempm1=PopUpMenu(doc,DOF_INTERCEPT_TASK_END);
|
||||
tempde1=PopUpMenu(doc,DOF_INTERCEPT_TASK_END);
|
||||
else
|
||||
tempm1=PopUpMenu(doc);
|
||||
tempde1=PopUpMenu(doc);
|
||||
if (task)
|
||||
Kill(task);
|
||||
if (tempm1<0) break;
|
||||
st2=StrNew(tempm1->name);
|
||||
if (tempde1<0) break;
|
||||
st2=StrNew(tempde1->name);
|
||||
if (_filename) {
|
||||
Free(*_filename);
|
||||
*_filename=StrNew(tempm1->full_name);
|
||||
*_filename=StrNew(tempde1->full_name);
|
||||
}
|
||||
if (tempm1->user_data==JB_RUN_LEVEL_ONE) break; //<ESC>
|
||||
tempm1->user_data=JB_RUN_LEVEL_NULL; //Rst from <SPACE BAR>
|
||||
if (tempde1->user_data==JB_RUN_LEVEL_ONE) break; //<ESC>
|
||||
tempde1->user_data=JB_RUN_LEVEL_NULL; //Rst from <SPACE BAR>
|
||||
FileExtRem(st2);
|
||||
st=MSPrintF("ExeFile(\"%s\");",tempm1->full_name);
|
||||
st=MPrint("ExeFile(\"%s\");",tempde1->full_name);
|
||||
MusicSettingsRst;
|
||||
task=SingleSong(st,st2);
|
||||
Free(st2);
|
||||
Free(st);
|
||||
}
|
||||
DocDel(doc);
|
||||
CDirLstDel(tempm);
|
||||
DirLstDel(tempde);
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
U0 SongPuppet(CTask *task,I64 passes)
|
||||
{
|
||||
CDbgInfo *dbg;
|
||||
I64 i,start,end,rip,last_rip;
|
||||
CHashFun *tempf=NULL;
|
||||
for (i=0;i<250 && TaskValidate(task);i++) {
|
||||
if (tempf=HashFind("Song",task->hash_table,HTT_FUN))
|
||||
break;
|
||||
Sleep(1);
|
||||
}
|
||||
if (tempf && (dbg=tempf->debug)) {
|
||||
start=tempf->executable_addr;
|
||||
end =dbg->body[dbg->max_line+1-dbg->min_line];
|
||||
last_rip=0;
|
||||
while (TRUE) {
|
||||
i=0;
|
||||
while (TaskValidate(task) && (rip=TaskCaller(task,i++))) {
|
||||
if (start<=rip<end) {
|
||||
if (rip<last_rip && --passes<=0)
|
||||
return;
|
||||
last_rip=rip;
|
||||
}
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U0 JukeSongPuppet(CTask *juke_task,I64 passes,I64 song_num,U8 *name)
|
||||
{
|
||||
Bool found;
|
||||
CTask *task;
|
||||
I64 i;
|
||||
|
||||
if (FileExtDot(name))
|
||||
FileExtRem(name);
|
||||
while (!TaskValidate(juke_task->popup_task))
|
||||
Sleep(10);
|
||||
|
||||
TaskWait(juke_task->popup_task);
|
||||
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL);
|
||||
TaskWait(juke_task->popup_task);
|
||||
for (i=0;i<song_num;i++) {
|
||||
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT);
|
||||
TaskWait(juke_task->popup_task);
|
||||
}
|
||||
|
||||
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0);
|
||||
TaskWait(juke_task->popup_task);
|
||||
Sleep(500);
|
||||
|
||||
found=FALSE;
|
||||
task=Fs->next_task;
|
||||
while (task!=Fs) {
|
||||
if (!StrCmp(task->task_title,name)) {
|
||||
found=TRUE;
|
||||
break;
|
||||
}
|
||||
task=task->next_task;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
//Position cursor on song title during song
|
||||
TaskWait(juke_task->popup_task);
|
||||
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL);
|
||||
TaskWait(juke_task->popup_task);
|
||||
for (i=0;i<song_num;i++) {
|
||||
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT);
|
||||
TaskWait(juke_task->popup_task);
|
||||
}
|
||||
SongPuppet(task,passes);
|
||||
}
|
||||
Kill(task);
|
||||
}
|
||||
|
||||
public U0 JukeSongsPuppet(U8 *dir="HOME/MusicOrgan",I64 passes=2,
|
||||
I64 start_song=0,I64 end_song=MAX_I64)
|
||||
{
|
||||
I64 i;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CTask *juke_task=SpawnUser("JukeBox(0x%X);\n",dir);
|
||||
Cd(dir);
|
||||
tempde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES);
|
||||
for (tempde=tempde1,i=0;tempde && i<start_song;i++)
|
||||
tempde=tempde->next;
|
||||
for (i=start_song;tempde && i<end_song;i++) {
|
||||
JukeSongPuppet(juke_task,passes,i,tempde->name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirLstDel(tempde1);
|
||||
Kill(juke_task);
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "/TempleOS/Apps/HolySpirit/HolySpirit"
|
||||
#include "/TempleOS/Apps/MusicOrgan/MakeSong"
|
||||
#include "/TempleOS/Apps/MusicOrgan/JukeBox"
|
||||
#include "/TempleOS/Apps/MusicOrgan/JukePuppet"
|
||||
#include "/TempleOS/Apps/MusicOrgan/OrganCtrls"
|
||||
#include "/TempleOS/Apps/MusicOrgan/Organ"
|
||||
#help_index ""
|
||||
@@ -10,15 +10,6 @@ class MakeSongSettings
|
||||
|
||||
U0 InsNote(MakeSongSettings *mss,U8 *buf,I64 k,I64 *j)
|
||||
{ //k is a random note nibble
|
||||
I64 a=TimerPickedNibble; //accent
|
||||
if (!a) {
|
||||
buf[*j]='!';
|
||||
*j+=1;
|
||||
}
|
||||
if (a<4) {
|
||||
buf[*j]='!';
|
||||
*j+=1;
|
||||
}
|
||||
if (!k && mss->rests) {
|
||||
buf[*j]='R';
|
||||
*j+=1;
|
||||
@@ -67,7 +58,7 @@ U8 *MakeSong()
|
||||
mss.rests=FALSE;
|
||||
mss.octave=music_octave;
|
||||
|
||||
if (!PopUpForm(&mss,"MakeSongSettings"))
|
||||
if (!PopUpForm(&mss))
|
||||
return NULL;
|
||||
|
||||
buf=CAlloc(256);
|
||||
@@ -87,8 +78,9 @@ U8 *MakeSong()
|
||||
buf[j++]='8';
|
||||
} else
|
||||
len=8;
|
||||
TimerPickFlush;
|
||||
for (i=0;i<len;i++) {
|
||||
n=TimerPickedNibble<<4+TimerPickedNibble;
|
||||
n=TimerPickedBits(8);
|
||||
if (mss.complex_rhythms)
|
||||
duration=complex_songs[n%9];
|
||||
else if (mss.normal_rhythms)
|
||||
@@ -96,22 +88,19 @@ U8 *MakeSong()
|
||||
else
|
||||
duration=simple_songs[n%5];
|
||||
|
||||
k=TimerPickedNibble;
|
||||
switch (duration) {
|
||||
case DUR_8_8:
|
||||
if (last_duration!=DUR_8_8)
|
||||
buf[j++]='e';
|
||||
InsNote(&mss,buf,k,&j);
|
||||
k=TimerPickedNibble;
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
break;
|
||||
case DUR_8DOT_16:
|
||||
buf[j++]='e';
|
||||
buf[j++]='.';
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
buf[j++]='s';
|
||||
k=TimerPickedNibble;
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
duration=DUR_16_16_16_16;
|
||||
break;
|
||||
case DUR_3_3_3:
|
||||
@@ -119,48 +108,42 @@ U8 *MakeSong()
|
||||
buf[j++]='e';
|
||||
buf[j++]='t';
|
||||
}
|
||||
InsNote(&mss,buf,k,&j);
|
||||
k=TimerPickedNibble;
|
||||
InsNote(&mss,buf,k,&j);
|
||||
k=TimerPickedNibble;
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
break;
|
||||
case DUR_8_16_16:
|
||||
if (last_duration!=DUR_8_8)
|
||||
buf[j++]='e';
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
buf[j++]='s';
|
||||
k=TimerPickedNibble;
|
||||
InsNote(&mss,buf,k,&j);
|
||||
k=TimerPickedNibble;
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
duration=DUR_16_16_16_16;
|
||||
break;
|
||||
case DUR_16_16_8:
|
||||
if (last_duration!=DUR_16_16_16_16)
|
||||
buf[j++]='s';
|
||||
InsNote(&mss,buf,k,&j);
|
||||
k=TimerPickedNibble;
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
buf[j++]='e';
|
||||
k=TimerPickedNibble;
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
duration=DUR_8_8;
|
||||
break;
|
||||
case DUR_16_16_16_16:
|
||||
if (last_duration!=DUR_16_16_16_16)
|
||||
buf[j++]='s';
|
||||
InsNote(&mss,buf,k,&j);
|
||||
k2=k;
|
||||
k=TimerPickedNibble;
|
||||
k =TimerPickedBits(4);
|
||||
k2=TimerPickedBits(4);
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,k2,&j);
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,k2,&j);
|
||||
break;
|
||||
default:
|
||||
if (last_duration!=DUR_4)
|
||||
buf[j++]='q';
|
||||
InsNote(&mss,buf,k,&j);
|
||||
InsNote(&mss,buf,TimerPickedBits(4),&j);
|
||||
}
|
||||
last_duration=duration;
|
||||
progress4++;
|
||||
|
||||
@@ -37,15 +37,11 @@ $WW,0$*/
|
||||
|
||||
|
||||
#define Of_SELECTED 0
|
||||
#define OF_SELECTED 1
|
||||
#define Of_SHARP 1
|
||||
#define Of_FLAT 2
|
||||
#define Of_TIE 3
|
||||
|
||||
#define OF_SELECTED 1
|
||||
#define OF_SHARP 2
|
||||
#define OF_FLAT 4
|
||||
#define OF_TIE 8
|
||||
|
||||
class OrgNote
|
||||
{
|
||||
OrgNote *next,*last;
|
||||
@@ -170,7 +166,7 @@ Bool OrgHasWords(U8 *st)
|
||||
|
||||
Bool OrgIsDotted(I64 duration)
|
||||
{
|
||||
U8 *st=LstEntryPt(duration,org_duration_lst);
|
||||
U8 *st=LstSub(duration,org_duration_lst);
|
||||
if (st[1]=='.')
|
||||
return TRUE;
|
||||
else
|
||||
@@ -216,7 +212,7 @@ U0 OrgRecalcNoteXY()
|
||||
note=0;
|
||||
octave++;
|
||||
}
|
||||
note=music_note_map[*LstEntryPt(note,org_note_lst)-'A'];
|
||||
note=music_note_map[*LstSub(note,org_note_lst)-'A'];
|
||||
tempo->y=(15+(org_note_map[note]-7*(octave-2)))*4;
|
||||
}
|
||||
}
|
||||
@@ -351,8 +347,8 @@ U0 DrawNote(CDC *dc,I64 x,I64 y,I64 duration)
|
||||
|
||||
U0 DrawTimeSignature(CDC *dc,I64 x,I64 y,I64 top,I64 bottom)
|
||||
{
|
||||
GrPrintF(dc,x,y,"%d",top);
|
||||
GrPrintF(dc,x,y+FONT_HEIGHT,"%d",bottom);
|
||||
GrPrint(dc,x,y,"%d",top);
|
||||
GrPrint(dc,x,y+FONT_HEIGHT,"%d",bottom);
|
||||
}
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
@@ -399,7 +395,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
} else {
|
||||
if (tempo==oc.cur_note && OrgBlink) {
|
||||
dc->color=BROWN;
|
||||
GrPutS(dc,x+8,y,tempo->word);
|
||||
GrPrint(dc,x+8,y,"%s",tempo->word);
|
||||
} else if (tempo->flags&OF_SELECTED)
|
||||
dc->color=RED;
|
||||
else {
|
||||
@@ -445,7 +441,7 @@ F64 PopUpDuration()
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPutS(doc,"$$FG,GREEN$$$$MU,\"Set Word\",ORGR_SET_WORD$$\n"
|
||||
DocPrint(doc,"$$FG,GREEN$$$$MU,\"Set Word\",ORGR_SET_WORD$$\n"
|
||||
"$$MU,\"Toggle Sharp\",ORGR_SHARP$$\n"
|
||||
"$$MU,\"Toggle Flat\",ORGR_FLAT$$\n"
|
||||
"$$MU,\"Toggle Tie\",ORGR_TIE$$\n"
|
||||
@@ -456,8 +452,8 @@ F64 PopUpDuration()
|
||||
"$$MU,\"Accent\",ORGR_ACCENT$$\n"
|
||||
"$$MU,\"Strong Accent\",ORGR_STRONG_ACCENT$$\n\n");
|
||||
for (i=0;i<ORG_NUM_DURATIONS;i++)
|
||||
DocPrintF(doc,"$$MU,\"%7.5f\",%d$$\n",org_durations[i],i);
|
||||
DocPutS(doc,"\n$$MU,\"CANCEL\",DOCM_CANCEL$$\n");
|
||||
DocPrint(doc,"$$MU,\"%7.5f\",%d$$\n",org_durations[i],i);
|
||||
DocPrint(doc,"\n$$MU,\"CANCEL\",DOCM_CANCEL$$\n");
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -526,15 +522,15 @@ U0 OrgRightClick(I64 x,I64 y)
|
||||
if (tempo->type==OT_NOTE) {
|
||||
if (DocPut) DocPut->flags&=~DOCF_FORM;
|
||||
if (OrgHasWords(tempo->word))
|
||||
st2=MSPrintF("\nWord(\"%Q\"):",tempo->word);
|
||||
st2=MPrint("\nWord(\"%Q\"):",tempo->word);
|
||||
else
|
||||
st2=MSPrintF("\nWord(\"\"):");
|
||||
st2=MPrint("\nWord(\"\"):");
|
||||
DocBottom;
|
||||
st=PmtStr(st2);
|
||||
Free(st2);
|
||||
Free(tempo->word);
|
||||
if (*st) {
|
||||
tempo->word=MSPrintF("%q",st);
|
||||
tempo->word=MPrint("%q",st);
|
||||
Free(st);
|
||||
} else
|
||||
tempo->word=StrNew(" ");
|
||||
@@ -1068,7 +1064,7 @@ U8 *OrgCvtSong()
|
||||
note=0;
|
||||
octave++;
|
||||
}
|
||||
note=music_note_map[*LstEntryPt(note,org_note_lst)-'A'];
|
||||
note=music_note_map[*LstSub(note,org_note_lst)-'A'];
|
||||
}
|
||||
if (Bt(&tempo->flags,Of_TIE))
|
||||
*dst++='(';
|
||||
@@ -1077,14 +1073,14 @@ U8 *OrgCvtSong()
|
||||
last_octave=octave;
|
||||
}
|
||||
if (tempo->duration!=last_duration) {
|
||||
src=LstEntryPt(tempo->duration,org_duration_lst);
|
||||
src=LstSub(tempo->duration,org_duration_lst);
|
||||
*dst++=src[0];
|
||||
if (src[1])
|
||||
*dst++=src[1];
|
||||
last_duration=tempo->duration;
|
||||
}
|
||||
if (note!=NOTE_REST) {
|
||||
src=LstEntryPt(note,org_note_lst);
|
||||
src=LstSub(note,org_note_lst);
|
||||
*dst++=src[0];
|
||||
if (src[1])
|
||||
*dst++=src[1];
|
||||
@@ -1132,13 +1128,13 @@ U8 *OrgSaveSong(U8 *dirname,U8 *full_filename)
|
||||
tempo=tempo->next;
|
||||
}
|
||||
if (oc.incomplete_entry->checked)
|
||||
DocPutS(doc,"//0 incomplete\n");
|
||||
DocPrint(doc,"//0 incomplete\n");
|
||||
else if (has_words)
|
||||
DocPutS(doc,"//0 has words\n");
|
||||
DocPrint(doc,"//0 has words\n");
|
||||
else
|
||||
DocPutS(doc,"//0 no nothing\n");
|
||||
DocPrint(doc,"//0 no nothing\n");
|
||||
|
||||
DocPrintF(doc,
|
||||
DocPrint(doc,
|
||||
"U0 Song()\n"
|
||||
"{\n"
|
||||
" Fs->task_end_cb=&SndTaskEndCB;\n"
|
||||
@@ -1153,7 +1149,7 @@ U8 *OrgSaveSong(U8 *dirname,U8 *full_filename)
|
||||
tempo1=tempo;
|
||||
has_words=FALSE;
|
||||
while (tempo!=&oc.root) {
|
||||
DocPutS(doc,tempo->ascii);
|
||||
DocPrint(doc,"%s",tempo->ascii);
|
||||
if (OrgHasWords(tempo->word)) has_words=TRUE;
|
||||
if (tempo->type==OT_METER) {
|
||||
measure_len=tempo->meter_top*4.0/tempo->meter_bottom;
|
||||
@@ -1163,7 +1159,7 @@ U8 *OrgSaveSong(U8 *dirname,U8 *full_filename)
|
||||
tempo=tempo->next;
|
||||
if (two_measure_left<0.001 && tempo!=&oc.root) {
|
||||
if (has_words) {
|
||||
DocPutS(doc,"\",\n\t\t\"");
|
||||
DocPrint(doc,"\",\n\t\t\"");
|
||||
while (tempo1!=tempo) {
|
||||
if (tempo1->type!=OT_METER) {
|
||||
if (ptr=tempo1->word) {
|
||||
@@ -1172,14 +1168,14 @@ U8 *OrgSaveSong(U8 *dirname,U8 *full_filename)
|
||||
*ptr=CH_SHIFT_SPACE;
|
||||
ptr++;
|
||||
}
|
||||
DocPrintF(doc,"%Q\\0",tempo1->word);
|
||||
DocPrint(doc,"%Q\\0",tempo1->word);
|
||||
} else
|
||||
DocPrintF(doc,"%c\\0",CH_SHIFT_SPACE);
|
||||
DocPrint(doc,"%c\\0",CH_SHIFT_SPACE);
|
||||
}
|
||||
tempo1=tempo1->next;
|
||||
}
|
||||
}
|
||||
DocPutS(doc,"\");\n"
|
||||
DocPrint(doc,"\");\n"
|
||||
"\tPlay(\"");
|
||||
two_measure_left=2*measure_len;
|
||||
tempo1=tempo;
|
||||
@@ -1187,7 +1183,7 @@ U8 *OrgSaveSong(U8 *dirname,U8 *full_filename)
|
||||
}
|
||||
}
|
||||
if (has_words) {
|
||||
DocPutS(doc,"\",\n\t\t\"");
|
||||
DocPrint(doc,"\",\n\t\t\"");
|
||||
while (tempo1!=tempo) {
|
||||
if (tempo1->type!=OT_METER) {
|
||||
if (ptr=tempo1->word) {
|
||||
@@ -1196,14 +1192,14 @@ U8 *OrgSaveSong(U8 *dirname,U8 *full_filename)
|
||||
*ptr=CH_SHIFT_SPACE;
|
||||
ptr++;
|
||||
}
|
||||
DocPrintF(doc,"%Q\\0",tempo1->word);
|
||||
DocPrint(doc,"%Q\\0",tempo1->word);
|
||||
} else
|
||||
DocPrintF(doc,"%c\\0",CH_SHIFT_SPACE);
|
||||
DocPrint(doc,"%c\\0",CH_SHIFT_SPACE);
|
||||
}
|
||||
tempo1=tempo1->next;
|
||||
}
|
||||
}
|
||||
DocPutS(doc,"\");\n"
|
||||
DocPrint(doc,"\");\n"
|
||||
" }\n"
|
||||
" } catch\n"
|
||||
" CatchAll;\n"
|
||||
@@ -1216,7 +1212,7 @@ U8 *OrgSaveSong(U8 *dirname,U8 *full_filename)
|
||||
StrCpy(doc->filename.name,full_filename);
|
||||
Free(full_filename);
|
||||
} else
|
||||
SPrintF(doc->filename.name,"%s/Temp.CPP.Z",dirname);
|
||||
SPrint(doc->filename.name,"%s/Temp.CPP.Z",dirname);
|
||||
DocWrite(doc,TRUE);
|
||||
full_filename=StrNew(doc->filename.name);
|
||||
DocDel(doc);
|
||||
@@ -1230,7 +1226,7 @@ U0 OrgSetOctave(I64 octave)
|
||||
U8 buf[136];
|
||||
CMenuEntry *tempse;
|
||||
for (i=0;i<=6;i++) {
|
||||
SPrintF(buf,"Snd/Octave%d",i);
|
||||
SPrint(buf,"Snd/Octave%d",i);
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,buf)) {
|
||||
if (i==octave)
|
||||
tempse->checked=TRUE;
|
||||
@@ -1619,7 +1615,7 @@ got_msg:
|
||||
"$$FG,GREEN$$<SHIFT-ESC>$$FG$$ to load it into MusicOrgan.\n\n"
|
||||
ST_WARN_ST " Graphics and other embelishments\n"
|
||||
"will be lost because MusicOrgan can't\n"
|
||||
"parse Holy C programs completely.\n");
|
||||
"parse HolyC programs completely.\n");
|
||||
Free(filename);
|
||||
filename=NULL;
|
||||
JukeBox(dirname,&filename);
|
||||
@@ -1702,7 +1698,7 @@ got_msg:
|
||||
oc.cur_note=tempo;
|
||||
oc.screen_x+=tempo->x-0.33*GR_WIDTH;
|
||||
if (OrgHasWords(tempo->word))
|
||||
"" tempo->word;
|
||||
"%s",tempo->word;
|
||||
note=tempo->note;
|
||||
octave=tempo->octave;
|
||||
if (note!=NOTE_REST)
|
||||
@@ -1811,7 +1807,7 @@ got_msg:
|
||||
}
|
||||
if (f!=last_f) {
|
||||
if (f>0) {
|
||||
st=LstEntryPt(note,org_note_lst);
|
||||
st=LstSub(note,org_note_lst);
|
||||
org_play_f=f;
|
||||
} else {
|
||||
if (f<0)
|
||||
@@ -1840,7 +1836,7 @@ got_msg:
|
||||
}
|
||||
}
|
||||
last_f=f;
|
||||
"" st;
|
||||
"%s",st;
|
||||
col+=StrLen(st);
|
||||
if (col>=Fs->win_width-1) {
|
||||
NewLine;
|
||||
@@ -1864,52 +1860,183 @@ got_msg:
|
||||
Free(dirname);
|
||||
MenuPop;
|
||||
}
|
||||
| ||||