Hi @utz,

Thanks for taking the time to humour me. I'm going to go away and have a play but I have a suspicion that getting my head around this may require rather more time than I currently have available. For my immediate need I suspect I'll end up having to find a (very) simple copyright expired piano score to translate directly to my player - a piece of Ragtime perhaps big_smile big_smile big_smile.

Best wishes,

Tom

Many thanks for the positive welcome @utz, and thanks for not just dismissing me as a freeloader, which of course in a manner of speaking I am ;-)

utz wrote:

It's the "not too much work to convert" part that has me slightly worried.

OK. The routine I posted:

  • only plays notes from the standard "western" music scale (which probably has a fancy name of which I am unaware) each encoded as a single byte.

  • plays all notes for the period between (software) interrupts, 0.25s, though because there is no pause between notes playing a single note for multiples of that length is possible.

  • plays all notes with the same volume.

  • doesn't explicitly have any concept of a "rest", though that would be easy enough to add

  • is simple enough to decode it doesn't consume much CPU time even when implemented in BASIC.

So in an ideal world I would find a music track simple enough to be adapted to those restrictions. However the world isn't necessarily ideal and I don't object to putting in some effort ;-)

utz wrote:

Do you have any experience with Python or Rust?

I'm mostly a Java and C/C++ programmer but I can get by in most other conventional programming languages if I've got an internet connection; Python shouldn't be a problem and I'm not (yet) scared of Rust.

utz wrote:

If so, you could build yourself an XM converter using either Shiru's Python-based xmlib or my slightly wonky Rust-based xmkit.

I obviously need to do some reading, and will try to do so before I post again. My initial thought is "Convert them into what ?", or is convert a euphamism for "play XM files" here ?

utz wrote:

... you might even be able to convince someone on here to write some music for you.

For my little game that does not seem like a worthwhile use of somebody's time and talent.

utz wrote:

The in-game music you have now doesn't sound like 1-bit music though? Note this forum is about 1-bit music, not 1-channel music. Though Shiru has some music that's both 1-bit and 1-channel - but that wouldn't necessary be that easy to convert.

I had a look at https://www.ludomusicology.org/2018/12/ … bit-music/ and since the PicoMite (specifically the Raspberry Pi Pico) has no DAC / specialised sound hardware then it might be considered 1-bit music(YMMV), I think it uses PWM to achieve audio. However I'm not working that close to the hardware so all this is hidden by the the MMBasic PLAY SOUND command which can output sine, square, triangle or rising sawtooth waves with 4 different waves on each of the left and right channels - the code I presented used a single sine wave going to both L&R channels. Note that the MMBasic firmware can actually play .WAV files (and on the Colour Maximite 2 only, .MOD files), but that rather feels like cheating.

I'm really just looking for something 80's videogame appropriate and at first blush this seemed like an approachable community who if they couldn't help me directly would be able to signpost the way.

Best wishes,

Tom

P.S.

I realised the code I posted was missing an important routine to populate the MUSIC%() array:

Sub read_music()
  Local i%
  Restore music_data
  For i% = 0 To Bound(MUSIC%(), 1)
    Read MUSIC%(i%)
  Next
End Sub

Hello folks,

First time poster, probably showing dreadful etiquette, but hoping someone will choose to help me anyway ;-)

I'm a programmer with no musical talent and currently working on a FREE and open-source simple little Tron light-cycle game for the PicoMite VGA and Colour Maximite 2.

It's nothing very special but it's keeping me out of trouble:

    https://youtu.be/Q9_FxvCC3v0

Its current music track is hopefully just temporary, it was composed for me by a friend over 20 years ago and I've already used it in something else, and in any case am hoping for something a little more thematic.

It's a simple 1-channel track played from MMBasic, the (incomplete) extract below will probably give some of you the idea

Dim MUSIC%(68)
Dim music_flag% = 1
Dim music_ptr% = Peek(VarAddr MUSIC%()) + 4

' Music and sound effects are played on SetTick interrupts.
SetTick 250, play_music, 1

' Run forever
Do : Loop

' Called from interrupt to play next note of music.
Sub play_music()
  If music_flag% Then
    Local note% = Peek(Byte music_ptr%)
    If note% = &hFF Then
      music_ptr% = Peek(VarAddr MUSIC%()) + 4
      note% = Peek(Byte music_ptr%)
    EndIf
    Play Sound 1, B, s, 440 * 2 ^ ((note% - 2) / 12.0), 15
    Inc music_ptr%
  Else
    Play Sound 1, B, O
  EndIf
End Sub

' Start a new sound effect.
Sub start_soundfx(ptr%, wait_%)
  If Not soundfx_flag% Then Exit Sub

  ' Wait for current sound effect to end.
  If wait_% Then Do While Peek(Byte soundfx_ptr%) <> &hFF : Loop

  soundfx_ptr% = ptr%

  ' Wait for first note of new sound effect to play.
  Do While soundfx_ptr% = ptr% : Loop
End Sub

' Called from interrupt to play next note of current sound effect.
Sub play_soundfx()
  If soundfx_flag% Then
    Local note% = Peek(Byte soundfx_ptr%)
    If note% < &hFF Then
      Play Sound 2, B, s, 440 * 2 ^ ((note% - 2) / 12.0)
      Inc soundfx_ptr%
    Else
      Play Sound 2, B, O
    EndIf
  Else
    Play Sound 2, B, O
  EndIf
End Sub

music_data:

Data &h0900090500000220, &h0900090509000905, &h0900090509000905, &h0900090509000905
Data &h1818181509000905, &h181818151818181A, &h151618161818181A, &h1516181613111516
Data &h1818181513111516, &h181818151518151A, &h151618131818181A, &h0C0E0C1315131516
Data &h181818150704000C, &h181818151818181A, &h151618161818181A, &h1516181613111516
Data &h1818181513111516, &h181818151518151A, &h151618131818181A, &h091D051115131516
Data &h1515150E0509051D, &h1515150E15151516, &h1013151315151516, &h1013151310131513
Data &h1515150E00040013, &h1515150E15151516, &h1311101315151516, &h1615131615131115
Data &h1818181500000C18, &h181818151818181A, &h151618161818181A, &h1516181613111516
Data &h1818181513111516, &h181818151518151A, &h151618131818181A, &h0C0E0C1315131516
Data &h181818150704000C, &h181818151818181A, &h151618161818181A, &h1516181613111516
Data &h1818181513111516, &h181818151518151A, &h151618131818181A, &h091D051115131516
Data &h1515150E0509051D, &h1515150E15151516, &h1013151315151516, &h1013151310131513
Data &h1515150E00040013, &h1515150E15151516, &h1311101315151516, &h1615131615131115
Data &h1818181500000C18, &h181818151818181A, &h151618161818181A, &h1516181613111516
Data &h1818181513111516, &h181818151518151A, &h151618131818181A, &h0C0E0C1315131516
Data &h181818150704000C, &h181818151818181A, &h151618161818181A, &h1516181613111516
Data &h1818181513111516, &h181818151518151A, &h151618131818181A, &h091D051115131516
Data &hFFFFFFFF0509051D

I don't suppose anyone can point me at a source of similar existing music tracks that aren't going to require too much work to convert and aren't going to require more than a name-check in the game's credits as "payment" ?

Best wishes,

Tom