that does work, then why doesn't this work?
./a.out | sox -r 8000 -c 1 -t u8 - -d
doesn't work
but if uint8_t is changed to int, it works well..
also in sox sounds sounds different compared to say mpv, cannot decide which
is better because I cannot seek forward in sox's play?

can you make music with sox/play alone? you can make guitar sounds with play,
maybe can also somehow write a whole song only in CLI?

#include <stdio.h>
#include <stdint.h>

int main (int argc, char **argv) {
  uint8_t t = 0;
  for (t=0;;t++)
    putchar(t*((t>>12|t>>8)&63&t>>4));
}


On Sat, February 3, 2024 2:58 pm, Nick Owens wrote:
> try piping to
>
> sox -r 8000 -c 1 -t u8 - -d
>
> for example, this should work as a demo:
>
> python3 -c 'import sys; [sys.stdout.write(chr(( t & (t >> 8)) % 256)) for t in
> range(2**19)]' | sox -r 8000 -c 1 -t u8 - -d
>
>
> On Sat, Feb 3, 2024 at 6:20 AM <[email protected]> wrote:
>
>>
>> thank you, stranger!
>>
>> I found so many good C formulas, some sound like they could be used within
>> a game, even has pauses with silence and everything!
>>
>> I had to find out how to use sox, though on another site: `sox -r 8000 -c
>> -t
>> u8 test.raw output.wav`
>>
>> what is weird is that I can't get bytebeats if the `t` is int8_t or
>> something.. doesn't seem like that makes sense, it's like 4 bytes 32-bit,
>> not 1 byte.
>> not sure difference between signed 32, 64 and unsigned, but I tried 16-bit
>> `t`
>> and it's just not it.. am I messing something up?
>>
>> does this only mimic bytebeat, and is not true 8-bit technique to get
>> realistic bytebeat?
>>
>> On Fri, February 2, 2024 9:15 pm, Nick Owens wrote:
>>
>>> back when i used to mess with these, i frequently used `sox` to play the
>>> 8-bit
>>> samples. it can do the sample conversion for you to whatever the system
>>> needs.
>>>
>>>
>>> On Fri, Feb 2, 2024 at 11:08 AM Omar Polo <[email protected]> wrote:
>>>
>>>
>>>>
>>>> On 2024/02/02 18:41:46 +0000, [email protected] wrote:
>>>>
>>>>
>>>>> hello
>>>>>
>>>>> I've tried for hours to play bytebeat as everyone else
>>>>>
>>>>>
>>>>>
>>>>> I cannot find anything on the entire internet
>>>>>
>>>>>
>>>>>
>>>>> all I got is `cat a.out >> /dev/speaker)` as root.. a.out is compiled
>>>>>  code , a loop and `putchar(t*((t>>12|t>>8)&63&t>>4));`.. this
>>>>> doesn't sound nearly the same as it does to other people it's also
>>>>> slow, not fast
>>>>
>>>> I don't think it makes sense to feed speaker(4) with an executable
>>>> code.
>>>>
>>>>
>>>> Haven't seen the code, but based on your description I guess it should
>>>> be more like
>>>>
>>>> $ ./a.out | doas tee /dev/speaker
>>>>
>>>>
>>>>
>>>> or at least that's my guess, my crystall ball don't always works
>>>> correctly.
>>>>
>>>
>>>
>>
>>
>>
>
>



Reply via email to