PLAY - REDUX

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

PLAY - REDUX

Post by Jbizzel »

Nearly 2 years ago, @TMD2003 set out a challenge to use the PLAY command in 128k to produce a song. I have lost the post, and cannot find it - so I have made another post - this!

Well sir - I say to thee:

Code: Select all

10 PRINT "Challenge accepted...": GO TO 10

Code: Select all

5 REM Little Whale Explores the Calm Sea
10 LET a$="T160O4N 8&&5g&G7#F5D7E5b8a 8&&5g&G7#F5A8BE 8DD3DagabC8b&5&&EBAG 3#FEDCba7D5g7#f5d7e5&8g&G"
20 LET b$="T160O3N 8gDA&&& gDA&&& DDD&cd#F ECb5aB8Ag&"
30 LET c$="T160O4N 8&&5d&&8&&& &&5d&&8&&& 8Ca3b&&&&&8b&&& 8&7g5&8&d&D"
200 PLAY a$,b$,c$\#013
which is this....



Although I've messed up a bit at the end.

What I learnt

Play is a lot better than I realised.
These pages help a lot https://worldofspectrum.org/ZXSpectrum1 ... 28p12.html
And it was quite a fun challenge.

The piece I choose should be played with the peddle pressed down the whole time. I'm not sure how to achieve that. So any advice for how to improve this music - with the introduction of dynamics or simulating the peddle?

Also - It could be a fun challenge, so I invite anyone to share some play sound effects of music examples - It would be nice to see them.

FINALY

Are you like me, and have a 48k with an AY chip and fear you will miss out?? Well fear not! because this challenge is for you too.

I searched high and low for the .PLAY ESXDOS command - but it seems to have disappeared off the face of the earth (If you can share it, please DM me). However, I found SOFT PLAY which is some ways is better:

https://worldofspectrum.org/forums/disc ... 8-basic/p1
User avatar
ParadigmShifter
Manic Miner
Posts: 765
Joined: Sat Sep 09, 2023 4:55 am

Re: PLAY - REDUX

Post by ParadigmShifter »

Looks like you need to use U. V and W commands according to this for pedal effects

http://fizyka.umk.pl/~jacek/zx/doc/man128/sp128p13.html

You probably want the W3 effect on everything if you want the sustain pedal on all the time? The pedal you are after does not dampen the note when you release a key I think (that's what it sounds like from the video).

I think the notes on each channel don't sustain once you start playing another one on the same channel though (in Basic anyway?) so maybe it's useless for that. I never had a 128K or an AY chip.

I dunno if you can set up a reverb buffer using MIDI or anything.
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: PLAY - REDUX

Post by Jbizzel »

Thanks - I think a little use of that function improves things...

anyway - here is a chilled tap file that will play AY on your favorite 48k (AY enabled) computer - merry charismas :xmas :santa :snowman

https://jbizzel.itch.io/little-whale-ex ... e-calm-sea


Image
User avatar
+3code
Manic Miner
Posts: 448
Joined: Sat Mar 19, 2022 7:40 am

Re: PLAY - REDUX

Post by +3code »

Nice. Time ago I started with a "mid2play" utility project, but abandoned it. Still I think could be an interesting thing.
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: PLAY - REDUX

Post by Jbizzel »

I just updated the Tubular Bells from 1988 by Ignacio P. Garcia - I've uploaded it to the same itch page.

It now works on 48k :)

I've had it on my divide for years and not been able to listen to it until now.

Who needs 128k anyways??
User avatar
1024MAK
Bugaboo
Posts: 3136
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: PLAY - REDUX

Post by 1024MAK »

Jbizzel wrote: Sun Dec 24, 2023 5:41 pm Nearly 2 years ago, @TMD2003 set out a challenge to use the PLAY command in 128k to produce a song. I have lost the post, and cannot find it
Do you mean here? Or over on t'other forum?

Mark

PS count me out, I can't even manage to play the triangle in tune :lol:
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: PLAY - REDUX

Post by Jbizzel »

Hehe you found it - yes that's it!

Sound effects also welcome;)


Am I right in thinking that Play is like beep in that you can't do other things while the music is playing?

Merry Christmas :santa
User avatar
1024MAK
Bugaboo
Posts: 3136
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: PLAY - REDUX

Post by 1024MAK »

The AY sound chip is quite happy to play a note per channel or make a noise without bothering the processor (well until the next change of note or change of attenuation level) unlike the ULA bleeper.

However, not having played with the PLAY command much, I can't remember if that has an interrupt driven system or not.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: PLAY - REDUX

Post by Jbizzel »

given that it doesn't want to break into basic while a tune is playing - I assume you can't?!


Image

lol.
AndyC
Dynamite Dan
Posts: 1424
Joined: Mon Nov 13, 2017 5:12 am

Re: PLAY - REDUX

Post by AndyC »

1024MAK wrote: Mon Dec 25, 2023 10:42 am However, not having played with the PLAY command much, I can't remember if that has an interrupt driven system or not.
No, PLAY blocks until the tune is complete, which is a bit crappy but probably the result of trying to bodge it onto the existing BASIC system without changing the interrupt handling massively.
Post Reply