BBC BASIC for Windows
General >> General Board >> BB4W installation.
http://bb4w.conforums.com/index.cgi?board=general&action=display&num=1395413518

BB4W installation.
Post by terabyte on Mar 21st, 2014, 2:51pm

Hi,

This is my first posting since the BB4W forum moved from Yahoo and its taken a while to catch-up with the changes.

I wonder if anyone can help please? I have BB4W on CD which I purchased back in 2008 and for the past few years I have been running BB4W on an XP system and installing the upgrades as/when they became available.

More recently I de-commissioned my old XP system in favour of a newer laptop running Windows-7. However, attempts to install BB4W in Win-7 using the CD have so far failed. I would imagine I am doing something "silly" but so far I am unable to spot the problem.

The system reports that it is unable to successfuly install BB4W and that I should contact my software supplier. As I am still somewhat unfamiliar with Win-7 it is not clear if this is the operating system or BB4W which generates the message. I attempted to install as "administrator" and also with all anti-virus software disabled but get the same response.

Reading other posts seems to confirm that BB4W will run under Win-7 so its clearly something I am doing wrong. So far however I have not found specific instructions for installation under Win-7.

Any advice or a pointer to Win-7 istallation instructions for BB4W would be appreciated.

Thanks,

Des.
Re: BB4W installation.
Post by rtr on Mar 21st, 2014, 5:41pm

on Mar 21st, 2014, 2:51pm, terabyte wrote:
However, attempts to install BB4W in Win-7 using the CD have so far failed.

It may simply be that your CD is too old. I changed installer at some point (from Sax Setup to Inno Setup) and setup files prior to that change won't always successfully install on modern versions of Windows.

Contact me directly, by email, quoting your Serial Number / Registration Key (don't quote it here!!) and so long as I can confirm your purchase in my records I will send you a new copy.

Richard.

Re: BB4W installation.
Post by terabyte on Mar 22nd, 2014, 10:00am

Hello Richard,

Thankyou for the rapid response and clarification on the BB4W installer.

I will contact you directly by e-mail as you requested.

Befor I do that could you just confirm your e-mail is still the same as it was on the 2008 paperwork (*info*@...etc) as I would not wish to send my BB4W registration key to the wrong address smiley

Thanks again for your rapid response.

Des (M0AYF)
Re: BB4W installation.
Post by rtr on Mar 22nd, 2014, 10:18am

on Mar 22nd, 2014, 10:00am, terabyte wrote:
could you just confirm your e-mail is still the same as it was on the 2008 paperwork

Yes, but if in doubt you can always discover up-to-date contact information from my web site. As a retailer I can hardly keep things like email and postal addresses secret!

http://www.rtrussell.co.uk/contact.html

Richard (G4BAU).

Re: BB4W installation.
Post by terabyte on Mar 22nd, 2014, 11:10am

Thanks Richard,

e-mail sent as requested.

73,s

Des.
Re: BB4W installation.
Post by hitsware on May 28th, 2014, 3:43pm

Is there a way to install a 'patched' version of BB4W ?
Re: BB4W installation.
Post by rtr on May 28th, 2014, 4:17pm

on May 28th, 2014, 3:43pm, hitsware wrote:
Is there a way to install a 'patched' version of BB4W ?

Do I take it that you are referring to patching the SOUND frequency table, to achieve (for example) a non-equally-tempered scale?

If so I don't see why you would want to install a patched version of BB4W (i.e. bbcwin.exe or bbcwin6.exe - which you are not allowed to redistribute anyway) rather than simply patching your compiled executable.

Perhaps you can explain in more detail what you want to achieve.

Richard.
Re: BB4W installation.
Post by hitsware 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

Re: BB4W installation.
Post by rtr 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.
Re: BB4W installation.
Post by hitsware on May 28th, 2014, 7:10pm

Clear as mud ! .... huh
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 ...... huh?

Re: BB4W installation.
Post by rtr 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.

Re: BB4W installation.
Post by rtr 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:
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.

Re: BB4W installation.
Post by hitsware 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.... smiley

Only integers for frequencies though, correct ?

Re: BB4W installation.
Post by rtr 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.


Re: BB4W installation.
Post by rtr 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.
Re: BB4W installation.
Post by hitsware 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
Re: BB4W installation.
Post by rtr 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.
Re: BB4W installation.
Post by hitsware 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 .....
Re: BB4W installation.
Post by hitsware 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&

Re: BB4W installation.
Post by hitsware 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 !
Re: BB4W installation.
Post by stargate 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.
Re: BB4W installation.
Post by rtr2 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.