Sound for Squeak/Scratch
Tim Rowledge (1742) 170 posts |
Err, on topic, folks? |
Tim Rowledge (1742) 170 posts |
Lookingat the reassembly text file Rick did, editing both the old module and one created anew, saving each with the ascii flag lets !Sidediff compare them. |
Steve Pampling (1551) 8172 posts |
It’s the equivalent of a Turing test for humans. If you understand it you might be intelligent but you aren’t human. Anyway, back to paid stuff and trying to make sense of the Checkpoint rule parser in sed. My head hurts. |
Tim Rowledge (1742) 170 posts |
A new version of RISC OS Scratch is now available – it includes the improved scratch image, better install info and all the OS modules required. Please give it a try. [url]http://www.rowledge.org/tim/squeak/Scratch_RISCOS-2.zip[/url] |
Rick Murray (539) 13851 posts |
Helpful hint:
Hope this helps. Looking forward to playing MIDI stuff on RISC OS, just… ’cos… ;-) |
Tim Rowledge (1742) 170 posts |
Fair enough Rick, I just pasted something I had posted on the raspberrrypi site. I wish there wasn’t this lunatic disparity of markup systems…
Load up the rubber pullets… er, no, that’s not right. Try http://www.rowledge.org/tim/squeak/Squeak3-9c-RISCOS.zip , grab some midi files and away y’go. |
Bernard Boase (169) 208 posts |
Tim asks:
Bryan brought a Pi with your Squeak + Scratch to the London Raspberry Jam last evening. Lacking Squeak/Smalltalk knowledge, we tried only a couple of Scratch programs which worked fine, if slowly. I didn’t myself hear sound being tried. Bryan can advise. |
Martin Bazley (331) 379 posts |
Just given Squeak a try-out on an ARMini (BeagleBoard-xM, so ARMv7) with alignment exceptions on. My heart sank when I saw all the modules dated 2004 it depended on, but thankfully nothing horrible happened and the MIDI player runs quite nicely. Was disappointed it didn’t come with a set of General MIDI samples, though… I was rather looking forward to trying out my Flight of the Amazon Queen rips on something other than ReMIDI’s somewhat dodgy ones! |
Tim Rowledge (1742) 170 posts |
Which ones? Deepkeys I know about but until/unless some of the wider and more useful event reporting is included in the base I need that. The SharedSoundBuffer/StreamManager are at least recent enough to be 32bit and the timer modules are only recent too. Have I screwed up somewhere I hadn’t noticed yet? For midi samples to test I just googled and found loads. Including a large bunch of Mike Oldfield stuff which typically runs long enough to be decent test of memory leakage potential. |
Ralph Barrett (1603) 154 posts |
Just loaded squeak onto one of my RPi’s. I know a bit about RiscOS but not SmallTalk. I’ve downloaded a Midi file onto the RPi and I can see this file on the Squeak ‘desktop’, and even this file’s contents. However I can’t make it play :-( How do I actually make this Midi file play on Squeak ? Ralph |
Tim Rowledge (1742) 170 posts |
First things first, Ralph – the most important thing you need to know is that there is no capital T in Smalltalk. This may be the most important thing you ever know ;-) Wars have been fought over lesser matters. I understand that getting it repeatedly wrong is cause for an international arrest warrant. So, how to play midi files. I’d love to point to a short video to answer this but I can’t. I should do something about that. Notice the bright red (screamingly bright, not at all subtle, but I didn’t implement that part) ‘Objects’ tab top-middle of the Squeak window? Click on that and it opens a sort of drawer. The other unsubtle tab-like things around the screen do similar jobs but they don’t matter right now. In the ‘drawer’ you should see more tabs/buttons like ‘alphabetic’, ‘find’ and so on but most important for now ‘Multimedia’. Click on that and you should see four icons all in assorted ugly greens; you might think you need to click on one but that would not do anything useful. You can usefully hover the pointer over each on to see a pop-up help thingy we call a help-balloon. Instead of clicking you need to drag the icon you want – in this case the second from left ‘ScorePlayer’ down to the main screen area, at which point the drawer will retract. Drop the Score Player on the main area (you might find it being referred to as the ‘play field’ in some places) . There’s a whole lot more you can do but that’s the basics. All the code is right there in the system and you can learn to implement new kinds of sound if you like. You can import sound samples various ways, none of which I’ve ever tried because I only just got the sound implemented after 18 years of RISC OS Squeak. Join the squeak mailing list and ask questions and learn much more. Bugger me, that took about ten times as long to type as it would to explain in a video. Have fun! EDIT – I spotted a youtoob that might help; http://www.youtube.com/watch?v=TFMyrPpNZ0Q that shows some basics. There are a lot of results for ‘smalltalk tutorial’ that are worth skimming through. |
Tim Rowledge (1742) 170 posts |
Worth looking at http://www.youtube.com/watch?v=Bo82c_VPiLE too. It’s for a slightly newer release than I’m currently supporting but that will be fixed fairly soon. |
Martin Bazley (331) 379 posts |
It sounds as if you’ve screwed up in researching the specs of modern RISC OS machines. Being “32bit” isn’t enough any more – ARM introduced a whole new set of backward incompatibilities in architecture version 7 (the Iyonix is v5), which the chip used in the BeagleBoard conforms to. This time around the main sticking point is a change in the behaviour when you load or store a word from a non-word-aligned address, which, depending on whether you have the ‘alignment exceptions’ bit in the PSR set or not, will either trigger an abort or do something just subtly different enough to cause unpredictable behaviour in some old programs. The upshot is that most compiled code, and some hand-written assembler if the author fancied themselves a clever one, dated from before 2009 or so should be considered untrustworthy until proven otherwise. Modern versions of GCC and the ROOL DDE will produce fully compatible code by default. The Raspberry Pi is ARMv6, which has an option (removed in ARMv7) to emulate the ARMv5 behaviour, which I think is on by default – so if you’ve been exclusively testing on a RPi, you’ll have missed any compatibility problems.
Apropos of nothing, have you been reading the NetSurf mailing list recently? |
Tim Rowledge (1742) 170 posts |
Off to the side of the topic a tad, consider spending the time to watch http://www.youtube.com/watch?v=BbwOPzxuJ0s . It’s my old friend Alan explaining a large chunk of computing history. The talk is fascinating, especially to us old grey beard geeks BUT the part I want to emphasise here is that the software he uses to give the talk; all the slides, the video playing, the interactive demos of bridges etc, is all Squeak. That’s the way he’s done talks and demos for nearly 20 years now. That’s what software is supposed to let you do. Not ‘powerpoint’. |
Tim Rowledge (1742) 170 posts |
Oh I knew about that suff OK, That’s why my Pi is set to one or other of the v7 modes in an attempt to check for such problems. I understand that inevitably the testing will just happen to get run in the mode that makes it work and that someone else will find their mode causes blow-ups. No amount of double-checking will prevent the universe doing that to us. I’d like to hope that at some point I’ll be able to get in contact with John Duffell and get the sound modules freshly compiled and even bug-fixed. No luck so far – does nobody know him? If you get hit by any problems relating to this in Squeak do please let me know ASAP. |
Ralph Barrett (1603) 154 posts |
Thanks for the tutorial Tim. I’m out for the weekend so won’t be able to try the Midi out until Sunday evening at the earliest. However, this explanation will be very useful for others coming to smalltalk from RiscOS. Ralph |
Ralph Barrett (1603) 154 posts |
Just to report that Bach is playing on the squeak score player OK. For the record: 1. The Midi files need to be in the same (sub-)directory as the squeak image file. 2. Need to be suffixed with the midi extention as you state (I used /midi). 3. Use the file icon in the squeak score player ‘application’ “<>” to open and play the midi file. 4. Change midi ‘voices’ as appropriate. |
Tim Rowledge (1742) 170 posts |
Excellent news, Ralph. I’m always pleased when someone else is able to replicate my experiences and show that it isn’t just me. You probably noticed that next to the Score Player in the ‘Object’ drawer there is a keyboard; unsurprisingly if you drag that out you’ll find you can play tunes. I honestly couldn’t tell you how but I’d bet you can play and record them with the right clicks. Likewise I’m pretty sure that if it isn’t hooked up to the keyboard already, it could be. For the musically inclined I suspect some fun could be obtained by working out how to use the keyboard to play and a drag action to bend the notes or key or tremolo or whatever is down with the really hep cats these cays. |
Tim Rowledge (1742) 170 posts |
Excellent news, Ralph. I’m always pleased when someone else is able to replicate my experiences and show that it isn’t just me. You probably noticed that next to the Score Player in the ‘Object’ drawer there is a keyboard; unsurprisingly if you drag that out you’ll find you can play tunes. I honestly couldn’t tell you how but I’d bet you can play and record them with the right clicks. Likewise I’m pretty sure that if it isn’t hooked up to the keyboard already, it could be. For the musically inclined I suspect some fun could be obtained by working out how to use the keyboard to play and a drag action to bend the notes or key or tremolo or whatever is down with the really hep cats these cays. |
nemo (145) 2556 posts |
Martin wrote:
I’m not sure that using a perfectly simple and unambiguously defined opcode is either clever or “clever”, either at the time, or later when the chipmaker unilaterally decides to change its behaviour. I’d call that “unfortunate”, avoiding more emotive words such as “treachery”, “betrayal” and “infamy, infamy, they’ve all…”. |
Rick Murray (539) 13851 posts |
The behaviour of a non-aligned load was always “odd” (and thus liable to change). Given the old behaviour needs a load and a shift, how is this different to aligned load and shift/mask? Am I missing something, or was it clever for the sake of being clever? |
nemo (145) 2556 posts |
It was no more ‘odd’ than the fact that you can encode MOV R0, #1 in 16 ways – it works a defined way, and when they suddenly change their minds it’s a problem. The utility of the shifted unaligned load was from when there was no half-word load – you could (if you arranged your table correctly) in effect get a half load ‘for free’: LDR offset, [table, index, LSL#1] ADD addr, base, offset, LSR#16 If you arrange your table of half word offsets with indices 1,0,3,2,5,4 etc then you can mask off half the word when adding. Neat. This is not like the undefined pseudo-opcodes that the 6502 had – this was defined behaviour that ARM suddenly decided to remove. A poor show. |
Martin Bazley (331) 379 posts |
This might be a good place to mention something which I announced on Usenet the other day, after having written one too many posts like the one quoted above. Aimed at users rather than developers, but I hope someone finds it useful, even if it’s just me being able to push a link at people who ask the same questions all over again instead of actually having to answer them… http://www.starfighter.acornarcade.com/mysite/articles/armv.html |
Steffen Huber (91) 1953 posts |
Hi Martin, just read your article. Good stuff, but the bit at the bottom might need some qualification. The change from “classic” Archimedes hardware with RO 3.1 to Risc PC hardware with RO 3.5 or 3.6 has a completely different quality than the change from 26bit to 32bit. Well-written software survived the change to Risc PC hardware without problems, but nothing could anticipate 32bit compatibility. It would also be nice to mention the various compatibility helpers that were developed over the years – GameOn!, StrongGuard!, Aemulor, ArcEm, ADFFS. |
Martin Bazley (331) 379 posts |
I know it oversimplifies certain things and omits others, but I was trying to keep the focus tight and the understanding straightforward. I think it’s already somewhat too long as it is, so I’d rather not add yet more qualifiers and exceptions to cover all possible bases. |