Jump to content
IGNORED

Need help with my music player code


Recommended Posts

Here's v0.2beta3. All of the UI should be functional now. It does not promise it can actually start the sweep yet ;) But you can set its parameters. Out of beta, it will sweep!

    

atari000.png.c34f09cfe1064422b67e263f8402cad3.png

 

Channel(s) and Start and End value are dependant on the Resolution setting.

 

Start, End and Interval can increased and decreased by one at the time with the CTRL-keys displayed left and right of its status.

 

All other CTRL-keys are looping through three or four options. No need for a second key.

 

Source is here.

 

In 8-bit mode, increasing/decreasing start and end is tollerable, but in 16-bit mode it might not be the same if you want to sweep $6000-$7000 :)

I'm thinking about a way to speed up in 16-bit resolution. Is there a chart of which CTRL-SHIFT-key combinations work?

 

Any regressions?

 

Or any suggestions? Am I missing a certain "sweep" setting?

Thanks.

 

pokeyexp-v0.2beta3.xex

Edited by ivop
edit: troug->trough :)
  • Like 2
Link to comment
Share on other sites

25 minutes ago, makary said:

how about turning off the keyboard click / key stroke sound?

It is muted.

 

74:    mva #$ff $02db ; NOCLIK, disable key click

 

Do you use AltiraOS by any chance? It seems not to work with that, but @phaeron has not responded yet. Standard Atari XL ROMS work. It should even work on a 600XL (not tested).

But thanks for the suggestion. One of my earlier versions indeed had the key click on :)

 

 

Edited by ivop
edit: added missing word and elaborated
Link to comment
Share on other sites

Sweep information:

 

$8x with poly 9, every 7 steps makes a differing tone.  Every 11 steps in $0x poly 9 (and also maybe $8x) is intermittent silence or a tone

 

$2x uses steps of 31.  This means I will have to add a second square wave table to $2x 16-bit, amongst other things.

 

$4x and $Cx both depend on multiples of 3 and 5.

 

 

 

Link to comment
Share on other sites

Further down the road, we may want to add 24-bit and 32-bit to the mix.  This is for when we combine hi-pass with either the two-tone or the 16-bit settings.  In particular, the 16-bit plus 1.79 on both clocks uses the 32-bit sweep.  You put a 16-bit value into the first channels, and another 16-bit value into the last two channels, with 16-bit, 1.79 on both, and a hi pass from first to third channels, to use this function.

 

Meantime, we may be able to get away with sweeping sections of the notes at a time.

Edited by Synthpopalooza
Link to comment
Share on other sites

Here's v0.2beta4.

 

atari001.png.9e4ca280a89b14a062abf044985ce61c.png

 

I decided to stay away from CTRL-SHIFT combinations, because not all of them are detectable. Instead, you can now select the up/down step size for Start/End/Interval values. Bonus is that you have four step sizes now, instead of two :)

 

CTRL-T only flashes the background ;) UI is too crowded to do something with tuning tables. I intend to create a separate screen where several 8-bit and 16-bit tuned notes can be selected. Different base clocks, selection of used channel(s), optionally second pokey (handy for 24-bit or 32-bit settings), et cetera :D But that's for later. And I might have to drop the "runs on a 16kB machine" requirement.

 

First, I intend to implement the sweep. Sweep Parameters line will show Press START etc... again, adjust start/end values if nonsensical, run the sweep.

 

Any regressions? Do the CTRL-SDWE controls work for you, with the added CTRL-U step size? Bugs fixed? :)

 

Thanks for any feedback. As I got no response to my previous question, I assume @Synthpopalooza does not mind I "pollute" his thread with my musings ;)

 

pokeyexp-v0.2beta4.xex

Edited by ivop
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

So after some preliminary experimentation:

 

$2x is not useful in two-tone mode, except for those square tones which occur every 31 steps.  You'll probably need 1.79 clock to make use of it

 

$8x plus poly9 has some guitar tones in two-tone, but you will need 1.79 clock

 

$Cx two tone shows some promise in either base 64 clock or 1.79.  In 64 khz it is set up rather like the $Ax two tone mode, but using the standard $Cx 8-bit table instead.

 

$0x plus poly 9 two tone might have something, in the 1.79 clock

  • Like 2
Link to comment
Share on other sites

On 9/29/2020 at 7:52 PM, Synthpopalooza said:

oh it's fine.  :) My original question got answered anyway lol

Okay, great! I'll start a proper thread once v0.2-release is there. For now, here is v0.2beta5 :)

 

Everything you see, except for 16-bit sweeps, should work now. That includes 8-bit sweeps! Thanks to Altirra I caught a last moment bug (classic lda 0 in stead of lda#0).

 

atari000.png.1a553098682985b914fea2fd52a0f285.png

 

8-bit resolution sweeps. You can set channel, start, end, interval, the amount of time you hear the sound, the amount of pause in between , and poly reset. The last one is not particularly useful, as it is pretty random. During manual exploration, you just press - or [ a couple of times to hear the right timbre or to check if there are different timbres, but the automated version is not synced in any way to get a certain timbre. But, it should still contain the proper base frequency. Except for the modulos that have silence sometimes ;)  Anyway, should be good enough to do some sweeps to get an impression. I lowered the lowest play time to 0.1s (rest: 1s, 2s, 4s), so it easy to test a sweep (and set gap time to 0s). The higher play and gap times are for future automated FFT frequency detection.

 

And last but not least, there's a separate PAL and NTSC version now. Might be merged in the future, but this is easier ;) Play and gap times should be adjusted to PAL/NTSC frame times and, if used on proper hardware/emulation settings, the sounds can be slightly different, too.

 

Countdown is a GTIA buzzer :D

 

pokeyexp-v0.2beta5-ntsc.xex pokeyexp-v0.2beta5-pal.xex

Edited by ivop
  • Like 1
Link to comment
Share on other sites

With AUDF2=$00, do you mean a joined 1+2 and 2 silent? And then $00 + interval $07 on AUDF1? (instead of the 8-bit mode I used, where the period starts at $03 with an interval of $07)

 

Edited by ivop
elaborated on my 8-bit sweep :)
Link to comment
Share on other sites

Yep that was it ... AUDCTL=$D0 ... three note tables.  On AUDF2=$00, you get a mod 7, and a non mod 7 table.  The third one requires inverse frequency ratios between AUDF1 and AUDF2, and can make warbling vibrato guitars,  where the vibrato speed can be modulated.   All of this has been documented in my note table.

Edited by Synthpopalooza
Link to comment
Share on other sites

I found this today: https://aubio.org/ and specifically its command line utility aubiopitch, which is almost exactly what we need :)

Looks promising IMHO. This is an analysis of previous done sweep. Cut-off the countdowns and normalized to 0dB. Next time, record at $8a or something.

 

Spoiler

$ aubiopitch -i sweep-8x-179-poly9-mod7.wav -B 48510 -H 48510 -u hertz -v -s -90 -p yinfast
using source: sweep-8x-179-poly9-mod7.wav at 44100Hz
pitch method: yinfast, pitch unit: hertz, buffer_size: 48510, hop_size: 48510, tolerance: 0.000000
0.000000 3470.160889
1.100000 1737.677612
2.200000 1157.762695
3.300000 867.133057
4.400000 347.094391
5.500000 578.728455
6.600000 495.760956
7.700000 433.681305
8.800000 385.712189
9.900000 347.095459
11.000000 315.449280
12.100000 289.225067
13.200000 267.004791
14.300000 247.881500
15.400000 231.346832
16.500000 216.935318
17.600000 204.153671
18.700001 192.793747
19.799999 182.668777
20.900000 173.535233
22.000000 165.258133
23.100000 157.748917
24.200001 150.900894
25.299999 144.605408
26.400000 138.814713
27.500000 133.489120
28.600000 128.542297
29.700001 123.942223
30.799999 119.674324
31.900000 115.690910
33.000000 111.950638
34.099998 108.449608
35.200001 105.173851
36.299999 102.075935
37.400002 99.154320
38.500000 96.406044
39.599998 93.801765
40.700001 93.802437
read 40.81s (1799871 samples in 38 blocks of 48510) from sweep-8x-179-poly9-mod7.wav at 44100Hz

 

 

Edit: Window at 4.4s seems off. I don't know why, yet. Think it should be times two, i.e. 694Hz.

 

Edit2: yin and yinfast are the only two pitch detection type that consistently show a downward trend. All the other methods show garbage frequencies.

 

Edit3: left column is time in seconds, right column is frequency in Hertz

 

Edit4: fixed some missing words, lol

 

Edited by ivop
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Synthpopalooza said:

https://www.liutaiomottola.com/formulae/freqtab.htm

 

This may be of use too.  Gonna play with this tonight.  

Keep in mind that these tables are tuned to A=440Hz

 

A4 -- 440Hz  -- 0.773m  -- Tuning reference note

 

You can take any value in the neighborhoud of 440Hz for the A4 reference note. Some people swear by 432Hz. For ehm.... reasons. You can google it. And a lot of orchestras over the world tune their whole arsenal of instruments to a lot of varying frequencies for A4.

 

4 hours ago, ivop said:

7.700000 433.681305

This could be our A4 :)

 

I'm currently working on 16-bit sweeps. I have an idea to easily do reverse 16-bit, too. After that, we'll compare frequency tables ?

 

I also want to merge PAL and NTSC again. It's not too much trouble, and in the end there's just one binary, which I like ?

Edited by ivop
Link to comment
Share on other sites

2 hours ago, Synthpopalooza said:

Well, there was a tuning table for $Ax 8-bit someone did, tuned to A4=432 or so ... which apparently allowed for greater octave range.   For standard documenting purposes though,  A4=440 is the best way.  We can always retune as needed.

Yes. Once we have all kind of sweeps in a spreadsheet (by frequency in Hertz), we can calculate all kinds of optimal tunings for different keys. Pure intonation, and equal temperament tuning. And which combinations of instruments work best together in specific keys, where A4 can be anything between 430Hz and 450Hz. Fascinating ;)

 

Edited by ivop
  • Like 1
Link to comment
Share on other sites

Here's v0.2beta6.

 

New: 16-bit sweeps work!

 

Example:

 

atari000.png.4b500a278107fb55a1f05f0408d993a9.png

 

Joined 3+4 with 3 @1.79. Sweep with interval of $FB, just because it's not $FF.

Short play time (0.1s) and no gap time (0s). Press START to sweep ;)

 

I tested all eight combinations, and they should work. Four times 16-bit channel combinations, and four times reverse 16-bit channel combinations where 2+4 turns into 4+2 (LSB/MSB swapped), etc.

 

Please explore ;) 

 

 

Edit: the sweep was done with Alitrra emulating a 600XL with 16kB, so this confirms it should work on a 16kB machine.

 

 

pokeyexp-v0.2beta6-ntsc.xex pokeyexp-v0.2beta6-pal.xex sweep-16bit-Ax.mp3

Edited by ivop
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...