Rick's b.log - 2023/10/16 |
|
It is the 24th of November 2024 You are 18.225.255.196, pleased to meet you! |
|
mailto:
blog -at- heyrick -dot- eu
I did some work with my sequencer, so there's yet another incarnation below, and I did some other stuff too.
Since the shutters are now going to likely be closed a lot (like when I'm at work), I can't leave the solar panel for the LED lamp on the table. What to do?
Now the solar panel can sit on the windowsill.
It isn't hermetic. The casing is just screwed together, and the wire passes through a hole in the back of the casing larger than it needs to be. So in order to try to protect the circuitry from corrosion (as often gets these LED lamps), I gave it a coat of nail varnish.
Anyway, the point was to cover the dinky little circuit board with an electrically inert stuff that should dry to form a waterproof coating to protect it from eventual corrosion from the damp.
I think she understands "wall, Anna" to mean to climb up on that hard thing and look for the food. Which is exactly what she did.
We did a walk around the house, where she rolled in the dirt of the potato patch that I rotovated on Saturday, then in a pile of grass cuttings from where I mowed on Saturday, then rolling on the beaten earth floor of the hangar... she damn near turned herself into a basic brown tabby cat. It'll take a lot of licking to clean herself up.
It meant sorting the change into piles of €10, then €1. I had two bags of one centime pieces. 100 in one bag, and 97 in the other. I just put three loose centimes on top of the 97 to make up a euro. I didn't put them in the bag as it had "97" written on it and I couldn't be bothered to go fetch a marker.
I've not fed Pig recently, as these days most stuff is pay-by-bonk so I don't have change in my pocket.
It turns out that I was only sixty one centimes out. This could easily be explained by glitches in the thing reading the size of the coins. If, for example, it reads €0,20 for a ten centime piece?
Since I was cleaning it, that meant taking it apart. So time for a teardown...
Here's the main board.
The contacts in the foreground are for one of those rubber strips for connecting to LCDs. The two buttons are for adjusting the amount (plus and minus). The row of soldered connections go to the coin detection board.
What struck me was that there wasn't any method of selecting the currency, but then I realised that there doesn't actually need to be. Both £ and € have coins that represent 1, 2, 5, 10, 20, 50, 100, and 200. So all you'd really need is to have a different LCD (mine only has a € symbol) and the appropriate matching coin detection board.
This is the detection board.
The uppermost position is the home position. You can see this is where the worn part ends.
Here's the logic table for how the coins are detected.
Everything was reassembled, the coin slot tested with a few coins, and then the count corrected.
There's probably also a lesson here about people's dispositions having them see and hear what they want to hear rather than what was actually said. Perhaps worth remembering the next time a politician (or, worse, right wing hack) talks about how the BBC is biased.
In this release, I have done a few things that I've been wanting to do for a while.
The first thing is internal. I have purged all of the sprintf() calls and replaced them with snprintf(). Likewise most of the calls to strcpy() and strcat() have been replaced with calls to strncpy() and strncat() (not all of them, there doesn't seem much point when placing a fixed twenty character string into an eighty character buffer...).
While this is a nonsense in the world of RISC OS (there's a simple SWI that will give anybody kernel level privilege!), it's always worth taking some time to try to minimise the risk of having buffer overrun issues. Especially in RISC OS where it is unfortunately rather unlikely that the offending function will crash. Instead, all too often, something else somewhere else will fall over and you'll be on an epic bug hunt to try to track down the problem.
The next change was to support loading files by them being double-clicked upon. This isn't actually 'working' as I don't yet have a filetype allocation (I only asked for it this past lunchtime), however the loader mechanics now work.
And then change the final line to say:
Yes, it's correct that the Alias command has percent-percent-star-zero while the command that actually runs the program only has percent-star-zero.
Now if you set the files to type &123, double-clicking them will cause the program to run and the music to appear in the editor.
If, instead, you pass the command line option
I fixed the little bar that sweeps across as the music is played. The first fix was to make it work correctly in quaver mode (including, now, a half-width bar that exactly follows the music being played), and perhaps more usefully than most of us, it will no longer keep jumping back to the left of the screen with every bar (imagine what it was like in 2:4 time!). Now it will sweep across the screen so long as there is a whole bar visible, only jumping back to the left when there are no more whole bars on-screen.
The final change? An itty bitty addition to the Save dialogue.
Did you spot it? The new "Save file compressed" option?
The header, music setup, and editor state arrays are not compressed, but the music data can be.
It goes without saying that compressed files won't be usable on previous versions of SimpleSeq. Oh, whoops, I just said it. ☺
Internally, it's just making use of the Squash module so it is extremely quick to compress and decompress.
Here's the download:
Brrr!
Autumn has come quickly. It was brass bloody monkeys this morning. Not quite a frost, but not far off. The first day I felt that I needed a coat outside.
On my coat stand I have a nice selection of black coats, so I thought I'd pick a black one. ☺
Curtain and light
It's getting to be the time of the year when the shutters need to be closed. Firstly because it gets dark quickly, and secondly because it helps prevent the windows from misting up on the insides.
If I have the shutters closed, and it is dark outside, even though I live in the back of nowhere I worry about people looking in. Moreso that they could see me but I'd not be able to see them.
Therefore, to afford a better level of privacy, I have fitted a 'curtain' to the front door. It's actually a piece of gingham-ish fabric folded over. I think it was intended to be a tablecloth or something. It was fitted by simply whacking some drawing pins into the door.
Shutters and curtain.
Well, the simple solution is to cut the cable and pass it through one of the drainage holes in the windowsill, and through a little notch cut into the windowsill just below where the window passes, then solder the wires back together.
Which is exactly what I did.
Reattaching the wires.
Oh my god.
So, in the supermarket a few days ago I wandered over to the aisle of overpriced girl-crap and was immediately assaulted by hundreds of tiny jars of gaudy coloured liquids, half of them containing glitter. I bought the one pictured below. As a non-girl, my criteria was simple - the cheapest thing that was clear. It was harder than it should have been... At a fiver for 10ml, it's pricier than decent quality rum.
Oh, what actually is nail gloss? It smells like glue.
Nail gloss - this stuff is expensive!
That's the theory. Time will tell if it is viable.
A gloss-coated circuit board.Walking Anna
I lined up some bits of chewy stick on the wall.
A little treat for Anna to find.
"I'll just inhale this stuff".
Following that, she ambled home. Well, um... okay, that was like eight minutes. Too much effort?
I followed her back, locked her back in again as she clearly wasn't up for walking around in that chilly east wind. I had two more sticks on me and I offered them to her and then had to hold on tight as she tore pieces off of them like a possessed demon.
I guess she likes them.
Auditing Pig and a teardown
As it warmed up in the late afternoon, I decided to clean and audit Pig to check that the figure showing on the display was accurate.
No, not Some Pig (the smaller mower), my piggy bank...
There's supposed to be €542,63 in here.
Small piles.
This is money that I have put aside for vide greniers, when there's a non-EU parcel that import duty needs paid on, and anything else that crops up. I'll need to borrow a few euros to put in the church collection thingummy for the 1st November service.
It was mostly correct.
The main board.
What I note is a place with three unfilled resistors, a missing chip (U2), and three holes for a header or attaching a wire. Now if this was a camera or something I'd look at that and say "serial port", but I can't think why such a thing would be necessary on a device like this. Perhaps it's to communicate with a different type of display? Maybe using IIC or something?
As is usual in these applications, it's a custom chip with a big blob of black cement around it.
I think Americans also have a $0.25 coin (I'm guessing that's what a "quarter" is) so it would need a different chip and circuit. You'll soon see why.
The detection board.
The next set of contacts down are for €0,01. Next is for €0,02. Then €0,05, €0,10, and €0,20. The final three contacts are for €1,00, €0,50, and finally €2,00. Due to the coin sizes, the one euro and fifty centime are swapped. Three sets of contacts mate with three sets of contacts, which gives us nine possibilities. That's the home position plus the eight denominations of coin.
The BBC is clearly not biased
The BBC has received a little over 1,500 complaints about its coverage of the current cluftersuck that is the Israel-Palestine situation. Almost exactly half have complained that the coverage is biased towards Israel, while the other almost exactly half have complained that it favours Palestine.
So if both sides are complaining equally, then clearly the BBC is neither biased against nor preferring one country over another.
It's a tightrope, but if people are equally annoyed then they're doing it right.
SimpleSeq v0.14
No, there's no thirteen. There never is. ☺
The difference here is that all of these (with the 'n' in the name) are 'safe' because you explicitly provide a count of how much space is available rather than just blindly copying.
C is not like basic. If you allocate eighty bytes for a string and then strcpy across a thousand bytes, it'll happily do it. What happens next will depend upon the system architecture and exact circumstances. For example, static allocations might be placed in a read/write section at the end, or intermingled with the code; while local variables are often placed on the stack.
This sort of thing is how a good number of those old privilege escalations happened. Basically you need to find a routine that runs with privileges, and then feed it a carefully constructed set of gibberish that overruns internal buffers. If you do it just right, you could overwrite other data on the stack, such as the return address and/or processor flags to use when exiting the privileged routine. This can then be used to pass control you your own code with privileges intact. If you're thinking this sounds like some sort of magic, in a way it is, you need deep knowledge of both the software that is running and the way it works on the host machine. But if one can use it to mess up fifty thousand computers, demanding a tenth of a bitcoin (that's about €2,600) to fix the problem, if only 5% of companies respond by paying up, that's 2,500 × €2600 which is six and a quarter mil. Much better pay than most IT jobs, provided one has zero morals and doesn't care who or what they wreck in the process. So hunting for things like this is a worthwhile occupation for the intelligent scum of the world.
Of course, one of these days I'll remember to just use the 'n' versions in the first place!
To try it, you'll need to insert the following two lines near the top of SimpleSeq's !Run file (just before ChooseMode):
%Set File$Type_123 SimplSeq
%Set Alias$@RunType_123 Run <SimpleSeq$Dir>.!Run -load %%*0
Run <SimpleSeq$Dir>.<SimpleSeq$Program> %*0
Of course, I'm not saying to use type &123, it's just a suggestion, until such time as there's an official allocation.
-v
, then you'll get a report (in a Wimp error box) as to the current version of the software. There's an Obey file called !version that will do this.
Given that each of the 61 notes in each of 16 channels in each semiquaver space are a word (four bytes) and there's no music on earth that would play all notes on all channels all the time, there's a very good chance that the overwhelming majority of the music data will be zero bytes. Which means that it can be subjected to significant levels of compression.
To put this into context, the 12 second lamedemo is 394,016 bytes in raw data form, or a mere 2,724 bytes in compressed form.
Decompression is performed automatically as the file is loaded, if necessary.
For RISC OS 5 machines with MIDI
John, 16th October 2023, 23:04 Just in case your "punaises" fail, the French for a curtain rod is "une tringle" - yes, really!.
I don't think that in slang its use to denote a male state of sexual excitement will cause you any difficulty if you decide to modernise your curtain arrangement, but it's as well to be aware of these things.Anon, 19th October 2023, 00:30 I'm assuming Serenade (the MIDI sequencer that Clares brought out back in the 90s) doesn't run on 32-bit RISC OS? And that sources are no longer available so it can't be modified or recompiled to be 32-bit safe?
Shame, cos that was (for its time) quite a nice bit of software. Then MelIDI came along and rather put it to shame.
Have you tried using Logic (on a Mac) or Cubase (PC or Mac)? The way things have developed over the last few years is pretty amazing - both Cubase and Logic give you up to 128 tracks, each track can be either MIDI (via a MIDI interface or a virtual instrument) or audio (single channel or stereo pair). Gone are the days of trying to sync your sequencer up to tape (digital or analogue) via SMPTE or MIDI timecode.
© 2023 Rick Murray |
This web page is licenced for your personal, private, non-commercial use only. No automated processing by advertising systems is permitted. RIPA notice: No consent is given for interception of page transmission. |