01-21-2024, 09:26 AM
(01-21-2024, 01:56 AM)johnno56 Wrote: I am curious... There does not seem to be a "library" for "createsound()". How did you manage to get N7 to create sounds? (if this is a "herbs and spices" kind of thing, then just ignore the request... lol)
J
Sometimes a library isn't enough. I could have solved it directly in n7 by generating a temporary wav file and loading it with 'loadsound', but that felt dirty, so I decided to add a function to the core of the language instead. Its communication with the runtime is implemented in source/syscmd.c (CreateSound) and the actual work in source/audio_portaudio.c (AUD_CreateSound and BuildSoundData - also used when converting data from wav files to n7's fixed sample rate). That's why I had to release a new version of n7 for this to work
I'm planning to write a library, written in n7, that uses 'createsound' to generate cool sound effects. The functions I wrote for the example (CreateSineSfx, CreateSquareSfx and CreateNoiseSfx), also used in denaalaafender, were just a test of 'createsound'.