The Note Quiz

Soruk
edited October 2023 in Your Projects
This section of the forum is for people to showcase projects they are working on, in BBC BASIC of any flavour.

And to kick it off, I present to you The Note Quiz.
menuheader.png
Written to help my 7-year-old learn the notes of the musical stave (he has his Grade 1 on the violin but sight-reading is a particularly weak point of his) I put this together initially just to run within Matrix Brandy on his rather basic laptop. (I dare say it is working, he is getting much better at quickly recognising notes and when I had him sight-read some music yesterday he was much better at it than before.) It tracks your progress, and if you score 20/20 on a particular level and clef, it locks that out forcing you to move to a harder level! The note range is the same, you just get (11-level) seconds to identify the note. Level 10 is rather brutal. So far my kid has locked out Level 8.

But as little projects go, it ended up getting a life of its own, it now also quizzed the bass, alto and tenor clefs, and with very little modification it runs on the BBC Micro (model B ), Electron, Master and Compact (in the case of the Elk, the code executes as intended however I suppose "run" isn't exactly the right word) - though in the case of the BBC and Electron I had to use code crunchers for it to fit with the raised PAGE (must be no higher than &1C00 &1900) and the low HIMEM of MODE 1. It also runs on the Acorn Archimedes and Richard's BBCSDL - and is playable in your browser here thanks to Richard's WebAssembly version of BBCSDL. Downloads are available here as plain text, RTR-format tokenised BASIC, RISC OS application, Win32 native standalone binary, Android APK and a DFS 40T disc image. (Edit: Also ROMFS images, standard and auto-booting)

Comments

  • Soruk wrote: »
    and is playable in your browser here thanks to Richard's WebAssembly version of BBCSDL.
    Ooh, it doesn't here in Microsoft Edge on Windows ('Exception thrown, see JavaScript console"). Drilling down, the console has 'Uncaught RuntimeError: null function or function signature mismatch'.

    That's worrying, given that it clearly runs for you. What browser were you using?
  • Can I propose this modification, which I think improves readability of the front page (particularly in BB4W/BBCSDL, which shift the characters one pixel left, in the hope of avoiding a Copyright infringement):
     1550 Z%=0: IF LENt$>51 MOVE I%-4,J% ELSE MOVE I%+28,J%
    
  • Sure, will give that a try.

    Also, to answer your browser question - Firefox in AlmaLinux 8 and Windows 11.
  • I've uploaded, and re-linked, a proper Web app version. Now it's a proper .bbb file, rather than a .bbc file that would sometimes work by sheer dumb luck than design.
  • Soruk wrote: »
    Now it's a proper .bbb file
    You don't really benefit from a .bbb file if it contains just a single, short, program without any libraries or resource files; you might just as well use ?chain=. Where an application bundle comes into its own is in the case of a large application, often containing multi-megabytes of sprites, sound effects, music, fonts etc.
  • Richard_Russell
    edited September 2023
    FYI I have set up a mirror site to provide some protection against downtime (or the bandwidth limit being exceeded) of the main server for the in-browser edition of BBCSDL at wasm.bbcbasic.co.uk. This mirror can be found at wasm.bbcbasic.net and should work the same as the original (just substitute .net for .co.uk in any link you generate).
  • Some time has passed, and I've been enhancing it - for the note quizzes it now shows notes of random lengths (quavers, crotchets, minims and semibreves).

    ROMFS builds have been added, the intention here is for a cartridge game style - and depending on the chosen ROM image, the game autoboots irrespective of the current filing system (so hypothetically, you would plug the cartridge in, power on your Elk / Master and the machine would boot straight into the game. Not that this will ever see the light of day in a cartridge, but that was partly an exercise in the "can this be done" stakes).

    A fifth quiz has been added too. The new quiz asks what type of note it is (quaver, crotchet, minim or semibreve), showing a random pitch (and clef!).

    With some careful refactoring of some code (and blatant cheating in a couple of places - the character definitions for the note heads and creation of the blank nqXtrk files if not found now happen in the Intro program), it does (just!) fit on to a BBC B with PAGE=&1900 and HIMEM=&3000 so you still don't have to be a Master/6502SP owner to run it in colour.

    Five quizzes, 4 clefs, 4 note types, and somehow it still fits in MODE 1 on a BBC B with DFS. For anyone curious enough to look at the code, it is really not a good example of good programming practice, simply due to a lot of cheats required to get the thing to fit!

    The ROMFS build forces PAGE down to &E00 if HIMEM < &8000, even if a disc system is present. Two versions of the ROMFS build are now available, one "standard" version that requires SHIFT-Break (or SHIFT-SPACE-Break) to boot, and the other that, when present, will auto boot on BREAK or power-on.

    Primarily for the Electron, I've added the option (only for the Acorn targets) that if SHIFT is held as Note Quiz proper (not the Mode 7 intro screen on the BBC, that is skipped on the Elk) starts, it will run in MODE 4 irrespective of available memory, as it is significantly quicker than MODE 1 without the Turbo board.

    This has to be the most cross-platform thing I have ever written, deliberately and specifically targeting the BBC Micro, Electron, Master, Compact, Archimedes/RISC OS, Matrix Brandy and BBCSDL in all their forms.

    I'm not quite sure how I could enhance this further with more musical stuff, without it becoming impossible run in colour on a disc-based BBC B. (That said, the colour is cosmetic, and the game is just as playable in black & white in MODE 4.)
  • Can I propose this modification, which I think improves readability of the front page (particularly in BB4W/BBCSDL, which shift the characters one pixel left, in the hope of avoiding a Copyright infringement):
    I doubt you would have to worry about copyright infringement in your open-sourced BASICs - the BBC font is part of the open-sourced RISC OS 5.
  • Soruk wrote: »
    I doubt you would have to worry about copyright infringement in your open-sourced BASICs - the BBC font is part of the open-sourced RISC OS 5.
    Whether it's Open Source or not is irrelevant, Copyright applies just as much to Open Source material as to any other, as I'm sure (or sincerely hope!) you're aware.

    The legal situation is described here where it says: "However, software provided under an open-source license is still subject to copyright protection and failure to comply with the license terms can be grounds for legal claims of copyright infringement as well as breach of contract".

    It's possible that the licensing terms for the RISC OS Open font may permit its use (it would be interesting to know), but clearly that can't be applied retrospectively so I still need to be careful about my uses of the font which pre-date that.

    In practice I don't know how much me having shifted most of the characters one pixel left protects me from a Copyright claim, but there's not much else I can do. It can occasionally introduce a significant compatibility issue, but there is no way I would ever risk reverting it.

    I am well known for being obsessive about Copyright, both in protecting mine and being careful not to violate that of others. I was quite concerned about my patching of the DejaVuSansMono font to include Hebrew, because font modifications generally aren't allowed, but DejaVu does seem to permit it.
Sign In or Register to comment.