Author |
Topic: BB4W installation. (Read 2979 times) |
|
hitsware
Junior Member
member is offline


Gender: 
Posts: 70
|
 |
Re: BB4W installation.
« Reply #15 on: Jun 1st, 2014, 3:03pm » |
|
>>>>> >>> THANK YOU RICHARD ! <<<<<<<<<<<
That makes a lot of my endeavors so much easier. I have some external hardware with FREQOUT capability. (even sinewave and duty-cycle on the 'rectangular' wave) but no envelopes and only 2 channels.
>This code works with the standard, unpatched, BB4W >(either in the IDE or as a compiled EXE, and either >v5.95a or the v6 beta). However if you run it in the IDE >be aware that it modifies the frequency table, so will >affect subsequent programs using standard SOUND >statements.
Would you elaborate on that somewhat ? I just tried a short snippet of old code and noted no differance, but very short (and also didn't use the FREQOUT function more than enough to see it works).
MEGA-THANKS ! ........... Michael Miller
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
Re: BB4W installation.
« Reply #16 on: Jun 1st, 2014, 4:12pm » |
|
on Jun 1st, 2014, 3:03pm, hitsware wrote:| Would you elaborate on that somewhat ? |
|
As FNfreqout modifies the frequency table, any subsequent SOUND statements, which use the regular 'quarter-semitone' pitch values (even in a completely different program), are quite likely not to work. The safest thing to do, after running a program which uses FNfreqout, is to quit and restart BBC BASIC for Windows.
Of course if you compile your program to an EXE (which I reiterate is the way BB4W is expected to be used) this isn't an issue because its frequency table is then private to its own process.
I've written a Wiki article on FNfreqout. The same technique can be used to program the frequency table for MIDI notes, or for just intonation, so there is no longer ever a need to patch the BB4W executable.
Richard.
|
|
Logged
|
|
|
|
hitsware
Junior Member
member is offline


Gender: 
Posts: 70
|
 |
Re: BB4W installation.
« Reply #17 on: Jun 1st, 2014, 6:25pm » |
|
> quit and restart BBC BASIC for Windows
Ninguna problema !!!!!!!!!
Again I owe you a pint (or whatever is your favorite libation ) at your favorite pub .....
|
|
Logged
|
|
|
|
hitsware
Junior Member
member is offline


Gender: 
Posts: 70
|
 |
Re: BB4W installation.
« Reply #18 on: Jun 1st, 2014, 9:27pm » |
|
REM: Works Like a Charm !
*TEMPO 130
DIM f(3)
FOR x=0 TO 3: f(x)=110: NEXT x v=0: PROC_setscreen
REPEAT x=INKEY(1): a=v: b=f(v) IF x=138 THEN f(v)=f(v)-1 IF x=139 THEN f(v)=f(v)+1 IF x=136 THEN v=v-1 IF x=137 THEN v=v+1 IF v<0 THEN v=0 IF v>3 THEN v=3 IF f(v)<20 THEN f(v)=20 IF f(v)>10000 THEN f(v)=10000 IF v<>a OR f(v)<>b THEN PROC_setscreen SOUND 0,-5,FNfreqout(f(0)),1 SOUND 1,-5,FNfreqout(f(1)),1 SOUND 2,-5,FNfreqout(f(2)),1 SOUND 3,-5,FNfreqout(f(3)),1 UNTIL FALSE
DEFPROC_setscreen CLS PRINT PRINT " up-down arrows set frequency " PRINT " left-right arrows set voice " PRINT PRINT " voice 0 1 2 3 " PRINT PRINT " frequency ";f(0);" ";f(1);" ";f(2);" ";f(3) ENDPROC
DEF FNfreqout(f) LOCAL I% : PRIVATE ftab%, indx& IF ftab% = 0 THEN LOCAL base% SYS "GetModuleHandle", 0 TO base% FOR I% = base% TO base% + 65534 STEP 2 IF !I% = &03550354 IF I%!4 = &06060606 EXIT FOR NEXT IF I% > base% + 65534 ERROR 100, "Cannot locate frequency table" ftab% = I% + 8 SYS "VirtualProtect", ftab% AND -&1000, &2000, &40, ^I% TO I% IF I% = 0 ERROR 100, "Cannot make memory image writable" ENDIF indx& += 1 : IF indx& = 0 indx& = 1 I% = 2 * indx& ftab%!I% = ftab%!I% AND &FFFF0000 OR INT(f * &10000 / 22050 + 0.5) = indx&
|
|
Logged
|
|
|
|
hitsware
Junior Member
member is offline


Gender: 
Posts: 70
|
 |
Re: BB4W installation.
« Reply #19 on: Jun 6th, 2014, 02:30am » |
|
As FNfreqout modifies the frequency table, any subsequent SOUND statements, which use the regular 'quarter-semitone' pitch values (even in a completely different program), are quite likely not to work. The safest thing to do, after running a program which uses FNfreqout, is to quit and restart BBC BASIC for Windows.
> Even if moving to another routine that again > is using FNfreqout !
|
|
Logged
|
|
|
|
stargate
New Member
member is offline


Gender: 
Posts: 1
|
 |
Re: BB4W installation.
« Reply #20 on: Mar 3rd, 2015, 1:43pm » |
|
Just a quick note.
I recently bought a new computer which runs Windows7 Home Premium. I tried installing BB4W Demo version. It worked OK except I couldn't change the font setting. I tried the compatibility setting and setting it to Windows XP (SP2). It now works OK, as does BB4W full version. Hope this might help someone.
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: BB4W installation.
« Reply #21 on: Mar 3rd, 2015, 1:58pm » |
|
on Mar 3rd, 2015, 1:43pm, stargate wrote:| I tried installing BB4W Demo version. It worked OK except I couldn't change the font setting. |
|
The usual reason for not being able to change the font is forgetting to deselect the Use System Fixed Font checkbox first (it's selected by default and easy to miss).
Quote:| I tried the compatibility setting and setting it to Windows XP (SP2). |
|
BB4W v6.00a (both trial and paid-for) is fully compatible with versions of Windows up to 8.1 (in fact it even has a Windows 10 compatibility manifest!).
Richard.
|
| « Last Edit: Mar 3rd, 2015, 2:02pm by rtr2 » |
Logged
|
|
|
|
|