Wow, didn't know this existed. Though one has to wonder why they don't make full use of the 6-bit DAC. But I assume it's like on Dragon/CoCo - generating 1-bit music might simply be faster than using full 6-bit DAC. In fact in the contest, we'll have a CoCo 1-bit routine wink

Deadline extended till Sunday, September 13th, because some people asked for more time. Also, we need more works in the "alternative platforms" category!

953

(3 replies, posted in Sinclair)

Not contemporary and not ZX, but there are a few ones from the early days of 1-bit music:

Rekengeluiden van PASCAL - VA (1962)
D21 - In Memoriam - D22  - Göran Sundqvist (1970)

There are a couple more old ones, but I'll have to dig for those later.

And now sing along with me:

BEEPER - simply the best
BEEPER - f*ck all the rest
BEEPER - bad for your brain
BEEPER - going insane

hehehehe good job, AER! Now please make one for the forum contest wink

Huhu xxl, do you still have Beep'em all 2600 somewhere?

956

(11 replies, posted in General Discussion)

Let's dump the cool shit here tongue

This vid about the PC Speaker is pretty cool, would be nice to have English subs though.
https://www.youtube.com/watch?v=NIyQueXqRYE

Wow garvalf, that's a lot of spamming wink Thanks a ton for spreading the word!

958

(1 replies, posted in General Discussion)

Afaik the only editor that really uses this feature is 1tracker. Which of course has the luxury of storing these markers in it's own 1tm format.

Ok, here's an idea: You only need 1 bit to store a marker. So you can combine it with other data, e.g. drum triggers or per-row tempo settings. Or even note data if you're using a frequency lookup table, because a range of 0x7f notes should be more than enough wink

You can actually combine those ideas. Let me explain...

Part 9: More Soundloop Tweaks

In this part, I'll discuss two advanced tricks that you can use to open up new possibilities and further speed up your sound loops. I've learned these tricks from code by introspec and Alone Coder, respectively.


Accumulating Pin Pulses

The first trick applies to the PFM/pin pulse method of synthesis. First, let's take a look again at our PFM engine code from Part 5, and modify it to use 16-bit counters.

BC = base frequency channel 1
IX = freq. counter ch1
DE = base freq. ch2
IY = freq. counter ch2
HL = timer

soundLoop:
       add ix,bc                ;update counter ch1
       sbc a,a                  ;A = #FF if carry, else A = 0
       and #10                  ;A = #10 || A = 0
       out (#fe),a              ;output state ch1
       
       add iy,de                ;same as above, but for ch2
       sbc a,a
       and #10
       out (#fe),a
       
       dec hl                   ;decrement timer
       ld a,h
       or l
       jp z,soundLoop           ;and loop until timer == 0

Now, instead of outputting the pin pulses immediately after the counter updates, we can also "collect" them. This will potentially save some time in the sound loop and will give better sound, because the pin pulses will be longer.

In the following example, register A holds the number of pulses to output, and A' will hold #10.

soundLoop:
       add ix,bc                 ;counter.ch1 := counter.ch1 + basefreq.ch1
       adc a,0                   ;IF carry, increment pulseCounter
       
       add iy,de                 ;counter.ch2 := counter.ch2 + basefreq.ch2
       adc a,0                   ;IF carry, increment pulseCounter

       or a
       jp nz,outputOn     
       out (#fe),a              ;OUTPUT state
       nop\nop\nop              ;adjust timing
       
                                ;now we can't use A to check the counter, hence...       
       dec l                    ;decrement timer lo-byte
       jp z,soundLoop           ;and loop if != 0
                                ;this is faster on average anyway, so use it whenever you can.      
       dec h
       jp z,soundLoop           ;and loop until timer == 0
       
outputOn:
       ex af,af'
       out (#fe),a
       ex af,af
       dec a                    ;decrement pulseCounter
       
       dec l                    ;decrement timer lo-byte
       jp z,soundLoop           ;and loop if != 0
                                ;this is faster on average anyway, so use it whenever you can.      
       dec h
       jp z,soundLoop           ;and loop until timer == 0

Even better, you can use this trick to simulate different volume levels, by adding a number >1 to the pulse counter on carry. Just don't overdo it, because eventually the engine will overload, ie. it will take too long until the engine works through the "backlog" of pulses to output. This method is used in OctodeXL, btw.



Skipping Counter Updates

You have a great idea for a sound core, but just can't get it up to speed? Well, here's a trick you can use to make your loop faster.
This trick is mostly relevant to pulse-interleaving engines with more than 2 channels.

The idea here is that you don't have to update all counters on each iteration of the sound loop. It is however important that you output all the states every time,
and that the volume (read: time taken) of each of the channels is equal across loop iterations.

Here's a theoretical, not very optimized example.


DE  = base frequency ch1
IX  = counter ch1
H   = output state ch1
SP  = base frequency ch2
IY  = counter ch2
L   = output state ch2
B   = timer

       ld hl,0                    ;initialize output states
       ld c,#fe                   ;port value, needed so we can use out (c),r command
       
soundLoop:
                         ;---LOOP ITERATION 1---
       out (c),h         ;12      ;OUTPUT state ch1
                         ;^ch2: 40
       add ix,de         ;15      ;counter.ch1 := counter.ch1 + basefreq.ch1
       out (c),l         ;12
                         ;^ch1: 27
       sbc a,a           ;4       ;IF carry, toggle state ch1
       and #10           ;7
       ld h,a            ;4
       ld a,r            ;9       ;adjust timing
       nop               ;4
 
                         ;---LOOP ITERATION 2--- 
       out (c),h         ;12
                         ;^ch2: 40
       add iy,sp         ;15      ;counter.ch2 := counter.ch2 + basefreq.ch2
       out (c),l         ;12
                         ;^ch1: 27
       sbc a,a           ;4
       and #10           ;7       ;IF carry, toggle state ch2               
       ld l,a            ;4
       djnz soundLoop    ;13      ;decrement timer and loop if !0

960

(3 replies, posted in Sinclair)

Thought I'd open a thread for brainstorming about optimizing various parts of beeper engines. I'm thinking especially about various issues related to data loading.

For a start, let's talk about frequency table lookup. Lately I tend to avoid it altogether, and instead store frequencies directly in the pattern data. But sometimes it comes in handy, I suppose. So, my method is quite primitive. Suppose we have a 16-bit lookup table aligned to a 256b border, and note values are already multiplied by 2.

       ld h,HIGH(frequency_lut)      ;7
       ld a,(de)                     ;7, load note val from pattern data
       ld l,a                        ;4
       ld c,(hl)                     ;7
       inc l                         ;4
       ld b,(hl)                     ;7, frequency now in BC

Which brings us to a total of 36t. Of course, if you don't care about sp, you could also do "ld sp,hl, pop bc" which would be 2t faster. Is there any faster way to do it, preferably without touching sp?

961

(5 replies, posted in Sinclair)

Ah yes, the famous Dancebit smile A true classic!

Well, XXL and me did this a while ago, based on LSengine: http://battleofthebits.org/arena/Entry/circls/12238/
Also, there is http://www.pouet.net/prod.php?which=58051, based on Squeaker engine by Zilogat0r.
A pity that the dl for Beep'em all 2600 is broken... paging XXL, please upload it somewhere again!

The Lynx has fairly complex audio hardware on board, so it's not really interesting for 1-bit development, I think. But we're still waiting for Mono to finish his Music Studio port for the Atari Portfolio wink

963

(2 replies, posted in Sinclair)

Gnnnnrrrrr! There goes my wonderful plan for a new 256b sample engine... yikes

964

(2 replies, posted in Sinclair)

Encountered something strange a while ago. It seems that on ZX Spectrum the carry flag is reset after OUTI (and possibly OUTD). However, in documentation both official and unofficial, it is claimed that OUTI has no effect on the carry flag. Is this a special "feature" of the Z80 used in the Speccy, or is the documentation incorrect?

Just to clarify, plugging in earphones isn't harmful. Just don't do it during normal TI-OS operation, ie. plug them in after you've started DoorsCS/Mirage/whatever.

966

(166 replies, posted in Sinclair)

Latest builds have 3 new engines: OctodeXL, ZX-7, and the newly created prdr.

@garvalf: What Linux flavour are you using? Haven't encountered these problems under Debian, though I haven't tested it thoroughly yet.

@Shiru: ZX-7 engine is giving me problems, complains about "the engine does not provide any data".

@introspec: hehe thanks wink It's gonna be a tough battle... TI has nearly the same setup as the Speccy, but it's also nearly twice as fast wink

garvalf wrote:

would the 84+ be much better than the 83+? It's more expensive anyway.
So far the 83+ I got seems ok. It's a "TI-83 Plus.fr" in fact, for making music with the "French Touch" wink

I got the cable link we talked about. It's working as a "grey link" (serial) cable. I didn't manage to make it work on linux with tilp, but I'll try on another computer. It just says the cable is not connected but my system is detecting it (with dmesg). On windows I got tilp to work (with efforts), I had to test several serial ports. The official TI Connect works the best. (I had to install by hand this driver http://www.prolific.com.tw/US/ShowProdu … mp;pcid=41)
I don't know if a silverlink would have worked better, I've read it was quite complicated to connect to linux. But I'll try more with mine...

Hmm, SilverLink works out-of-the-box for me (Debian+TiLP from the repos). Never had any probs with it.
I think the problem is that the cable is interpreted as serial when it is really USB. On the one hand it's not too surprising because originally GrayLink was a indeed a serial cable. Hmm... maybe you can force TiLP to use it as SilverLink via command line? Otherwise, if problems persist shoot Lionel Debroux (TilP dev) a mail, he's a really nice guy and he might be curious about this cable, too.

A few things which didn't work at first (not your fault):
- The first time I added some new patterns to your sample tune, it could compile but not be executed on the TI83, probably a memory problem. The message during execution was more saying something like "syntax error" so it wasn't easy to understand it was because of this.

Hmm, if there's a memory problem you usually wouldn't be able to transfer it to the machine in the first place. Perhaps you can send me the problematic song file so I can have a look? Maybe I made an error somewhere...

- Adding 2 rawp songs in the TI83 were also filling its memory badly.

Yes, undoubtedly so, because the rawp engine itself is rather huge. Best to recycle the player and just swap out the song data (have a look at rawp.asm, the pointer to the music data is on line 32)

- it's a pity they used those tiny jack connectors. I only found a earphone for using with it, so I'll search more or buy a new converter. When the earphones are connected, the calculator is very unresponsive. Probably with a jack converter it won't do this.
- no speakers on the TI, it's a pity too...

Yes, 2.5mm jack suxx big_smile The unresponsiveness is due to the calculator picking up phantom voltage from the earphones. Plugging them in after you've started the shell should help to avoid the problem.

- Thank you for telling me about the 8xp. I also tried the 83p files but they were also using the extra patterns so it couldn't work anyway.
- http://irrlichtproject.de/downloads/rawp-ti.zip is not responding...

Yeah, my stupid server is down again.

So in conclusion I managed to create some music and send it to the calculator, so I'm quite happy with this. I experienced some heavy detuning in comparison with the sounds on milkytracker so I need to work more with it to learn what works ok and what works less. It sounds amazing anyway, thanks for this work!

Thank you for trying it out! Unfortunately this engine uses 8-bit frequency counters, so detuning is to be expected from upper 3rd octave on. I'm working on a version with 16-bit counters though.

Edit re: 83+ vs 84+. Starting with the 83+ SE, the processor can be used in 15 MHz mode, which is awesome. However, I don't own any calcs of this generation (yet), so I'm not supporting this. Also, the size of the Flash RAM varies among models (though it's not necessarily bigger on 84+ models). Other than that, the 83+ and 84+ are practically identical.

Yes, the 83+ is decent, just got one myself. However, don't try the 83p on it - it needs the 8xp wink
The naming of these calcs is ridiculous, btw. Especially in France where all the machines get different names. Ie. TI-82 STATS = TI-83, it has nothing to do with TI-82. There is also TI-82 Plus which is a modified TI-84 Plus, and the TI-82 Advanced, which is a more locked down TI-82 Plus.

garvalf: Thanks, that is quite useful. I'll integrate that into the first part of the tutorial.
Shiru, Hikaru: Since Hikaru deleted his posts, I've moved the rest of the "discussion" to OT for the time being. Will delete it in a while if nobody objects.

That in itself would not be such a big problem as the later models use a similar setup, but unfortunately there is hardly any documentation regarding the consequences in this case. From what I've deduced over the years, the 82 Parcus is basically a TI-83 hardware-wise (using the same port layout and such), but running a modified 82 OS (which has not been documented properly either). I've been able to run software on it, but it seems the relocation process in CrASH19.0006 is buggy (or at least there is some feature of it that isn't documented), so usually stuff will crash on exit.

I've never actually tested any of my software on TI-82 STATS. Supposedly it's fully compatible with TI-83, but it would be great to get some confirmation of this. Well, whatever you do, just don't get a TI-82 Parcus. Since years I'm trying to figure out why stuff doesn't work on it like it's supposed to, but in the end the answer remains: Because it just doesn't.

Thanks! I was surprised, too, that 6 MHz was enough to get rid of the nasty discretion noise. I should revisit the Speccy version, see if I can speed it up some more, and perhaps add 16-bit counters while I'm at it.

Re the link cable, I use the "SilverLink" USB cable nowadays, works fine with all models despite what TI claims. I'm getting a new batch of them shortly, so I can give you one, provided we can work out a way to send it. Do you know anyone in the Netherlands who could take it, or do you think it's safe enough to try it via mail?

973

(2 replies, posted in Sinclair)

Amazing. Congratulations on this outstanding achievement, you've raised the bar to near unreachable levels once again!
Btw just recompiled 1tracker from source, still works fine with krue's patch.

As a byproduct of stuff I'm currently working on, I ported my rawp engine to TI Z80. Thanks to the faster CPU, it sounds much, much better than the original ZX Spectrum version.

For those of you who aren't aware of the original engine, here's the feature list:

- 2 tone channels
- 13 different sounds
- limited volume control
- 1 interrupting hihat sound
- per-step tempo control

download (includes XM converter, requires Perl)
sound example

975

(166 replies, posted in Sinclair)

Yes, it works! Thanks a ton, krue!