Uxn - Virtual Computer

hehe what a very interesting issue, and what a good coincidence that 01 is INC :slight_smile:

i’m very glad you enjoyed the tutorial @m15o ! <3

@okyeron

2 Likes

Is there a way to make the piano polyphonic?

Could the / operator get added to the documentation?

Does sourcehut work like github and I could submit a PR over there? (I guess I’d have to make an account?)

Run multiple instances of piano? :stuck_out_tongue_winking_eye:

For better or worse requesting a merge on sourcehut uses git send-email. They have a tutorial here.

You could route different octaves to different channels yeah! There are 4 channels, you can set it up here.

Sure, make a .PATCH file and send it over :slight_smile:

1 Like

I’m wondering what everybody’s debug strategy is for uxn? When I have a simple off-by-one error or stack underflow or something like that, I’m finding it relatively difficult to debug without the whole [exit emulator, make an educated guess, reassemble, restart emulator] cycle. The onscreen debugger in the emulator is handy, but at 60fps I’m struggling to make use of it.

The halt output port of the System device is easily activated with this snippet:

%BREAKPOINT { #0101 #0e DEO2 }

Looking through the source, I believe that sets the program counter to 0x0000. Would it be beneficial to have the emulator pause without affecting the program counter, so that execution can continue?

Maybe the F4 key could be mapped to pause/continue, and then F5 could be set to “step” through a single instruction. This way I can watch the onscreen debugger and make sense of it one step at a time. Or maybe I’m just missing a better way to do this.

Thoughts?

this is pretty much just what I do, but I use a makefile so I can do make run and it does all those steps for me. probably not the best strategy though I’ll admit

has anybody else got uxn talking to grids yet? I’m currently attempting to build a program a la the MIDI shim to do it, but my osc/network knowledge (and, honestly, programming ability in general) is limiting.

I don’t understand, I’m running orca and piano this way:

uxnemu orca.rom |uxnemu piano.rom

then I trigger the piano like that:


.................4C4.........................................
............1D4...24TAaFE....................................
.............*y*y*/3F........................................

with the / command. But I don’t see how I could change channel.

I typically test routines in isolation with uxncli, I always have a blank tal file open that I can run in uxncli to see if it overflows. Once I know something behaves as expected, I put it in my project. But if you feel like implementing breakpoints, you should go for it :slight_smile:

Well, it depends how you want to control it, what sort of UX you have in mind. If we look at the play function, we see that it only plays using 1 channel. You could modify it so that a section of the keyboard plays on the second channel, etc…

@play ( pitch -- )
	
	DUP #0c MOD .last-note STZ 

	DUP #10 > OVR #30 < #0101 !! ,&continue JCN
		.Audio1/pitch DEO RTN
		&continue
		
	.Audio0/pitch DEO

RTN

I’m not driving the piano.rom from midi, but from uxn orca. To my understanding, uxn orca can only drive one instrument or instance.

yes, the orca byte operator only sends one byte, and the piano example takes that byte and plays it as a note in the single audio channel that it is programmed to use.
for the piano to be polyphonic you’d have to modify it so that it uses more than one audio channel (of the four available) to play.

complementing what @neauoire said, how you modify it would depend on how you’d want it to work.

maybe the easiest would be to have sections of the piano playing in different audio channels (e.g. if note is below 30 play in audio device 0, else play in audio device 1).

another option could be to play the note in the next audio channel that is not currently in use.

in any case, i feel-think that polyphonic piano program could be a nice addition to the collection when someone manages to hack it together, also implementing the corresponding visualization of the played notes :grin:

EDIT: maybe the easiest would be to modify orca to use the piano sample with its in-built synth :sweat_smile:

NEW EDIT as i can’t reply consecutively: following up on this, i just realized the change i suggested in the previous edit would be easier than i thought.

the setup of the orca built-in synths consists in setting their ADSR, volume, length and sample.

we can compare it with the audio device setup in piano, and see the values that it uses: 041c for the ADSR, dd for the volume, 0100 for the length, and it uses the sin-pcm sample (that orca also uses in its first channel).

so, editing the orca synths to match the piano synth would allow us to have orca with a “polyphonic piano” built-in already.

don’t know if this helps, but it can be an interesting avenue for experimenting with uxn orca directly.

2 Likes


I got grid I/O going with uxn! The code is still in a very early state but you’re free to try it out: nihilazo/grid-uxn: monome grid I/O from uxn - grid-uxn - tildegit
The demo only shows basic output but all the grid osc commands are supported! I’m going to write a more complex example sometime.

6 Likes

ooooh, nifty!

What device is that running on and what dependencies are there (if any)?

my grid thing? It’s running on a linux PC and only needs libmonome.

1 Like

i’m happy to share with you all that uxn tutorial day 6: towards pong is now online!

here we talk about how we can integrate everything that we have covered so far in order to create more complex subroutines and programs for the varvara computer.

we base our discussion in a recreation of the classic pong game :slight_smile:

besides using previous strategies and snippets of code, we cover strategies for drawing and controlling multi-tile sprites, and for checking collisions.

i hope you find it useful and/or enjoy it in one way or another! :heart:

Peek 14-09-2021 16-58

6 Likes

Can anyone help me setting UXN on a 3DS?

I used TwilightMenu++ to load the .nds file and tried to open orca but I only got the bottom screen with the keyboard working

The uxnds emulator is a bit behind with the screen device, we need to ask Asie to pull the repo. Lemme get back to you on this.

thank you again for making these, I’ve been wondering how to do collisions for a while now. you’re a really good teacher lol

2 Likes