home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 May / PCW596.iso / polskie / eduk / genfast / demo_11.pak / KEYBOARD.DA_ < prev    next >
Text File  |  1996-03-16  |  8KB  |  417 lines

  1. ; Aplikacja przykÆadowa - syntezator jednogÆosowy
  2. ; GENIO CX 2000 z syntezå obwiedni 5-cio gÆosowej
  3. ; zakoñczenie aplikacji - klawiszem [Esc]
  4.  
  5. [procedure OBWIEDNIA]
  6. ; graficzne przedstawienie obwiedni
  7. @downarea(260,40,443,150,15)
  8. ; kaºda z czæ₧ci wykresu ma 40 punktów
  9. @setcolors(1,0)
  10. @line(275,95-(%f/20),315,95-(%g/20))
  11. @setcolors(2,0)
  12. @line(315,95-(%g/20),355,95-(%h/20))
  13. @setcolors(3,0)
  14. @line(355,95-(%h/20),395,95-(%i/20))
  15. @setcolors(4,0)
  16. @line(395,95-(%i/20),430,95-(%j/20))
  17. @SetColors(0,7)
  18. @SetPosition(270,50)
  19. @FastWrite('Krzywa obwiedni')
  20. @line(270,60,270,140)
  21. @line(265,135,438,135)
  22. @return
  23.  
  24. [procedure EKRAN]
  25. ; ekran poczåtkowy
  26. ; dªwiækiem podstawowym jest równowarto₧ì labelki strony []
  27. ; zapisane w zmiennej k
  28. ; zmienna d = oktawa (tylko teoretycznie)
  29. @d:=1
  30. ; zmienna e = czas trwania (wybrzmiewania) dªwiæku w milisekundach
  31. @e:=10
  32. ; zmienne f-j zawierajå czæ₧ci skÆadowe obwiedni
  33. @f:=0
  34. @g:=0
  35. @h:=0
  36. @i:=0
  37. @j:=0
  38. ; rysowanie ekranu
  39. @SetColors(0,0)
  40. @bar(0,0,639,479)
  41. @uparea(10,10,629,469,9)
  42. @uparea(20,20,619,300,1)
  43. @downarea(30,30,609,290,9)
  44. @setcolors(8,0)
  45. @bar(23,301,619,464)
  46. ; napis SYNTEZATOR...
  47. @setcolors(7,0)
  48. @SetPosition(42,42)
  49. @Picture('napis.cgv')
  50. @SetColors(0,0)
  51. @SetPosition(40,40)
  52. @Picture('napis.cgv')
  53. @call:obwiednia
  54. ;gÆo₧nik
  55. @downarea(453,40,598,150,8)
  56. @a:=458
  57. @setcolors(7,7)
  58. @repeat:14
  59. @uparea(%a,45,%a+5,145,0)
  60. @a:=%a+10
  61. @next
  62. ; regulatory:
  63. @uparea(40,160,598,280,9)
  64. ; regulator 1 - oktawy
  65. @SetColors(3,0)
  66. @rectangle(50,170,130,270)
  67. @setcolors(9,0)
  68. @bar(60,168,120,172)
  69. @setcolors(15,0)
  70. @SetPosition(70,168)
  71. @fastwrite('OKTAWA')
  72. @setcolors(8,7)
  73. @drawbutton(60,180,120,200,3,650,'+','')
  74. @setcolors(0,7)
  75. @bar(60,201,120,244)
  76. @setcolors(14,0)
  77. @writevalue(60,201,120,244,0,0,%d)
  78. @setcolors(8,7)
  79. @drawbutton(60,245,120,265,3,651,'-','')
  80. ; regulator 2 - czas
  81. @SetColors(4,0)
  82. @rectangle(140,170,220,270)
  83. @setcolors(9,0)
  84. @bar(150,168,210,172)
  85. @setcolors(15,0)
  86. @SetPosition(165,168)
  87. @fastwrite('CZAS')
  88. @setcolors(8,7)
  89. @drawbutton(150,180,210,200,4,652,'+','')
  90. @setcolors(0,7)
  91. @bar(150,201,210,244)
  92. @setcolors(14,0)
  93. @writevalue(150,201,210,244,0,0,%e)
  94. @setcolors(8,7)
  95. @drawbutton(150,245,210,265,4,653,'-','')
  96. ; regulatory 3-7 - obwiednia
  97. ; 3 - skÆadowa1
  98. @SetColors(14,0)
  99. @rectangle(230,170,590,270)
  100. @setcolors(9,0)
  101. @bar(240,168,320,172)
  102. @setcolors(15,0)
  103. @SetPosition(245,168)
  104. @fastwrite('OBWIEDNIA')
  105. @setcolors(8,7)
  106. @drawbutton(240,180,300,200,2,654,'+','')
  107. @setcolors(0,7)
  108. @bar(240,201,300,244)
  109. @setcolors(14,0)
  110. @writevalue(240,201,300,244,0,0,%f)
  111. @setcolors(8,7)
  112. @drawbutton(240,245,300,265,2,655,'-','')
  113. ; 4 -  skÆadowa2
  114. @drawbutton(305,180,365,200,2,656,'+','')
  115. @setcolors(0,7)
  116. @bar(305,201,365,244)
  117. @setcolors(14,0)
  118. @writevalue(305,201,365,244,0,0,%g)
  119. @setcolors(8,7)
  120. @drawbutton(305,245,365,265,2,657,'-','')
  121. ; 5 - skÆadowa3
  122. @drawbutton(370,180,430,200,2,658,'+','')
  123. @setcolors(0,7)
  124. @bar(370,201,430,244)
  125. @setcolors(14,0)
  126. @writevalue(370,201,430,244,0,0,%h)
  127. @setcolors(8,7)
  128. @drawbutton(370,245,430,265,2,659,'-','')
  129. ; 6 - skÆadowa4
  130. @drawbutton(435,180,495,200,2,660,'+','')
  131. @setcolors(0,7)
  132. @bar(435,201,495,244)
  133. @setcolors(14,0)
  134. @writevalue(435,201,495,244,0,0,%i)
  135. @setcolors(8,7)
  136. @drawbutton(435,245,495,265,2,661,'-','')
  137. ; 7 - skÆadowa5
  138. @drawbutton(500,180,560,200,2,662,'+','')
  139. @setcolors(0,7)
  140. @bar(500,201,560,244)
  141. @setcolors(14,0)
  142. @writevalue(500,201,560,244,0,0,%j)
  143. @setcolors(8,7)
  144. @drawbutton(500,245,560,265,2,663,'-','')
  145. ; przycisk zerujåcy obwiedniæ
  146. @drawbutton(565,180,580,265,2,664,'=','')
  147. ; przyciski on/off
  148. @drawbutton(40,110,140,150,2,701,'W£ÅCZ','')
  149. @drawbutton(150,110,250,150,4,700,'WY£ÅCZ','')
  150. ;klawisze biaÆe i czarne
  151. @setcolors(0,8)
  152. @a:=20
  153. @repeat:17
  154. @uparea(%a,301,%a+34,459,15)
  155. @setinvisiblebutton(%a,301,%a+34,449,%a)
  156. @a:=%a+35
  157. @next
  158. @SetColors(8,7)
  159. @b:=43
  160. @c:=0
  161. [3]
  162. @c:=%c+1
  163. @if (%c = 3) then begin
  164. @b:=%b+35
  165. @goto:3
  166. @end
  167. @if (%c = 7) then begin
  168. @b:=%b+35
  169. @goto:3
  170. @end
  171. @if (%c = 10) then begin
  172. @b:=%b+35
  173. @goto:3
  174. @end
  175. @if (%c = 14) then begin
  176. @b:=%b+35
  177. @goto:3
  178. @end
  179. @if (%c = 17) then goto:4
  180. @setcolors(7,0)
  181. @bar(%b+3,301,%b+23,383)
  182. @uparea(%b,301,%b+20,380,0)
  183. @setinvisiblebutton(%b,301,%b+20,380,%b)
  184. @b:=%b+35
  185. @goto:3
  186. [4]
  187. @return
  188.  
  189. [1]
  190. ; wywoÆanie pierwszej strony
  191. @disablestatusbar;
  192. @call:ekran
  193. @showscreen;
  194. @defkeyboardhandler(2)
  195. @checkevents;
  196.  
  197. [2]
  198. ; je₧li [Esc] to koniec!
  199. @if (%z = $011B) then goto:0
  200. @checkevents;
  201.  
  202. [20..600]
  203. ; zmienna %k uzaliæniona od bierzåcej strony
  204. @getcurrentpage(%k)
  205. @k:=%k*%d
  206. @sound(%K+%f,%e)
  207. @sound(%K+%g,%e)
  208. @sound(%K+%h,%e)
  209. @sound(%K+%f,%e)
  210. @sound(%K+%i,%e)
  211. @sound(%K+%j,%e)
  212. @checkevents;
  213.  
  214. ; strony 650-663 zmiana warto₧ci czasu, oktawy i poszczególnych
  215. ; skÆadowych obwiedni
  216. [650]
  217. @d:=%d+1
  218. @if (%d > 6) then begin
  219. @d:=6
  220. @end
  221. @setcolors(0,7)
  222. @bar(60,201,120,244)
  223. @setcolors(14,0)
  224. @writevalue(60,201,120,244,0,0,%d)
  225. @call:obwiednia
  226. @checkevents
  227. [651]
  228. @d:=%d-1
  229. @if (%d < 1) then begin
  230. @d:=1
  231. @end
  232. @setcolors(0,7)
  233. @bar(60,201,120,244)
  234. @setcolors(14,0)
  235. @writevalue(60,201,120,244,0,0,%d)
  236. @call:obwiednia
  237. @checkevents
  238. [652]
  239. @e:=%e+1
  240. @if (%e > 100) then begin
  241. @e:=100
  242. @end
  243. @setcolors(0,7)
  244. @bar(150,201,210,244)
  245. @setcolors(14,0)
  246. @writevalue(150,201,210,244,0,0,%e)
  247. @call:obwiednia
  248. @checkevents
  249. [653]
  250. @e:=%e-1
  251. @if (%e < 5) then begin
  252. @e:=5
  253. @end
  254. @setcolors(0,7)
  255. @bar(150,201,210,244)
  256. @setcolors(14,0)
  257. @writevalue(150,201,210,244,0,0,%e)
  258. @call:obwiednia
  259. @checkevents
  260. [654]
  261. @f:=%f+10
  262. @if (%f > 1000) then begin
  263. @f:=1000
  264. @end
  265. @setcolors(0,7)
  266. @bar(240,201,300,244)
  267. @setcolors(14,0)
  268. @writevalue(240,201,300,244,0,0,%f)
  269. @call:obwiednia
  270. @checkevents
  271. [655]
  272. @f:=%f-10
  273. @if (%f < -1000) then begin
  274. @f:=-1000
  275. @end
  276. @setcolors(0,7)
  277. @bar(240,201,300,244)
  278. @setcolors(14,0)
  279. @writevalue(240,201,300,244,0,0,%f)
  280. @call:obwiednia
  281. @checkevents
  282. [656]
  283. @g:=%g+10
  284. @if (%g > 1000) then begin
  285. @g:=1000
  286. @end
  287. @setcolors(0,7)
  288. @bar(305,201,365,244)
  289. @setcolors(14,0)
  290. @writevalue(305,201,365,244,0,0,%g)
  291. @call:obwiednia
  292. @checkevents
  293. [657]
  294. @g:=%g-10
  295. @if (%g < -1000) then begin
  296. @g:=-1000
  297. @end
  298. @setcolors(0,7)
  299. @bar(305,201,365,244)
  300. @setcolors(14,0)
  301. @writevalue(305,201,365,244,0,0,%g)
  302. @call:obwiednia
  303. @checkevents
  304. [658]
  305. @h:=%h+10
  306. @if (%h > 1000) then begin
  307. @h:=1000
  308. @end
  309. @setcolors(0,7)
  310. @bar(370,201,430,244)
  311. @setcolors(14,0)
  312. @writevalue(370,201,430,244,0,0,%h)
  313. @call:obwiednia
  314. @checkevents
  315. [659]
  316. @h:=%h-10
  317. @if (%h < -1000) then begin
  318. @h:=-1000
  319. @end
  320. @setcolors(0,7)
  321. @bar(370,201,430,244)
  322. @setcolors(14,0)
  323. @writevalue(370,201,430,244,0,0,%h)
  324. @call:obwiednia
  325. @checkevents
  326. [660]
  327. @i:=%i+10
  328. @if (%i > 1000) then begin
  329. @i:=1000
  330. @end
  331. @setcolors(0,7)
  332. @bar(435,201,495,244)
  333. @setcolors(14,0)
  334. @writevalue(435,201,495,244,0,0,%i)
  335. @call:obwiednia
  336. @checkevents
  337. [661]
  338. @i:=%i-10
  339. @if (%i < -1000) then begin
  340. @i:=-1000
  341. @end
  342. @setcolors(0,7)
  343. @bar(435,201,495,244)
  344. @setcolors(14,0)
  345. @writevalue(435,201,495,244,0,0,%i)
  346. @call:obwiednia
  347. @checkevents
  348. [662]
  349. @j:=%j+10
  350. @if (%j > 1000) then begin
  351. @j:=1000
  352. @end
  353. @setcolors(0,7)
  354. @bar(500,201,560,244)
  355. @setcolors(14,0)
  356. @writevalue(500,201,560,244,0,0,%j)
  357. @call:obwiednia
  358. @checkevents
  359. [663]
  360. @j:=%j-10
  361. @if (%j < -1000) then begin
  362. @j:=-1000
  363. @end
  364. @setcolors(0,7)
  365. @bar(500,201,560,244)
  366. @setcolors(14,0)
  367. @writevalue(500,201,560,244,0,0,%j)
  368. @call:obwiednia
  369. @checkevents
  370. [664]
  371. @f:=0
  372. @g:=0
  373. @h:=0
  374. @i:=0
  375. @j:=0
  376. @setcolors(0,7)
  377. @bar(240,201,300,244)
  378. @setcolors(14,0)
  379. @writevalue(240,201,300,244,0,0,%f)
  380. @setcolors(0,7)
  381. @bar(305,201,365,244)
  382. @setcolors(14,0)
  383. @writevalue(305,201,365,244,0,0,%g)
  384. @setcolors(0,7)
  385. @bar(370,201,430,244)
  386. @setcolors(14,0)
  387. @writevalue(370,201,430,244,0,0,%h)
  388. @setcolors(0,7)
  389. @bar(435,201,495,244)
  390. @setcolors(14,0)
  391. @writevalue(435,201,495,244,0,0,%i)
  392. @setcolors(0,7)
  393. @bar(500,201,560,244)
  394. @setcolors(14,0)
  395. @writevalue(500,201,560,244,0,0,%j)
  396. @sound(200,100)
  397. @sound(100,100)
  398. @call:obwiednia
  399. @checkevents
  400.  
  401. [700]
  402. ; gdy wci₧niæto klawisz off (wyÆåcz) ustawiamy niewidzialny przycisk
  403. ; który nic nie robi - skok do checkevents.
  404. ; niewidzialny przycisk - takºe na 'off'. 
  405. @setinvisiblebutton(0,251,635,479,702)
  406. @setinvisiblebutton(150,110,250,150,702)
  407. @checkevents;
  408. [701]
  409. ; po nacisniæciu przycisku on (wÆåcz) usuwany niewidzialne przyciski
  410. @deletebutton;
  411. @deletebutton;
  412. @checkevents;
  413. [702]
  414. ; to polecenie nic nie robi - specjalnie!
  415. @checkevents;
  416.  
  417.