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


Gender: 
Posts: 70
|
 |
Re: BB4W installation.
« Reply #7 on: May 28th, 2014, 4:42pm » |
|
I have on my PC 3 patched versions (C just intoned, A just intoned, and Midi tuned) plus the BB4W tuned. It has come to the point (with many compositions) that it is impossible (for me anyways) to keep straight which composition opens (or should open) with which version. Since there is no FREQOUT (which would handle everything (but need way more than 255 note numbers)) I've decided to go (for awhile) with only Midi (for some extra range). I want to install this, (and for simplicity), this alone, on a second (Linux) PC in my studio .
MegaRegards
|
| « Last Edit: May 28th, 2014, 5:43pm by hitsware » |
Logged
|
|
|
|
rtr
Guest
|
 |
Re: BB4W installation.
« Reply #8 on: May 28th, 2014, 6:03pm » |
|
on May 28th, 2014, 4:42pm, hitsware wrote:| I want to install this, (and for simplicity), this alone, on a second (Linux) PC in my studio . |
|
Would it not make more sense to install the standard, unpatched, BB4W 5.95a and then patch each of your compiled EXEs according to which frequency table you want? You could very easily create a utility which takes a compiled EXE, asks you which tuning is appropriate, and spits out a patched version. That way the only thing which is non-standard is your compiled EXE, which of course is in any case a custom file.
You could even hijack the 'code signing' feature of BB4W (assuming you don't use it for its intended purpose) to run the patching utility, which would integrate it with BB4W and make everything 'automatic'.
Richard.
|
|
Logged
|
|
|
|
hitsware
Junior Member
member is offline


Gender: 
Posts: 70
|
 |
Re: BB4W installation.
« Reply #9 on: May 28th, 2014, 7:10pm » |
|
Clear as mud ! ....  I now only want the midi version. Come to think of it I can just do the patch on the new PC and then delete the standard version.
FWIW I seldom compile anything except once in a while in order to put it on the web. And even then tend not to because people are reticent to open .exe's. For music pieces MP3's are easier.
The world still needs BB4W with a FREQOUT that works with SOUND and ENVELOPE. I think now I see the problem in that (assuming you still use a table), it would have to be more than 1 byte ...... ?
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
Re: BB4W installation.
« Reply #10 on: May 28th, 2014, 7:25pm » |
|
on May 28th, 2014, 7:10pm, hitsware wrote:| people are reticent to open .exe's. |
|
That is exactly why I recommend signing EXEs: a digitally-signed EXE shouldn't arouse suspicion. See the recent thread for where to purchase an affordable code-signing certificate.
Richard.
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
Re: BB4W installation.
« Reply #11 on: May 28th, 2014, 10:47pm » |
|
on May 28th, 2014, 7:10pm, hitsware wrote:| I think now I see the problem in that (assuming you still use a table), it would have to be more than 1 byte |
|
True, but you might like to experiment with this partial workaround:
Patch BB4W so that the 'frequencies' table (which can hold 256 different entries) is in writable RAM rather than in protected 'code' memory.
Write a function FNfreqout which stores the appropriate 16-bit value for the required frequency into the next available table 'slot' and returns the 8-bit slot index. Now you can use SOUND and (amplitude) ENVELOPE with a specified frequency, with the proviso that you are limited to a maximum of 256 different frequencies. For example:
Code: SOUND channel+flags, envelope, FNfreqout(frequency), duration Once you have finished with a particular frequency you can reuse that table slot for another one, so you could for example arrange that FNfreqout uses all 256 slots 'circularly', reusing the oldest one each time.
It's unfortunate that this technique still relies on patching, but at least it's a once-off patch which thereafter allows you to choose any frequency (within reason).
Richard.
|
|
Logged
|
|
|
|
hitsware
Junior Member
member is offline


Gender: 
Posts: 70
|
 |
Re: BB4W installation.
« Reply #12 on: May 31st, 2014, 12:28am » |
|
>Now you can use SOUND and (amplitude) ENVELOPE >with a specified frequency, with the proviso that you >are limited to a maximum of 256 different frequencies.
You gave me a good idea ! Using the frequency table patch you already supplied : Since I only need 8 notes/octave and 6 octaves/key and 5 keys, I can get it all on the 1 table.... 
Only integers for frequencies though, correct ?
|
| « Last Edit: May 31st, 2014, 12:32am by hitsware » |
Logged
|
|
|
|
rtr
Guest
|
 |
Re: BB4W installation.
« Reply #13 on: May 31st, 2014, 07:15am » |
|
on May 31st, 2014, 12:28am, hitsware wrote:| Only integers for frequencies though, correct ? |
|
The entries in the 'frequency table' are of course 16-bit integers, but the actual resulting output frequency is n * 0.3364563 so you can choose it in steps of roughly 1/3 Hz.
Richard.
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
Re: BB4W installation.
« Reply #14 on: May 31st, 2014, 8:42pm » |
|
on May 28th, 2014, 7:10pm, hitsware wrote:| The world still needs BB4W with a FREQOUT that works with SOUND and ENVELOPE. |
|
Right, here it is. The FNfreqout function below allows you to use true frequencies (with a resolution of about 1/3 Hz) with SOUND and ENVELOPE, with the proviso that a pitch envelope won't work - at least, not without considerable effort. The other limitation is that only 255 different frequencies can be 'active' at any one time:
Code: FOR freq = 500 TO 1000
SOUND 1, -15, FNfreqout(freq), 1
NEXT
END
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& 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.
Richard.
|
| « Last Edit: May 31st, 2014, 8:45pm by rtr » |
Logged
|
|
|
|
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
|
|
|
|
|